Fixed badgesetting on DXCC.
这个提交包含在:
父节点
4877ac7564
当前提交
f1fa575178
共有 2 个文件被更改,包括 48 次插入 和 44 次删除
|
|
@ -58,6 +58,7 @@ class Logbook extends CI_Controller {
|
||||||
if(!$this->user_model->authorize($this->config->item('auth_mode'))) { return; }
|
if(!$this->user_model->authorize($this->config->item('auth_mode'))) { return; }
|
||||||
|
|
||||||
$return['dxcc'] = $this->getentity($adif);
|
$return['dxcc'] = $this->getentity($adif);
|
||||||
|
header('Content-Type: application/json');
|
||||||
echo json_encode($return, JSON_PRETTY_PRINT);
|
echo json_encode($return, JSON_PRETTY_PRINT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -426,6 +426,8 @@ $(document).on('keypress',function(e) {
|
||||||
$('#callsign_info').attr('title', '');
|
$('#callsign_info').attr('title', '');
|
||||||
$('#callsign_info').text(convert_case(result.dxcc.name));
|
$('#callsign_info').text(convert_case(result.dxcc.name));
|
||||||
|
|
||||||
|
changebadge(result.dxcc.name);
|
||||||
|
|
||||||
// Set Map to Lat/Long it locator is not empty
|
// Set Map to Lat/Long it locator is not empty
|
||||||
if($('#locator').val() == "") {
|
if($('#locator').val() == "") {
|
||||||
markers.clearLayers();
|
markers.clearLayers();
|
||||||
|
|
@ -437,6 +439,50 @@ $(document).on('keypress',function(e) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function changebadge(entityname) {
|
||||||
|
if($("#sat_name" ).val() != "") {
|
||||||
|
$.getJSON('logbook/jsonlookupdxcc/' + convert_case(entityname) + '/SAT/0/0', function(result)
|
||||||
|
{
|
||||||
|
|
||||||
|
$('#callsign_info').removeClass("badge-secondary");
|
||||||
|
$('#callsign_info').removeClass("badge-success");
|
||||||
|
$('#callsign_info').removeClass("badge-danger");
|
||||||
|
$('#callsign_info').attr('title', '');
|
||||||
|
|
||||||
|
if (result.workedBefore)
|
||||||
|
{
|
||||||
|
$('#callsign_info').addClass("badge-success");
|
||||||
|
$('#callsign_info').attr('title', 'DXCC was already worked in the past on this band and mode!');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$('#callsign_info').addClass("badge-danger");
|
||||||
|
$('#callsign_info').attr('title', 'New DXCC, not worked on this band and mode!');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
$.getJSON('logbook/jsonlookupdxcc/' + convert_case(entityname) + '/0/' + $("#band").val() +'/' + $("#mode").val(), function(result)
|
||||||
|
{
|
||||||
|
// Reset CSS values before updating
|
||||||
|
$('#callsign_info').removeClass("badge-secondary");
|
||||||
|
$('#callsign_info').removeClass("badge-success");
|
||||||
|
$('#callsign_info').removeClass("badge-danger");
|
||||||
|
$('#callsign_info').attr('title', '');
|
||||||
|
|
||||||
|
if (result.workedBefore)
|
||||||
|
{
|
||||||
|
$('#callsign_info').addClass("badge-success");
|
||||||
|
$('#callsign_info').attr('title', 'DXCC was already worked in the past on this band and mode!');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$('#callsign_info').addClass("badge-danger");
|
||||||
|
$('#callsign_info').attr('title', 'New DXCC, not worked on this band and mode!');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$("#callsign").focusout(function() {
|
$("#callsign").focusout(function() {
|
||||||
|
|
||||||
if ($(this).val().length >= 3) {
|
if ($(this).val().length >= 3) {
|
||||||
|
|
@ -502,50 +548,7 @@ $(document).on('keypress',function(e) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
changebadge(result.dxcc.entity);
|
||||||
|
|
||||||
if($("#sat_name" ).val() != "") {
|
|
||||||
//logbook/jsonlookupgrid/io77/SAT/0/0
|
|
||||||
$.getJSON('logbook/jsonlookupdxcc/' + convert_case(result.dxcc.entity) + '/SAT/0/0', function(result)
|
|
||||||
{
|
|
||||||
|
|
||||||
$('#callsign_info').removeClass("badge-secondary");
|
|
||||||
$('#callsign_info').removeClass("badge-success");
|
|
||||||
$('#callsign_info').removeClass("badge-danger");
|
|
||||||
$('#callsign_info').attr('title', '');
|
|
||||||
|
|
||||||
if (result.workedBefore)
|
|
||||||
{
|
|
||||||
$('#callsign_info').addClass("badge-success");
|
|
||||||
$('#callsign_info').attr('title', 'DXCC was already worked in the past on this band and mode!');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$('#callsign_info').addClass("badge-danger");
|
|
||||||
$('#callsign_info').attr('title', 'New DXCC, not worked on this band and mode!');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
$.getJSON('logbook/jsonlookupdxcc/' + convert_case(result.dxcc.entity) + '/0/' + $("#band").val() +'/' + $("#mode").val(), function(result)
|
|
||||||
{
|
|
||||||
// Reset CSS values before updating
|
|
||||||
$('#callsign_info').removeClass("badge-secondary");
|
|
||||||
$('#callsign_info').removeClass("badge-success");
|
|
||||||
$('#callsign_info').removeClass("badge-danger");
|
|
||||||
$('#callsign_info').attr('title', '');
|
|
||||||
|
|
||||||
if (result.workedBefore)
|
|
||||||
{
|
|
||||||
$('#callsign_info').addClass("badge-success");
|
|
||||||
$('#callsign_info').attr('title', 'DXCC was already worked in the past on this band and mode!');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$('#callsign_info').addClass("badge-danger");
|
|
||||||
$('#callsign_info').attr('title', 'New DXCC, not worked on this band and mode!');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(result.lotw_member == "active") {
|
if(result.lotw_member == "active") {
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用