Merge pull request #2490 from magicbug/dev

Dev
这个提交包含在:
Peter Goodhall 2023-09-14 20:57:52 +01:00 提交者 GitHub
当前提交 a1673d23d6
找不到此签名对应的密钥
GPG 密钥 ID: 4AEE18F83AFDEB23
共有 5 个文件被更改,包括 79 次插入11 次删除

查看文件

@ -63,6 +63,7 @@ class Dxcluster_model extends CI_Model {
if ( ($de != '') && ($de != 'Any') && (property_exists($singlespot->dxcc_spotter,'cont')) ){ // If we have a "de continent" and a filter-wish filter on that
if (strtolower($de) == strtolower($singlespot->dxcc_spotter->cont ?? '')) {
$singlespot->worked_call = ($this->logbook_model->check_if_callsign_worked_in_logbook($singlespot->spotted, $logbooks_locations_array, $singlespot->band) >= 1);
$singlespot->cnfmd_call = ($this->logbook_model->check_if_callsign_cnfmd_in_logbook($singlespot->spotted, $logbooks_locations_array, $singlespot->band) >= 1);
array_push($spotsout,$singlespot);
}
} else { // No de continent? No Filter --> Just push

查看文件

@ -1676,6 +1676,57 @@ class Logbook_model extends CI_Model {
}
function check_if_callsign_cnfmd_in_logbook($callsign, $StationLocationsArray = null, $band = null) {
$user_gridmap_confirmation = $this->session->userdata('user_gridmap_confirmation');
if($StationLocationsArray == null) {
$CI =& get_instance();
$CI->load->model('logbooks_model');
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
} else {
$logbooks_locations_array = $StationLocationsArray;
}
$extrawhere='';
if (isset($user_gridmap_confirmation) && strpos($user_gridmap_confirmation, 'Q') !== false) {
$extrawhere="COL_QSL_RCVD='Y'";
}
if (isset($user_gridmap_confirmation) && strpos($user_gridmap_confirmation, 'L') !== false) {
if ($extrawhere!='') {
$extrawhere.=" OR";
}
$extrawhere.=" COL_LOTW_QSL_RCVD='Y'";
}
if (isset($user_gridmap_confirmation) && strpos($user_gridmap_confirmation, 'E') !== false) {
if ($extrawhere!='') {
$extrawherei.=" OR";
}
$extrawhere.=" COL_EQSL_QSL_RCVD='Y'";
}
$this->db->select('COL_CALL');
$this->db->where_in('station_id', $logbooks_locations_array);
$this->db->where('COL_CALL', $callsign);
if($band != null && $band != 'SAT') {
$this->db->where('COL_BAND', $band);
} else if($band == 'SAT') {
// Where col_sat_name is not empty
$this->db->where('COL_SAT_NAME !=', '');
}
if ($extrawhere != '') {
$this->db->where('('.$extrawhere.')');
} else {
$this->db->where("1=0");
}
$this->db->limit('2');
$query = $this->db->get($this->config->item('table_name'));
return $query->num_rows();
}
function check_if_callsign_worked_in_logbook($callsign, $StationLocationsArray = null, $band = null) {
if($StationLocationsArray == null) {
@ -2828,10 +2879,6 @@ class Logbook_model extends CI_Model {
$record['station_callsign']=$station_profile_call;
}
if (($station_id != 0) && ($record['station_callsign'] != $station_profile_call)) { // Check if station_call from import matches profile ONLY when submitting via GUI.
return "Wrong station_callsign ".$record['station_callsign']." while importing QSO with ".$record['call']." for ".$station_profile_call." : SKIPPED";
}
$CI =& get_instance();
$CI->load->library('frequency');
$my_error = "";

查看文件

@ -35,7 +35,22 @@
- <?php echo $rove['start_time']; ?> - <?php echo $rove['end_time']; ?>
</td>
<td><span data-toggle="tooltip" title="<?php echo $rove['comment']; ?>"><?php echo $rove['callsign']; ?></span></td>
<td>
<?php
$CI = &get_instance();
$CI->load->model('logbooks_model');
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
$CI->load->model('logbook_model');
$call_worked = $CI->logbook_model->check_if_callsign_worked_in_logbook($rove['callsign'], $logbooks_locations_array, "SAT");
echo " <span data-toggle=\"tooltip\" title=\"".$rove['comment']."\">";
if ($call_worked != 0) {
echo "<span class=\"text-success\">".$rove['callsign']."</span>";
} else {
echo $rove['callsign'];
}
echo "</span></td>";
?>
</td>
<td><span data-toggle="tooltip" title="<?php echo $rove['frequency']; ?> - <?php echo $rove['mode']; ?>"><?= $rove['satellite'] ?></span></td>
<td>
@ -43,8 +58,6 @@
<?php
// Load the logbook model and call check_if_grid_worked_in_logbook
$CI = &get_instance();
$CI->load->model('logbook_model');
$worked = $CI->logbook_model->check_if_grid_worked_in_logbook($rove['gridsquare'], null, "SAT");
if ($worked != 0) {
echo " <span data-toggle=\"tooltip\" title=\"Worked\" class=\"badge badge-success\">" . $rove['gridsquare'] . "</span>";

查看文件

@ -45,10 +45,17 @@ $(function() {
dxspots.sort(SortByQrg);
dxspots.forEach((single) => {
var data=[];
if (single.cnfmd_call) {
addon_class="text-success";
} else if (single.worked_call) {
addon_class="text-warning";
} else {
addon_class="";
}
data[0]=[];
data[0].push(single.when_pretty);
data[0].push(single.frequency*1);
data[0].push((single.worked_call ?'<span class="text-success">' : '')+single.spotted+(single.worked_call ? '</span>' : ''));
data[0].push((addon_class != '' ?'<span class="'+addon_class+'">' : '')+single.spotted+(addon_class != '' ? '</span>' : ''));
data[0].push(single.dxcc_spotted.entity);
data[0].push(single.spotter);
if (oldtable.length > 0) {