Skip to content

Commit

Permalink
Tag Cloudlog as 2.4.10
Browse files Browse the repository at this point in the history
  • Loading branch information
magicbug committed Oct 3, 2023
2 parents a1673d2 + e7a6eb6 commit 7177162
Show file tree
Hide file tree
Showing 45 changed files with 1,130 additions and 93 deletions.
2 changes: 1 addition & 1 deletion application/config/migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
|
*/

$config['migration_version'] = 143;
$config['migration_version'] = 144;

/*
|--------------------------------------------------------------------------
Expand Down
191 changes: 191 additions & 0 deletions application/controllers/Activated_gridmap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Activated_gridmap extends CI_Controller {

function __construct() {
parent::__construct();
}

public function index() {
$data['page_title'] = "Activated Gridsquare Map";

$this->load->model('bands');
$this->load->model('activated_gridmap_model');
$this->load->model('stations');

$data['homegrid'] = explode(',', $this->stations->find_gridsquare());

$data['modes'] = $this->activated_gridmap_model->get_worked_modes();
$data['bands'] = $this->bands->get_worked_bands();
$data['sats_available'] = $this->bands->get_worked_sats();

$data['user_gridmap_default_band'] = $this->session->userdata('user_gridmap_default_band');
$data['user_gridmap_confirmation'] = $this->session->userdata('user_gridmap_confirmation');

$data['layer'] = $this->optionslib->get_option('option_map_tile_server');

$data['attribution'] = $this->optionslib->get_option('option_map_tile_server_copyright');

$data['gridsquares_gridsquares'] = lang('gridsquares_gridsquares');
$data['gridsquares_gridsquares_confirmed'] = lang('gridsquares_gridsquares_confirmed');
$data['gridsquares_gridsquares_not_confirmed'] = lang('gridsquares_gridsquares_not_confirmed');
$data['gridsquares_gridsquares_total_activated'] = lang('gridsquares_gridsquares_total_activated');

$footerData = [];
$footerData['scripts'] = [
'assets/js/leaflet/geocoding.js',
'assets/js/leaflet/L.MaidenheadColouredGridMap.js',
'assets/js/sections/gridmap.js?'
];

$this->load->view('interface_assets/header', $data);
$this->load->view('activated_gridmap/index');
$this->load->view('interface_assets/footer', $footerData);
}

public function getGridsjs() {
$band = $this->security->xss_clean($this->input->post('band'));
$mode = $this->security->xss_clean($this->input->post('mode'));
$qsl = $this->security->xss_clean($this->input->post('qsl'));
$lotw = $this->security->xss_clean($this->input->post('lotw'));
$eqsl = $this->security->xss_clean($this->input->post('eqsl'));
$sat = $this->security->xss_clean($this->input->post('sat'));
$this->load->model('activated_gridmap_model');

$array_grid_2char = array();
$array_grid_4char = array();
$array_grid_6char = array();

$array_grid_2char_confirmed = array();
$array_grid_4char_confirmed = array();
$array_grid_6char_confirmed = array();

$grid_2char = "";
$grid_4char = "";
$grid_6char = "";

$grid_2char_confirmed = "";
$grid_4char_confirmed = "";
$grid_6char_confirmed = "";

$query = $this->activated_gridmap_model->get_band_confirmed($band, $mode, $qsl, $lotw, $eqsl, $sat);

if ($query && $query->num_rows() > 0) {
foreach ($query->result() as $row) {
$gridlist = explode(',', $row->GRID_SQUARES);
foreach ($gridlist as $grid) {
$grid_2char_confirmed = strtoupper(substr($grid,0,2));
$grid_4char_confirmed = strtoupper(substr($grid,0,4));
if ($this->config->item('map_6digit_grids')) {
$grid_6char_confirmed = strtoupper(substr($grid,0,6));
}

// Check if 2 Char is in array
if(!in_array($grid_2char_confirmed, $array_grid_2char_confirmed)){
array_push($array_grid_2char_confirmed, $grid_2char_confirmed);
}

if(!in_array($grid_4char_confirmed, $array_grid_4char_confirmed)){
array_push($array_grid_4char_confirmed, $grid_4char_confirmed);
}

if ($this->config->item('map_6digit_grids')) {
if(!in_array($grid_6char_confirmed, $array_grid_6char_confirmed)){
array_push($array_grid_6char_confirmed, $grid_6char_confirmed);
}
}
}
}
}

$query = $this->activated_gridmap_model->get_band($band, $mode, $qsl, $lotw, $eqsl, $sat);

if ($query && $query->num_rows() > 0) {
foreach ($query->result() as $row) {

$gridlist = explode(',', $row->GRID_SQUARES);
foreach ($gridlist as $grid) {
$grid_two = strtoupper(substr($grid,0,2));
$grid_four = strtoupper(substr($grid,0,4));
if ($this->config->item('map_6digit_grids')) {
$grid_six = strtoupper(substr($grid,0,6));
}

// Check if 2 Char is in array
if(!in_array($grid_two, $array_grid_2char)){
array_push($array_grid_2char, $grid_two);
}

if(!in_array($grid_four, $array_grid_4char)){
array_push($array_grid_4char, $grid_four);
}

if ($this->config->item('map_6digit_grids')) {
if(!in_array($grid_six, $array_grid_6char)){
array_push($array_grid_6char, $grid_six);
}
}
}
}
}
$query_vucc = $this->activated_gridmap_model->get_band_worked_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $sat);

if ($query_vucc && $query_vucc->num_rows() > 0) {
foreach ($query_vucc->result() as $row) {

$grids = explode(",", $row->COL_VUCC_GRIDS);

foreach($grids as $key) {
$grid_two = strtoupper(substr($key,0,2));
$grid_four = strtoupper(substr($key,0,4));

// Check if 2 Char is in array
if(!in_array($grid_two, $array_grid_2char)){
array_push($array_grid_2char, $grid_two);
}


if(!in_array($grid_four, $array_grid_4char)){
array_push($array_grid_4char, $grid_four);
}
}
}
}

// // Confirmed Squares
$query_vucc = $this->activated_gridmap_model->get_band_confirmed_vucc_squares($band, $mode, $qsl, $lotw, $eqsl, $sat);

if ($query_vucc && $query_vucc->num_rows() > 0) {
foreach ($query_vucc->result() as $row) {

$grids = explode(",", $row->COL_VUCC_GRIDS);

foreach($grids as $key) {
$grid_2char_confirmed = strtoupper(substr($key,0,2));
$grid_4char_confirmed = strtoupper(substr($key,0,4));

// Check if 2 Char is in array
if(!in_array($grid_2char_confirmed, $array_grid_2char_confirmed)){
array_push($array_grid_2char_confirmed, $grid_2char_confirmed);
}


if(!in_array($grid_4char_confirmed, $array_grid_4char_confirmed)){
array_push($array_grid_4char_confirmed, $grid_4char_confirmed);
}
}
}
}

$data['grid_2char_confirmed'] = ($array_grid_2char_confirmed);
$data['grid_4char_confirmed'] = ($array_grid_4char_confirmed);
$data['grid_6char_confirmed'] = ($array_grid_6char_confirmed);

$data['grid_2char'] = ($array_grid_2char);
$data['grid_4char'] = ($array_grid_4char);
$data['grid_6char'] = ($array_grid_6char);

header('Content-Type: application/json');
echo json_encode($data);
}
}
2 changes: 1 addition & 1 deletion application/controllers/Adif.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public function import() {
break;
};

$one_error = $this->logbook_model->import($record, $this->input->post('station_profile'), $this->input->post('skipDuplicate'), $this->input->post('markClublog'),$this->input->post('markLotw'), $this->input->post('dxccAdif'), $this->input->post('markQrz'), $this->input->post('markHrd'), true, $this->input->post('operatorName'));
$one_error = $this->logbook_model->import($record, $this->input->post('station_profile'), $this->input->post('skipDuplicate'), $this->input->post('markClublog'),$this->input->post('markLotw'), $this->input->post('dxccAdif'), $this->input->post('markQrz'), $this->input->post('markHrd'), true, $this->input->post('operatorName'), false, $this->input->post('skipStationCheck'));
if ($one_error != '') {
$custom_errors.=$one_error."<br/>";
}
Expand Down
13 changes: 11 additions & 2 deletions application/controllers/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ function qso() {

$this->load->model('stations');

$return_msg = array();
$return_count = 0;

// Decode JSON and store
$obj = json_decode(file_get_contents("php://input"), true);
if ($obj === NULL) {
Expand Down Expand Up @@ -213,12 +216,18 @@ function qso() {

$this->api_model->update_last_used($obj['key']);

$this->logbook_model->import($record, $obj['station_profile_id'], NULL, NULL, NULL, NULL, NULL, NULL, false, false, true);
$msg = $this->logbook_model->import($record, $obj['station_profile_id'], NULL, NULL, NULL, NULL, NULL, NULL, false, false, true);

if ( $msg == "" ) {
$return_count++;
} else {
$return_msg[] = $msg;
}
}

};
http_response_code(201);
echo json_encode(['status' => 'created', 'type' => $obj['type'], 'string' => $obj['string']]);
echo json_encode(['status' => 'created', 'type' => $obj['type'], 'string' => $obj['string'], 'imported_count' => $return_count, 'messages' => $return_msg ]);

}

Expand Down
3 changes: 2 additions & 1 deletion application/controllers/Awards.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ public function qso_details_ajax(){
$mode = str_replace('"', "", $this->security->xss_clean($this->input->post("Mode")));
$type = $this->security->xss_clean($this->input->post('Type'));
$qsl = $this->input->post('QSL') == null ? '' : $this->security->xss_clean($this->input->post('QSL'));
$data['results'] = $this->logbook_model->qso_details($searchphrase, $band, $mode, $type, $qsl);
$searchmode = $this->input->post('searchmode') == null ? '' : $this->security->xss_clean($this->input->post('searchmode'));
$data['results'] = $this->logbook_model->qso_details($searchphrase, $band, $mode, $type, $qsl, $searchmode);

// This is done because we have two different ways to get dxcc info in Cloudlog. Once is using the name (in awards), and the other one is using the ADIF DXCC.
// We replace the values to make it look a bit nicer
Expand Down
5 changes: 3 additions & 2 deletions application/controllers/Eqsl.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,15 @@ public function import() {
redirect('eqsl/import');
}

$eqsl_force_from_date = (!$this->input->post('eqsl_force_from_date')=="")?$this->input->post('eqsl_force_from_date'):"";
foreach ($eqsl_locations->result_array() as $eqsl_location) {
$this->eqslimporter->from_callsign_and_QTH(
$eqsl_location['station_callsign'],
$eqsl_location['eqslqthnickname'],
$config['upload_path']
);

$eqsl_results[] = $this->eqslimporter->fetch($eqsl_password);
$eqsl_results[] = $this->eqslimporter->fetch($eqsl_password,$eqsl_force_from_date);
}
} elseif ($this->input->post('eqslimport') == 'upload') {
$station_id4upload=$this->input->post('station_profile');
Expand Down Expand Up @@ -755,7 +756,7 @@ function folderSize($dir){
foreach($dir_array as $key=>$filename){
if($filename!=".." && $filename!="."){
if(is_dir($dir."/".$filename)){
$new_foldersize = foldersize($dir."/".$filename);
$new_foldersize = $this->foldersize($dir."/".$filename);
$count_size = $count_size+ $new_foldersize;
}else if(is_file($dir."/".$filename)){
$count_size = $count_size + filesize($dir."/".$filename);
Expand Down
9 changes: 5 additions & 4 deletions application/controllers/Logbook.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ function json($tempcallsign, $temptype, $tempband, $tempmode, $tempstation_id =

// Convert - in Callsign to / Used for URL processing
$callsign = str_replace("-","/",$callsign);
$callsign = str_replace("Ø","0",$callsign);

// Check if callsign is an LoTW User
// Check Database for all other data
Expand Down Expand Up @@ -204,7 +205,7 @@ function confirmed_grid_before($gridsquare, $type, $band, $mode) {
}
if (isset($user_gridmap_confirmation) && strpos($user_gridmap_confirmation, 'E') !== false) {
if ($extrawhere!='') {
$extrawherei.=" OR";
$extrawhere.=" OR";
}
$extrawhere.=" COL_EQSL_QSL_RCVD='Y'";
}
Expand Down Expand Up @@ -329,7 +330,7 @@ function jsonlookupgrid($gridsquare, $type, $band, $mode) {
}
if (isset($user_gridmap_confirmation) && strpos($user_gridmap_confirmation, 'E') !== false) {
if ($extrawhere!='') {
$extrawherei.=" OR";
$extrawhere.=" OR";
}
$extrawhere.=" COL_EQSL_QSL_RCVD='Y'";
}
Expand Down Expand Up @@ -411,7 +412,7 @@ function jsonlookupdxcc($country, $type, $band, $mode) {
}
if (isset($user_gridmap_confirmation) && strpos($user_gridmap_confirmation, 'E') !== false) {
if ($extrawhere!='') {
$extrawherei.=" OR";
$extrawhere.=" OR";
}
$extrawhere.=" COL_EQSL_QSL_RCVD='Y'";
}
Expand Down Expand Up @@ -506,7 +507,7 @@ function jsonlookupcallsign($callsign, $type, $band, $mode) {
}
if (isset($user_gridmap_confirmation) && strpos($user_gridmap_confirmation, 'E') !== false) {
if ($extrawhere!='') {
$extrawherei.=" OR";
$extrawhere.=" OR";
}
$extrawhere.=" COL_EQSL_QSL_RCVD='Y'";
}
Expand Down
6 changes: 3 additions & 3 deletions application/controllers/Lookup.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function scp() {
{
if (in_array($row->COL_CALL, $arCalls) == false)
{
$arCalls[] = $row->COL_CALL;
$arCalls[] = str_replace('0', 'Ø', $row->COL_CALL);
}
}

Expand All @@ -83,7 +83,7 @@ public function scp() {
foreach ($result as &$value) {
if (in_array($value, $arCalls) == false)
{
$arCalls[] = $value;
$arCalls[] = str_replace('0', 'Ø', $value);
}
}
}
Expand All @@ -97,7 +97,7 @@ public function scp() {
foreach ($result as &$value) {
if (in_array($value, $arCalls) == false)
{
$arCalls[] = $value;
$arCalls[] = str_replace('0', 'Ø', $value);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function appearance_save() {
$dashboard_map_update_status = $this->optionslib->update('dashboard_map', $this->input->post('dashboardMap'), 'yes');

// If dashboard map update is complete set a flashsession with a success note
if($ldashboard_map_update_status == TRUE) {
if($dashboard_map_update_status == TRUE) {
$this->session->set_flashdata('success', $this->lang->line('options_dashboard_map_changed_to').$this->input->post('dashboardMap'));
}

Expand Down
26 changes: 26 additions & 0 deletions application/controllers/Sattimers.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Sattimers extends CI_Controller {

function __construct() {
parent::__construct();

$this->load->model('user_model');
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
}

public function index() {
$footerData = [];
$footerData['scripts'] = [
'assets/js/sections/sattimers.js?'
];
$url = 'https://www.df2et.de/tevel/api.php';
$json = file_get_contents($url);
$data['activations'] = json_decode($json, true)['data'];

$data['page_title'] = "Satellite Timers";
$this->load->view('interface_assets/header', $data);
$this->load->view('/sattimers/index', $data);
$this->load->view('interface_assets/footer', $footerData);
}
}
3 changes: 3 additions & 0 deletions application/controllers/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,12 +306,15 @@ function buildWhere(array $object, string $condition = null): void
function fetchQueryResult($json, $returnquery) {
$search_items = json_decode($json, true);

$this->db->select($this->config->item('table_name').'.*, station_profile.*, dxcc_entities.name as station_country');

$this->db->group_start();
$this->buildWhere($search_items);
$this->db->group_end();

$this->db->order_by('COL_TIME_ON', 'DESC');
$this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id');
$this->db->join('dxcc_entities', $this->config->item('table_name').'.col_dxcc = dxcc_entities.adif', 'left');
$this->db->where('station_profile.user_id', $this->session->userdata('user_id'));

if ($returnquery) {
Expand Down
Loading

0 comments on commit 7177162

Please sign in to comment.