Skip to content

Commit de1dadd

Browse files
authored
Merge pull request wavelog#177 from wavelog/dev
Release 1.2
2 parents d3e8de0 + a0fa240 commit de1dadd

File tree

191 files changed

+7767
-3294
lines changed

Some content is hidden

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

191 files changed

+7767
-3294
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/application/config/database.php
22
/application/config/config.php
33
/application/logs/*.php
4+
/application/cache/*
45
/uploads/*.adi
56
/uploads/*.ADI
67
/uploads/*.tq8
@@ -19,4 +20,5 @@ sync.sh
1920
*.p12
2021
*.swp
2122
.debug
23+
.maintenance
2224
.htaccess

application/config/autoload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
|
128128
*/
129129

130-
$autoload['model'] = array('user_options_model');
130+
$autoload['model'] = array('user_options_model', 'logbooks_model', 'stations', 'oqrs_model');
131131

132132

133133
/* End of file autoload.php */

application/config/config.sample.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
$config['app_name'] = "Wavelog";
1616
$config['directory'] = "logbook";
1717
$config['callbook'] = "hamqth"; // Options are hamqth or qrz
18+
1819
$config['datadir'] = null; // default to install directory
1920

2021
/*
@@ -675,4 +676,4 @@
675676
|
676677
*/
677678

678-
// $config['userdata'] = "userdata";
679+
$config['userdata'] = "userdata";

application/config/migration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
|
2323
*/
2424

25-
$config['migration_version'] = 180;
25+
$config['migration_version'] = 184;
2626

2727
/*
2828
|--------------------------------------------------------------------------

application/controllers/Adif.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public function import() {
193193
$f_elements=explode(".",$fdata['upload_data']['file_name']);
194194
if (strtolower($f_elements[count($f_elements)-1])=='zip') {
195195
$f_adif = preg_replace('/\\.zip$/', '', $fdata['upload_data']['file_name']);
196-
$p_adif = preg_replace('/^(.*)(_)(\S{2,4})$/', '$1.$3', $f_adif); // Bug in CodeIgniter. Destroys Filename if there is more than one dot.
196+
$p_adif = hash('sha256', $this->session->userdata('user_callsign') ).'.adif';
197197
if (preg_match("/.*\.adi.?$/",strtolower($p_adif))) { // Check if adi? inside zip
198198
$zip = new ZipArchive;
199199
if ($zip->open('./uploads/'.$fdata['upload_data']['file_name'])) {

application/controllers/Awards.php

Lines changed: 214 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,80 @@ public function waja () {
247247
$this->load->view('interface_assets/footer', $footerData);
248248
}
249249

250+
public function jcc () {
251+
$footerData = [];
252+
$footerData['scripts'] = ['assets/js/sections/jcc.js'];
253+
254+
$this->load->model('jcc_model');
255+
$this->load->model('modes');
256+
$this->load->model('bands');
257+
258+
$data['worked_bands'] = $this->bands->get_worked_bands('jcc');
259+
$data['modes'] = $this->modes->active();
260+
261+
if ($this->input->post('band') != NULL) { // Band is not set when page first loads.
262+
if ($this->input->post('band') == 'All') { // Did the user specify a band? If not, use all bands
263+
$bands = $data['worked_bands'];
264+
}
265+
else {
266+
$bands[] = $this->security->xss_clean($this->input->post('band'));
267+
}
268+
}
269+
else {
270+
$bands = $data['worked_bands'];
271+
}
272+
273+
$data['bands'] = $bands; // Used for displaying selected band(s) in the table in the view
274+
275+
if($this->input->method() === 'post') {
276+
$postdata['qsl'] = $this->security->xss_clean($this->input->post('qsl'));
277+
$postdata['lotw'] = $this->security->xss_clean($this->input->post('lotw'));
278+
$postdata['eqsl'] = $this->security->xss_clean($this->input->post('eqsl'));
279+
$postdata['qrz'] = $this->security->xss_clean($this->input->post('qrz'));
280+
$postdata['worked'] = $this->security->xss_clean($this->input->post('worked'));
281+
$postdata['confirmed'] = $this->security->xss_clean($this->input->post('confirmed'));
282+
$postdata['notworked'] = $this->security->xss_clean($this->input->post('notworked'));
283+
$postdata['includedeleted'] = $this->security->xss_clean($this->input->post('includedeleted'));
284+
$postdata['Africa'] = $this->security->xss_clean($this->input->post('Africa'));
285+
$postdata['Asia'] = $this->security->xss_clean($this->input->post('Asia'));
286+
$postdata['Europe'] = $this->security->xss_clean($this->input->post('Europe'));
287+
$postdata['NorthAmerica'] = $this->security->xss_clean($this->input->post('NorthAmerica'));
288+
$postdata['SouthAmerica'] = $this->security->xss_clean($this->input->post('SouthAmerica'));
289+
$postdata['Oceania'] = $this->security->xss_clean($this->input->post('Oceania'));
290+
$postdata['Antarctica'] = $this->security->xss_clean($this->input->post('Antarctica'));
291+
$postdata['band'] = $this->security->xss_clean($this->input->post('band'));
292+
$postdata['mode'] = $this->security->xss_clean($this->input->post('mode'));
293+
}
294+
else { // Setting default values at first load of page
295+
$postdata['qsl'] = 1;
296+
$postdata['lotw'] = 1;
297+
$postdata['eqsl'] = 0;
298+
$postdata['qrz'] = 0;
299+
$postdata['worked'] = 1;
300+
$postdata['confirmed'] = 1;
301+
$postdata['notworked'] = 0;
302+
$postdata['includedeleted'] = 0;
303+
$postdata['Africa'] = 1;
304+
$postdata['Asia'] = 1;
305+
$postdata['Europe'] = 1;
306+
$postdata['NorthAmerica'] = 1;
307+
$postdata['SouthAmerica'] = 1;
308+
$postdata['Oceania'] = 1;
309+
$postdata['Antarctica'] = 1;
310+
$postdata['band'] = 'All';
311+
$postdata['mode'] = 'All';
312+
}
313+
314+
$data['jcc_array'] = $this->jcc_model->get_jcc_array($bands, $postdata);
315+
$data['jcc_summary'] = $this->jcc_model->get_jcc_summary($bands, $postdata);
316+
317+
// Render Page
318+
$data['page_title'] = "Awards - JCC";
319+
$this->load->view('interface_assets/header', $data);
320+
$this->load->view('awards/jcc/index');
321+
$this->load->view('interface_assets/footer', $footerData);
322+
}
323+
250324
public function vucc() {
251325
$this->load->model('vucc');
252326
$this->load->model('bands');
@@ -581,12 +655,20 @@ public function rac() {
581655
$this->load->view('interface_assets/footer', $footerData);
582656
}
583657

584-
public function iota () {
585-
$this->load->model('iota');
658+
public function helvetia() {
659+
$footerData = [];
660+
$footerData['scripts'] = [
661+
'assets/js/sections/helvetiamap_geojson.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/helvetiamap_geojson.js")),
662+
'assets/js/sections/helvetiamap.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/helvetiamap.js")),
663+
'assets/js/leaflet/L.Maidenhead.js',
664+
];
665+
666+
$this->load->model('helvetia_model');
586667
$this->load->model('modes');
587668
$this->load->model('bands');
588669

589-
$data['worked_bands'] = $this->bands->get_worked_bands('iota'); // Used in the view for band select
670+
$data['worked_bands'] = $this->bands->get_worked_bands('helvetia');
671+
$data['modes'] = $this->modes->active(); // Used in the view for mode select
590672

591673
if ($this->input->post('band') != NULL) { // Band is not set when page first loads.
592674
if ($this->input->post('band') == 'All') { // Did the user specify a band? If not, use all bands
@@ -601,48 +683,99 @@ public function iota () {
601683
}
602684

603685
$data['bands'] = $bands; // Used for displaying selected band(s) in the table in the view
604-
$data['modes'] = $this->modes->active(); // Used in the view for mode select
605686

606687
if($this->input->method() === 'post') {
688+
$postdata['qsl'] = $this->security->xss_clean($this->input->post('qsl'));
689+
$postdata['lotw'] = $this->security->xss_clean($this->input->post('lotw'));
690+
$postdata['eqsl'] = $this->security->xss_clean($this->input->post('eqsl'));
691+
$postdata['qrz'] = $this->security->xss_clean($this->input->post('qrz'));
607692
$postdata['worked'] = $this->security->xss_clean($this->input->post('worked'));
608693
$postdata['confirmed'] = $this->security->xss_clean($this->input->post('confirmed'));
609694
$postdata['notworked'] = $this->security->xss_clean($this->input->post('notworked'));
610-
$postdata['includedeleted'] = $this->security->xss_clean($this->input->post('includedeleted'));
611-
$postdata['Africa'] = $this->security->xss_clean($this->input->post('Africa'));
612-
$postdata['Asia'] = $this->security->xss_clean($this->input->post('Asia'));
613-
$postdata['Europe'] = $this->security->xss_clean($this->input->post('Europe'));
614-
$postdata['NorthAmerica'] = $this->security->xss_clean($this->input->post('NorthAmerica'));
615-
$postdata['SouthAmerica'] = $this->security->xss_clean($this->input->post('SouthAmerica'));
616-
$postdata['Oceania'] = $this->security->xss_clean($this->input->post('Oceania'));
617-
$postdata['Antarctica'] = $this->security->xss_clean($this->input->post('Antarctica'));
618695
$postdata['band'] = $this->security->xss_clean($this->input->post('band'));
619696
$postdata['mode'] = $this->security->xss_clean($this->input->post('mode'));
620697
}
621698
else { // Setting default values at first load of page
699+
$postdata['qsl'] = 1;
700+
$postdata['lotw'] = 1;
701+
$postdata['eqsl'] = 0;
702+
$postdata['qrz'] = 0;
622703
$postdata['worked'] = 1;
623704
$postdata['confirmed'] = 1;
624705
$postdata['notworked'] = 1;
625-
$postdata['includedeleted'] = 0;
626-
$postdata['Africa'] = 1;
627-
$postdata['Asia'] = 1;
628-
$postdata['Europe'] = 1;
629-
$postdata['NorthAmerica'] = 1;
630-
$postdata['SouthAmerica'] = 1;
631-
$postdata['Oceania'] = 1;
632-
$postdata['Antarctica'] = 1;
633706
$postdata['band'] = 'All';
634707
$postdata['mode'] = 'All';
635708
}
636709

637-
$iotalist = $this->iota->fetchIota($postdata);
638-
$data['iota_array'] = $this->iota->get_iota_array($iotalist, $bands, $postdata);
639-
$data['iota_summary'] = $this->iota->get_iota_summary($bands, $postdata);
710+
$data['helvetia_array'] = $this->helvetia_model->get_helvetia_array($bands, $postdata);
711+
$data['helvetia_summary'] = $this->helvetia_model->get_helvetia_summary($bands, $postdata);
640712

641713
// Render Page
642-
$data['page_title'] = "Awards - IOTA (Islands On The Air)";
714+
$data['page_title'] = "Awards - H26";
643715
$this->load->view('interface_assets/header', $data);
644-
$this->load->view('awards/iota/index');
645-
$this->load->view('interface_assets/footer');
716+
$this->load->view('awards/helvetia/index');
717+
$this->load->view('interface_assets/footer', $footerData);
718+
}
719+
720+
public function iota () {
721+
$this->load->model('iota');
722+
$this->load->model('modes');
723+
$this->load->model('bands');
724+
725+
$data['worked_bands'] = $this->bands->get_worked_bands('iota'); // Used in the view for band select
726+
727+
if ($this->input->post('band') != NULL) { // Band is not set when page first loads.
728+
if ($this->input->post('band') == 'All') { // Did the user specify a band? If not, use all bands
729+
$bands = $data['worked_bands'];
730+
} else {
731+
$bands[] = $this->security->xss_clean($this->input->post('band'));
732+
}
733+
} else {
734+
$bands = $data['worked_bands'];
735+
}
736+
737+
$data['bands'] = $bands; // Used for displaying selected band(s) in the table in the view
738+
$data['modes'] = $this->modes->active(); // Used in the view for mode select
739+
740+
if($this->input->method() === 'post') {
741+
$postdata['worked'] = $this->security->xss_clean($this->input->post('worked')) ?? NULL;
742+
$postdata['confirmed'] = $this->security->xss_clean($this->input->post('confirmed')) ?? NULL;
743+
$postdata['notworked'] = $this->security->xss_clean($this->input->post('notworked')) ?? NULL;
744+
$postdata['includedeleted'] = $this->security->xss_clean($this->input->post('includedeleted')) ?? NULL;
745+
$postdata['Africa'] = $this->security->xss_clean($this->input->post('Africa')) ?? NULL;
746+
$postdata['Asia'] = $this->security->xss_clean($this->input->post('Asia')) ?? NULL;
747+
$postdata['Europe'] = $this->security->xss_clean($this->input->post('Europe')) ?? NULL;
748+
$postdata['NorthAmerica'] = $this->security->xss_clean($this->input->post('NorthAmerica')) ?? NULL;
749+
$postdata['SouthAmerica'] = $this->security->xss_clean($this->input->post('SouthAmerica')) ?? NULL;
750+
$postdata['Oceania'] = $this->security->xss_clean($this->input->post('Oceania')) ?? NULL;
751+
$postdata['Antarctica'] = $this->security->xss_clean($this->input->post('Antarctica')) ?? NULL;
752+
$postdata['band'] = $this->security->xss_clean($this->input->post('band')) ?? NULL;
753+
$postdata['mode'] = $this->security->xss_clean($this->input->post('mode')) ?? NULL;
754+
} else { // Setting default values at first load of page
755+
$postdata['worked'] = 1;
756+
$postdata['confirmed'] = 1;
757+
$postdata['notworked'] = 1;
758+
$postdata['includedeleted'] = 0;
759+
$postdata['Africa'] = 1;
760+
$postdata['Asia'] = 1;
761+
$postdata['Europe'] = 1;
762+
$postdata['NorthAmerica'] = 1;
763+
$postdata['SouthAmerica'] = 1;
764+
$postdata['Oceania'] = 1;
765+
$postdata['Antarctica'] = 1;
766+
$postdata['band'] = 'All';
767+
$postdata['mode'] = 'All';
768+
}
769+
770+
$iotalist = $this->iota->fetchIota($postdata);
771+
$data['iota_array'] = $this->iota->get_iota_array($iotalist, $bands, $postdata);
772+
$data['iota_summary'] = $this->iota->get_iota_summary($bands, $postdata);
773+
774+
// Render Page
775+
$data['page_title'] = "Awards - IOTA (Islands On The Air)";
776+
$this->load->view('interface_assets/header', $data);
777+
$this->load->view('awards/iota/index');
778+
$this->load->view('interface_assets/footer');
646779
}
647780

648781
public function counties() {
@@ -1066,6 +1199,61 @@ public function rac_map() {
10661199
echo json_encode($states);
10671200
}
10681201

1202+
/*
1203+
function H26_map
1204+
1205+
This displays the H26 map and requires the $band_type and $mode_type
1206+
*/
1207+
public function helvetia_map() {
1208+
$stateString = 'AG,AI,AR,BE,BL,BS,FR,GE,GL,GR,JU,LU,NE,NW,OW,SG,SH,SO,SZ,TG,TI,UR,VD,VS,ZG,ZH';
1209+
$helvetiaArray = explode(',', $stateString);
1210+
1211+
$this->load->model('helvetia_model');
1212+
1213+
$bands[] = $this->security->xss_clean($this->input->post('band'));
1214+
1215+
$postdata['qsl'] = $this->input->post('qsl') == 0 ? NULL: 1;
1216+
$postdata['lotw'] = $this->input->post('lotw') == 0 ? NULL: 1;
1217+
$postdata['eqsl'] = $this->input->post('eqsl') == 0 ? NULL: 1;
1218+
$postdata['qrz'] = $this->input->post('qrz') == 0 ? NULL: 1;
1219+
$postdata['worked'] = $this->input->post('worked') == 0 ? NULL: 1;
1220+
$postdata['confirmed'] = $this->input->post('confirmed') == 0 ? NULL: 1;
1221+
$postdata['notworked'] = $this->input->post('notworked') == 0 ? NULL: 1;
1222+
$postdata['band'] = $this->security->xss_clean($this->input->post('band'));
1223+
$postdata['mode'] = $this->security->xss_clean($this->input->post('mode'));
1224+
1225+
$helvetia_array = $this->helvetia_model->get_helvetia_array($bands, $postdata);
1226+
1227+
$states = array();
1228+
1229+
foreach ($helvetiaArray as $state) { // Generating array for use in the table
1230+
$states[$state] = '-'; // Inits each state's count
1231+
}
1232+
1233+
1234+
foreach ($helvetia_array as $was => $value) {
1235+
foreach ($value as $key) {
1236+
if($key != "") {
1237+
if (strpos($key, '>W<') !== false) {
1238+
$states[$was] = 'W';
1239+
break;
1240+
}
1241+
if (strpos($key, '>C<') !== false) {
1242+
$states[$was] = 'C';
1243+
break;
1244+
}
1245+
if (strpos($key, '-') !== false) {
1246+
$states[$was] = '-';
1247+
break;
1248+
}
1249+
}
1250+
}
1251+
}
1252+
1253+
header('Content-Type: application/json');
1254+
echo json_encode($states);
1255+
}
1256+
10691257
/*
10701258
function cq_map
10711259
This displays the CQ Zone map and requires the $band_type and $mode_type

application/controllers/Band.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ public function saveBand() {
122122
$band['cq'] = $this->security->xss_clean($this->input->post('cq'));
123123
$band['dok'] = $this->security->xss_clean($this->input->post('dok'));
124124
$band['dxcc'] = $this->security->xss_clean($this->input->post('dxcc'));
125+
$band['helvetia'] = $this->security->xss_clean($this->input->post('helvetia'));
125126
$band['iota'] = $this->security->xss_clean($this->input->post('iota'));
126127
$band['sig'] = $this->security->xss_clean($this->input->post('sig'));
127128
$band['sota'] = $this->security->xss_clean($this->input->post('sota'));

application/controllers/Cfdexport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function export() {
3939
$qsos = $this->logbook_model->cfd_get_all_qsos($fromdate, $todate);
4040
$output=strtoupper($this->session->userdata('user_callsign'))."\n";
4141
$output.='--------------------------------------------------------------
42-
MostWanted 1.42 - Overview Confirmed Entities
42+
Wavelog '.$this->optionslib->get_option('version').' - Overview Confirmed Entities
4343
(M=Mixed C=CW F=Fone R=Rest)
4444
==============================================================
4545

application/controllers/Components.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function __construct() {
1515

1616
public function index() {
1717
$this->load->model('stations');
18-
$url = 'https://oscarwatch.org/scripts/hamsat_json.php';
18+
$url = 'https://hams.at/api/alerts/upcoming';
1919
$json = file_get_contents($url);
2020
$data['rovedata'] = json_decode($json, true);
2121
$data['gridsquare'] = strtoupper($this->stations->find_gridsquare());

0 commit comments

Comments
 (0)