Skip to content

Commit 6de5cff

Browse files
committed
Handle absent colors in award maps
1 parent 76492ad commit 6de5cff

File tree

9 files changed

+73
-41
lines changed

9 files changed

+73
-41
lines changed

application/controllers/Awards.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function __construct()
2020
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
2121

2222
$map_custom = json_decode($this->optionslib->get_map_custom());
23-
$this->user_map_color_qso = $map_custom->qso->color;
23+
$this->user_map_color_qso = $map_custom->qso->color ?? '';
2424
$this->user_map_color_qsoconfirm = $map_custom->qsoconfirm->color ?? '';
2525
$this->user_map_color_unworked = $map_custom->unworked->color ?? '';
2626
}

assets/js/sections/cqmap.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@ var geojson;
44
var map;
55
var info;
66

7-
let confirmedColor = user_map_custom.qsoconfirm.color;
8-
let workedColor = user_map_custom.qso.color;
9-
let unworkedColor = '';
7+
let unworkedColor = 'red';
108
if (typeof(user_map_custom.unworked) !== 'undefined') {
119
unworkedColor = user_map_custom.unworked.color;
12-
} else {
13-
unworkedColor = 'red';
10+
}
11+
let workedColor = 'rgba(255, 0, 0)';
12+
if (typeof(user_map_custom.qso) !== 'undefined') {
13+
workedColor = user_map_custom.qso.color;
14+
}
15+
let confirmedColor = 'rgba(144,238,144)';
16+
if (typeof(user_map_custom.qsoconfirm) !== 'undefined') {
17+
confirmedColor = user_map_custom.qsoconfirm.color;
1418
}
1519

1620
document.addEventListener("DOMContentLoaded", function() {

assets/js/sections/iotamap.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
let confirmedColor = user_map_custom.qsoconfirm.color;
2-
let workedColor = user_map_custom.qso.color;
3-
let unworkedColor = '';
1+
let unworkedColor = 'red';
42
if (typeof(user_map_custom.unworked) !== 'undefined') {
53
unworkedColor = user_map_custom.unworked.color;
6-
} else {
7-
unworkedColor = 'red';
4+
}
5+
let workedColor = 'rgba(255, 0, 0)';
6+
if (typeof(user_map_custom.qso) !== 'undefined') {
7+
workedColor = user_map_custom.qso.color;
8+
}
9+
let confirmedColor = 'rgba(144,238,144)';
10+
if (typeof(user_map_custom.qsoconfirm) !== 'undefined') {
11+
confirmedColor = user_map_custom.qsoconfirm.color;
812
}
913

1014
var osmUrl = $('#iotamapjs').attr("tileUrl");

assets/js/sections/itumap.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@ let geojson;
44
let map;
55
let info;
66

7-
let confirmedColor = user_map_custom.qsoconfirm.color;
8-
let workedColor = user_map_custom.qso.color;
9-
let unworkedColor = '';
7+
let unworkedColor = 'red';
108
if (typeof(user_map_custom.unworked) !== 'undefined') {
119
unworkedColor = user_map_custom.unworked.color;
12-
} else {
13-
unworkedColor = 'red';
10+
}
11+
let workedColor = 'rgba(255, 0, 0)';
12+
if (typeof(user_map_custom.qso) !== 'undefined') {
13+
workedColor = user_map_custom.qso.color;
14+
}
15+
let confirmedColor = 'rgba(144,238,144)';
16+
if (typeof(user_map_custom.qsoconfirm) !== 'undefined') {
17+
confirmedColor = user_map_custom.qsoconfirm.color;
1418
}
1519

1620
function load_itu_map() {

assets/js/sections/jccmap.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
let osmUrl = tileUrl;
2-
let confirmedColor = user_map_custom.qsoconfirm.color;
3-
let workedColor = user_map_custom.qso.color;
4-
let unworkedColor = '';
2+
let unworkedColor = 'red';
53
if (typeof(user_map_custom.unworked) !== 'undefined') {
64
unworkedColor = user_map_custom.unworked.color;
7-
} else {
8-
unworkedColor = 'red';
5+
}
6+
let workedColor = 'rgba(255, 0, 0)';
7+
if (typeof(user_map_custom.qso) !== 'undefined') {
8+
workedColor = user_map_custom.qso.color;
9+
}
10+
let confirmedColor = 'rgba(144,238,144)';
11+
if (typeof(user_map_custom.qsoconfirm) !== 'undefined') {
12+
confirmedColor = user_map_custom.qsoconfirm.color;
913
}
1014

1115
function load_jcc_map() {

assets/js/sections/racmap.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@ let map;
55
let info;
66
let clickmarkers = [];
77

8-
let confirmedColor = user_map_custom.qsoconfirm.color;
9-
let workedColor = user_map_custom.qso.color;
10-
let unworkedColor = '';
8+
let unworkedColor = 'red';
119
if (typeof(user_map_custom.unworked) !== 'undefined') {
1210
unworkedColor = user_map_custom.unworked.color;
13-
} else {
14-
unworkedColor = 'red';
11+
}
12+
let workedColor = 'rgba(255, 0, 0)';
13+
if (typeof(user_map_custom.qso) !== 'undefined') {
14+
workedColor = user_map_custom.qso.color;
15+
}
16+
let confirmedColor = 'rgba(144,238,144)';
17+
if (typeof(user_map_custom.qsoconfirm) !== 'undefined') {
18+
confirmedColor = user_map_custom.qsoconfirm.color;
1519
}
1620

1721
const states = 'AB,BC,MB,NB,NL,NT,NS,NU,ON,PE,QC,SK,YT';

assets/js/sections/wajamap.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@ let map;
55
let info;
66
let clickmarkers = [];
77

8-
let confirmedColor = user_map_custom.qsoconfirm.color;
9-
let workedColor = user_map_custom.qso.color;
10-
let unworkedColor = '';
8+
let unworkedColor = 'red';
119
if (typeof(user_map_custom.unworked) !== 'undefined') {
1210
unworkedColor = user_map_custom.unworked.color;
13-
} else {
14-
unworkedColor = 'red';
11+
}
12+
let workedColor = 'rgba(255, 0, 0)';
13+
if (typeof(user_map_custom.qso) !== 'undefined') {
14+
workedColor = user_map_custom.qso.color;
15+
}
16+
let confirmedColor = 'rgba(144,238,144)';
17+
if (typeof(user_map_custom.qsoconfirm) !== 'undefined') {
18+
confirmedColor = user_map_custom.qsoconfirm.color;
1519
}
1620

1721
const states = '01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47';

assets/js/sections/wapmap.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@ var map;
55
var info;
66
var clickmarkers = [];
77

8-
let confirmedColor = user_map_custom.qsoconfirm.color;
9-
let workedColor = user_map_custom.qso.color;
10-
let unworkedColor = '';
8+
let unworkedColor = 'red';
119
if (typeof(user_map_custom.unworked) !== 'undefined') {
1210
unworkedColor = user_map_custom.unworked.color;
13-
} else {
14-
unworkedColor = 'red';
11+
}
12+
let workedColor = 'rgba(255, 0, 0)';
13+
if (typeof(user_map_custom.qso) !== 'undefined') {
14+
workedColor = user_map_custom.qso.color;
15+
}
16+
let confirmedColor = 'rgba(144,238,144)';
17+
if (typeof(user_map_custom.qsoconfirm) !== 'undefined') {
18+
confirmedColor = user_map_custom.qsoconfirm.color;
1519
}
1620

1721
const states = 'DR,FL,FR,GD,GR,LB,NB,NH,OV,UT,ZH,ZL';

assets/js/sections/wasmap.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@ let map;
55
let info;
66
let clickmarkers = [];
77

8-
let confirmedColor = user_map_custom.qsoconfirm.color;
9-
let workedColor = user_map_custom.qso.color;
10-
let unworkedColor = '';
8+
let unworkedColor = 'red';
119
if (typeof(user_map_custom.unworked) !== 'undefined') {
1210
unworkedColor = user_map_custom.unworked.color;
13-
} else {
14-
unworkedColor = 'red';
11+
}
12+
let workedColor = 'rgba(255, 0, 0)';
13+
if (typeof(user_map_custom.qso) !== 'undefined') {
14+
workedColor = user_map_custom.qso.color;
15+
}
16+
let confirmedColor = 'rgba(144,238,144)';
17+
if (typeof(user_map_custom.qsoconfirm) !== 'undefined') {
18+
confirmedColor = user_map_custom.qsoconfirm.color;
1519
}
1620

1721
const states = 'AK,AL,AR,AZ,CA,CO,CT,DE,FL,GA,HI,IA,ID,IL,IN,KS,KY,LA,MA,MD,ME,MI,MN,MO,MS,MT,NC,ND,NE,NH,NJ,NM,NV,NY,OH,OK,OR,PA,RI,SC,SD,TN,TX,UT,VA,VT,WA,WI,WV,WY';

0 commit comments

Comments
 (0)