Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ajax/trigger_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
refreshUser();

// Validate
$arrayConditions = ['summitRef', 'callsign', 'fullCallsign', 'notCallsign', 'notFullCallsign', 'prefix', 'notPrefix', 'spotter', 'notSpotter', 'spotterPrefix', 'mode', 'band', 'source', 'dxcc', 'callsignDxcc', 'spotterDxcc', 'cq', 'spotterCq', 'continent', 'spotterContinent', 'qsl', 'state', 'spotterState', 'summitAssociation', 'summitRegion', 'iotaGroupRef', 'wwffDivision', 'wwffRef', 'bandslot'];
$arrayConditions = ['summitRef', 'callsign', 'fullCallsign', 'notCallsign', 'notFullCallsign', 'prefix', 'notPrefix', 'spotter', 'notSpotter', 'spotterPrefix', 'mode', 'band', 'source', 'dxcc', 'callsignDxcc', 'spotterDxcc', 'cq', 'spotterCq', 'continent', 'spotterContinent', 'qsl', 'state', 'spotterState', 'summitAssociation', 'summitRegion', 'iotaGroupRef', 'wwffDivision', 'wwffRef', 'wwbotaScheme', 'bandslot'];
$arrayMaxEntries = 5000;
$errors = [];
if (!is_array($trigger['conditions']))
Expand Down
5 changes: 5 additions & 0 deletions db.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,11 @@ function getWwffParksForDivision($division) {
return $db->wwffParks->find(['division' => $division, 'status' => 'active'], ['sort' => ['reference' => 1]])->toArray();
}

function getAllWwbotaSchemes() {
global $db;
return $db->wwffSchemes->find([], ['sort' => ['scheme' => 1]])->toArray();
}

function getAllIotaGroups() {
global $db;
return $db->iotaGroups->find([], ['sort' => ['grpRef' => 1]])->toArray();
Expand Down
7 changes: 6 additions & 1 deletion destinations.php
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ function removeDevice(el) {
</tr>
<tr>
<td><tt>source</tt></td>
<td>Spot source: 'rbn', 'sotawatch', 'cluster', 'pskreporter', 'pota' or 'wwff'</td>
<td>Spot source: 'rbn', 'sotawatch', 'cluster', 'pskreporter', 'pota', 'wwff' or 'wwbota'</td>
<td><strong>rbn</strong></td>
</tr>
<tr>
Expand Down Expand Up @@ -546,6 +546,11 @@ function removeDevice(el) {
<td>Park reference *</td>
<td><strong>EAFF-0065</strong></td>
</tr>
<tr>
<td><tt>wwbotaScheme</tt></td>
<td>WWBOTA scheme *</td>
<td><strong>UKBOTA</strong></td>
</tr>
</tbody>
</table>

Expand Down
37 changes: 37 additions & 0 deletions js/trigger_editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ var currentTrigger;
var dxccs, dxccKeyValueList;
var associations, associationsKeyValueList;
var wwffDivisions, wwffDivisionsKeyValueList;
var wwbotaSchemes, wwbotaSchemesKeyValueList;
var iotaGroups, iotaGroupsKeyValueList;
var hasChanges;

Expand Down Expand Up @@ -162,6 +163,13 @@ var editorFunctions = {
'wwffRefs': function(conditionName) {
return conditionTextArea(conditionName)
},
'wwbotaScheme': function(conditionName) {
return conditionValuePickerAsync(conditionName, function(callback) {
fetchWwbotaSchemes(function(wwbotaSchemes, wwbotaSchemesKeyValueList) {
callback(wwbotaSchemesKeyValueList);
})
});
},
'iotaGroupRef': function(conditionName) {
return conditionValuePickerAsync(conditionName, function(callback) {
fetchIotaGroups(function(iotaGroups, iotaGroupsKeyValueList) {
Expand Down Expand Up @@ -266,6 +274,25 @@ function fetchWwffDivisions(callback) {
});
}

function fetchWwbotaSchemes(callback) {
if (wwbotaSchemes) {
callback(wwbotaSchemes, wwbotaSchemesKeyValueList);
return;
}

$.get({
url: 'ajax/wwbota_schemes',
success: function(newWwbotaSchemes) {
wwbotaSchemes = {};
newWwbotaSchemes.forEach(function(scheme) {
wwbotaSchemes[scheme.scheme] = scheme;
});
wwbotaSchemesKeyValueList = makeWwbotaSchemesKeyValueList(newWwbotaSchemes);
callback(wwbotaSchemes, wwbotaSchemesKeyValueList);
}
});
}

function fetchIotaGroups(callback) {
if (iotaGroups) {
callback(iotaGroups, iotaGroupsKeyValueList);
Expand Down Expand Up @@ -904,6 +931,16 @@ function makeWwffDivisionsKeyValueList(wwffDivisions) {
return kvl;
}

// Returns an array of key/value pairs
function makeWwbotaSchemesKeyValueList(wwbotaSchemes) {
var kvl = wwbotaSchemes.map(function(value) {
return [value.scheme, value.scheme, undefined];
});
// add "any" entry
kvl.unshift(['*', '* (any)']);
return kvl;
}

function makeWwffParksKeyValueList(parks) {
return parks.map(function(value) {
// Limit park name length to avoid breaking popup
Expand Down
13 changes: 11 additions & 2 deletions js/triggers.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ var conditionLabels = {
'summitRefs': 'Summit reference list',
'wwffDivision': 'Park division',
'wwffRef': 'Park reference',
'wwffRefs': 'Park reference list'
'wwffRefs': 'Park reference list',
'wwbotaScheme': 'WWBOTA scheme',
};

var conditionsOrder = [
Expand All @@ -48,6 +49,7 @@ var conditionsOrder = [
'iotaGroupRef',
'summitAssociation', 'summitRegion', 'summitRef', 'summitRefs', 'summitPointsFrom', 'summitActivationsFrom',
'wwffDivision', 'wwffRef', 'wwffRefs',
'wwffScheme',
'notCallsign', 'notFullCallsign', 'notSpotter', 'notPrefix'
];

Expand All @@ -61,6 +63,7 @@ var conditionsGroups = [
{title: 'IOTA', conditions: ['iotaGroupRef']},
{title: 'SOTA', conditions: ['summitAssociation', 'summitRegion', 'summitRef', 'summitRefs', 'summitPointsFrom', 'summitActivationsFrom']},
{title: 'WWFF/POTA', conditions: ['wwffDivision', 'wwffRef', 'wwffRefs']},
{title: 'WWBOTA', conditions: ['wwffScheme']},
{title: 'Callsign exclusions', conditions: ['notCallsign', 'notFullCallsign', 'notSpotter', 'notPrefix']}
];

Expand Down Expand Up @@ -237,6 +240,11 @@ var arrayConditions = {
maxDisplaySmall: 2,
suffix: 'parks'
},
'wwbotaScheme': {
maxDisplay: 3,
maxDisplaySmall: 5,
suffix: 'schemes'
},
};

var sources = {
Expand All @@ -245,7 +253,8 @@ var sources = {
'cluster': 'Cluster',
'pskreporter': 'PSK Reporter',
'pota': 'POTA',
'wwff': 'WWFFwatch'
'wwff': 'WWFFwatch',
'wwbota': 'WWBOTA'
};

var modes = {
Expand Down
3 changes: 3 additions & 0 deletions myspot.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@
} else if (@$spot['wwffRef']) {
$addInfo = "WWFF: " . $spot['wwffRef'] . " " . $spot['wwffName'];
}
} else if (@$spot['wwbotaRef']) {
$addInfo = "WWBOTA: " . $spot['wwbotaRef'] . " " . $spot['wwbotaName'];
}
$spotInfo = "last spotted on " . $spot['receivedDate']->toDateTime()->format("Y-m-d H:i:s") . "Z\nby " . $spot['spotter'] . " via " . $config['sources'][$spot['source']];
if (preg_match("/^SIMULATED/", @$spot['rawText']))
$spotInfo .= " (simulated)";
Expand Down