diff --git a/application/config/migration.php b/application/config/migration.php index 6c26998f..70bc112e 100644 --- a/application/config/migration.php +++ b/application/config/migration.php @@ -22,7 +22,7 @@ $config['migration_enabled'] = TRUE; | */ -$config['migration_version'] = 136; +$config['migration_version'] = 137; /* |-------------------------------------------------------------------------- diff --git a/application/controllers/Api.php b/application/controllers/Api.php index 595f38dd..7a1e9634 100644 --- a/application/controllers/Api.php +++ b/application/controllers/Api.php @@ -151,262 +151,8 @@ class API extends CI_Controller { } } - // FUNCTION: search() - // Handle search requests - /* - Okay, so here's how it works in a nutshell... - ******************************************************************* - Because this is effectively just a filter between the query string - and a MySQL statement, if done wrong we're just asking for pain. - - DO NOT alter any of the filtering statements without fully - understanding what you're doing. CodeIgniter provides some - protection against unwanted characters in the query string, but - this should in no way be relied upon for safety. - ******************************************************************* - - Example query:- - .../search/query[Call~M0*(and)(Locator~I*(or)Locator~J*)]/limit[10]/fields[distinct(Call),Locator]/order[Call(asc)] - - There's four parts to this query, separated with forward slashes. It's effectively a heavily-sanitised - MySQL query, hence the hideous search and replace code blocks below. - - FIELDS - ------ - Straightforward - input is sanitised and passed on - in the example, this ends up as "DISTINCT (Call),Locator", - which is then the first argument to 'SELECT' - - QUERY - ----- - This forms the 'WHERE' clause. - - * '(and)' and '(or)' are expanded out to ' AND ' and ' OR ' - * Parentheses are preserved - * '~' is expanded out to ' LIKE ' - * '*' is translated to '%' - * Values are encapsulated in quote marks - - So in the example, this translates to "WHERE Call LIKE 'M0%' AND (Locator LIKE 'I%' OR Locator LIKE 'J%')" - - ORDER - ----- - Sanitised, so our example ends up as "ORDER BY Call ASC". - - LIMIT - ----- - Straightforward - what's between the square brackets is passed as an argument to 'LIMIT' - - Finally, once this has been done, each field name is translated to the MySQL column name. - */ - function search() - { - // Load the API and Logbook models - $this->load->model('api_model'); - $this->load->model('logbook_model'); - $this->load->model('user_model'); - - $arguments = $this->_retrieve(); - print_r($arguments); - return; - - if((!$this->user_model->authorize(3)) && ($this->api_model->authorize($arguments['key']) == 0)) { - $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); - } - - $this->api_model->update_last_used($obj['key']); - - // Retrieve the arguments from the query string - $data['data']['format'] = $arguments['format']; - - // Call the parser within the API model to build the query - $query = $this->api_model->select_parse($arguments); - - // Execute the query, and retrieve the results - $s = $this->logbook_model->api_search_query($query); - $a = 0; - - // Print query results using original column names and exit - if ($arguments['format'] == 'original'){ - $results = array(); - foreach($s['results']->result() as $row){ - //print_r($row); - array_push($results, $row); - } - - print json_encode($results); - return; - } - - if(isset($s['results'])) { - $results = $s['results']; - - // Cycle through the results, and translate between MySQL column names - // and more friendly, descriptive names - if($results->num_rows() != 0) - { - foreach ($results->result() as $row) { - $record = (array)$row; - $r[$a]['rid'] = $a; - while (list($key, $val) = each($record)) { - $r[$a][$this->api_model->name($key)] = $val; - } - $a++; - } - // Add the result record to the main results array - $data['data']['search_Result']['results'] = $r; - } - else - { - // We've got no results, so make this empty for completeness - $data['data']['search_Result']['results'] = ""; - } - } else { - $data['data']['error'] = $s['error']; - $data['data']['search_Result']['results'] = ""; - } - - // Add some debugging information to the XML output - $data['data']['queryInfo']['call'] = "search"; - $data['data']['queryInfo']['dbQuery'] = $s['query']; - $data['data']['queryInfo']['numResults'] = $a; - $data['data']['queryInfo']['executionTime'] = $s['time']; - - // Load the XML output view - $this->load->view('api/index', $data); - } - - /* - * version of search that is callable internally - * $arguments is an array of columns to query - */ - function api_search($arguments){ - // Load the API and Logbook models - $this->load->model('api_model'); - $this->load->model('logbook_model'); - $this->load->model('user_model'); - - if((!$this->user_model->authorize(3)) && ($this->api_model->authorize($arguments['key']) == 0)) { - $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); - } - - $this->api_model->update_last_used($obj['key']); - - // Retrieve the arguments from the query string - $data['data']['format'] = $arguments['format']; - - // Call the parser within the API model to build the query - $query = $this->api_model->select_parse($arguments); - - // Execute the query, and retrieve the results - $s = $this->logbook_model->api_search_query($query); - return $s; - } - - function validate() - { - // Load the API and Logbook models - $this->load->model('api_model'); - $this->load->model('logbook_model'); - - // Retrieve the arguments from the query string - $arguments = $this->_retrieve(); - - // Add some debugging information to the XML output - $data['data'] = $arguments; - $data['data']['queryInfo']['call'] = "validate"; - $data['data']['queryInfo']['dbQuery'] = ""; - $data['data']['queryInfo']['numResults'] = 1; - $data['data']['queryInfo']['executionTime'] = 0; - - $data['data']['validate_Result']['results'] = array(0 => array('Result' => $this->api_model->authorize($arguments['key']))); - - $this->load->view('api/index', $data); - } - - function add() - { - // Load the API and Logbook models - $this->load->model('api_model'); - $this->load->model('logbook_model'); - $this->load->model('user_model'); - if(!$this->user_model->authorize(3)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } - - // Retrieve the arguments from the query string - $arguments = $this->_retrieve(); - - // Call the parser within the API model to build the query - $query = $this->api_model->insert_parse($arguments); - - # Check for guessable fields - if(!isset($query['COL_TIME_ON'])) - { - $query['COL_TIME_ON'] = date("Y-m-d H:i:s", time()); - } - if(!isset($query['COL_TIME_OFF'])) - { - $query['COL_TIME_OFF'] = date("Y-m-d H:i:s", time()); - } - - $data['data']['queryInfo']['dbQuery'] = ""; - $data['data']['queryInfo']['executionTime'] = 0; - - if(!isset($query['COL_CALL'])) { - $data['data']['add_Result']['results'] = array(0 => array('Result' => 'EMISSINGCALL')); - } else { - $s = $this->logbook_model->api_insert_query($query); - $data['data']['queryInfo']['dbQuery'] = $s['query']; - $data['data']['queryInfo']['executionTime'] = $s['time']; - - $data['data']['add_Result']['results'] = array(0 => array('Result' => $s['result_string'])); - } - - // Add some debugging information to the XML output - $data['data']['queryInfo']['call'] = "add"; - $data['data']['queryInfo']['numResults'] = 0; - - $this->load->view('api/index', $data); - } - - // FUNCTION: _retrieve() - // Pull the search query arguments from the query string - private function _retrieve() - { - // This whole function could probably have been done in one line... if this was Perl. - $arguments = array(); - - // Retrieve each arguments - $query = preg_grep("/^query=(.*)$/", $this->uri->segments); - $limit = preg_grep("/^limit=(.*)$/", $this->uri->segments); - $order = preg_grep("/^order=(.*)$/", $this->uri->segments); - $fields = preg_grep("/^fields=(.*)$/", $this->uri->segments); - $format = preg_grep("/^format=(.*)$/", $this->uri->segments); - $key = preg_grep("/^key=(.*)$/", $this->uri->segments); - - // Strip each argument - $arguments['query'] = substr(array_pop($query), 6); - $arguments['query'] = substr($arguments['query'], 0, strlen($arguments['query'])); - $arguments['limit'] = substr(array_pop($limit), 6); - $arguments['limit'] = substr($arguments['limit'], 0, strlen($arguments['limit'])); - $arguments['order'] = substr(array_pop($order), 6); - $arguments['order'] = substr($arguments['order'], 0, strlen($arguments['order'])); - $arguments['fields'] = substr(array_pop($fields), 7); - $arguments['fields'] = substr($arguments['fields'], 0, strlen($arguments['fields'])); - $arguments['format'] = substr(array_pop($format), 7); - $arguments['format'] = substr($arguments['format'], 0, strlen($arguments['format'])); - $arguments['key'] = substr(array_pop($key), 4); - $arguments['key'] = substr($arguments['key'], 0, strlen($arguments['key'])); - - // By default, assume XML for the format if not otherwise set - if($arguments['format'] == "") { - $arguments['format'] = "xml"; - } - - // Return the arguments - return $arguments; - } - - /* + /* * * Function: QSO * Task: allows passing of ADIF data to Cloudlog @@ -482,11 +228,19 @@ class API extends CI_Controller { $obj = json_decode(file_get_contents("php://input"), true); if ($obj === NULL) { echo json_encode(['status' => 'failed', 'reason' => "wrong JSON"]); + return; } if(!isset($obj['key']) || $this->api_model->authorize($obj['key']) == 0) { http_response_code(401); echo json_encode(['status' => 'failed', 'reason' => "missing api key"]); + return; + } + + if(!isset($obj['logbook_public_slug']) || !isset($obj['callsign'])) { + http_response_code(401); + echo json_encode(['status' => 'failed', 'reason' => "missing fields"]); + return; } if($obj['logbook_public_slug'] != "" && $obj['callsign'] != "") { @@ -562,6 +316,12 @@ class API extends CI_Controller { echo json_encode(['status' => 'failed', 'reason' => "missing api key"]); } + if(!isset($obj['logbook_public_slug']) || !isset($obj['grid'])) { + http_response_code(401); + echo json_encode(['status' => 'failed', 'reason' => "missing fields"]); + return; + } + if($obj['logbook_public_slug'] != "" && $obj['grid'] != "") { $logbook_slug = $obj['logbook_public_slug']; diff --git a/application/controllers/Awards.php b/application/controllers/Awards.php index 9e87ca4e..d11f7b86 100644 --- a/application/controllers/Awards.php +++ b/application/controllers/Awards.php @@ -97,37 +97,6 @@ class Awards extends CI_Controller { } - public function dok_details_ajax(){ - $a = $this->security->xss_clean($this->input->post()); - $q = ""; - foreach ($a as $key => $value) { - $q .= $key."=".$value.("(and)"); - } - $q = substr($q, 0, strlen($q)-13); - - $arguments["query"] = $q; - $arguments["fields"] = ''; - $arguments["format"] = "json"; - $arguments["limit"] = ''; - $arguments["order"] = ''; - $arguments["join_station_profile"] = true; - - // Load the API and Logbook models - $this->load->model('api_model'); - $this->load->model('logbook_model'); - - // Call the parser within the API model to build the query - $query = $this->api_model->select_parse($arguments); - - // Execute the query, and retrieve the results - $data = $this->logbook_model->api_search_query($query); - - // Render Page - $data['page_title'] = "Log View - DOK"; - $data['filter'] = str_replace("(and)", ", ", $q); - $this->load->view('awards/details', $data); - } - public function dxcc () { $this->load->model('dxcc'); $this->load->model('modes'); @@ -252,7 +221,6 @@ class Awards extends CI_Controller { $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); // 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. diff --git a/application/controllers/Csv.php b/application/controllers/Csv.php index af1b1402..de02ce43 100644 --- a/application/controllers/Csv.php +++ b/application/controllers/Csv.php @@ -5,7 +5,7 @@ class Csv extends CI_Controller { public function index() { $this->load->model('user_model'); - if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } + if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } $this->load->model('modes'); $this->load->model('logbook_model'); @@ -26,8 +26,11 @@ class Csv extends CI_Controller { } public function export() { - $this->load->model('csv_model'); + $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'); } + + $this->load->model('csv_model'); // Parameters $station_id = $this->security->xss_clean($this->input->post('station_profile')); $band = $this->security->xss_clean($this->input->post('band')); diff --git a/application/controllers/Dashboard.php b/application/controllers/Dashboard.php index b7b3b969..8c5ae246 100644 --- a/application/controllers/Dashboard.php +++ b/application/controllers/Dashboard.php @@ -87,12 +87,19 @@ class Dashboard extends CI_Controller { $data['total_qsl_sent'] = $QSLStatsBreakdownArray['QSL_Sent']; $data['total_qsl_rcvd'] = $QSLStatsBreakdownArray['QSL_Received']; $data['total_qsl_requested'] = $QSLStatsBreakdownArray['QSL_Requested']; + $data['qsl_sent_today'] = $QSLStatsBreakdownArray['QSL_Sent_today']; + $data['qsl_rcvd_today'] = $QSLStatsBreakdownArray['QSL_Received_today']; + $data['qsl_requested_today'] = $QSLStatsBreakdownArray['QSL_Requested_today']; $data['total_eqsl_sent'] = $QSLStatsBreakdownArray['eQSL_Sent']; $data['total_eqsl_rcvd'] = $QSLStatsBreakdownArray['eQSL_Received']; + $data['eqsl_sent_today'] = $QSLStatsBreakdownArray['eQSL_Sent_today']; + $data['eqsl_rcvd_today'] = $QSLStatsBreakdownArray['eQSL_Received_today']; $data['total_lotw_sent'] = $QSLStatsBreakdownArray['LoTW_Sent']; $data['total_lotw_rcvd'] = $QSLStatsBreakdownArray['LoTW_Received']; + $data['lotw_sent_today'] = $QSLStatsBreakdownArray['LoTW_Sent_today']; + $data['lotw_rcvd_today'] = $QSLStatsBreakdownArray['LoTW_Received_today']; $data['last_five_qsos'] = $this->logbook_model->get_last_qsos('18', $logbooks_locations_array); @@ -210,6 +217,6 @@ class Dashboard extends CI_Controller { echo "}"; } - + } diff --git a/application/controllers/Dxatlas.php b/application/controllers/Dxatlas.php index ad86ba4a..79dbf9db 100644 --- a/application/controllers/Dxatlas.php +++ b/application/controllers/Dxatlas.php @@ -4,8 +4,7 @@ class Dxatlas extends CI_Controller { public function index() { $this->load->model('user_model'); - - if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } + if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } $this->load->model('modes'); $this->load->model('logbook_model'); @@ -26,6 +25,9 @@ class Dxatlas extends CI_Controller { } public function export() { + $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'); } + $this->load->model('dxatlas_model'); // Parameters @@ -45,6 +47,8 @@ class Dxatlas extends CI_Controller { } function generateFiles($wkdArray, $cfmArray, $band) { + $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'); } $gridCfmArray = []; $gridWkdArray = []; @@ -100,9 +104,11 @@ class Dxatlas extends CI_Controller { } function makeZip($gridWkdString, $gridCfmString, $band) { + $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'); } $zipFileName = 'dxatlas_gridsquares_'. $band . '.zip'; // Prepare File - $file = tempnam("tmp", "zip"); + $file = tempnam(".", "zip"); $zip = new ZipArchive(); $zip->open($file, ZipArchive::OVERWRITE); diff --git a/application/controllers/Eqsl.php b/application/controllers/Eqsl.php index e0458ca9..8bb72380 100644 --- a/application/controllers/Eqsl.php +++ b/application/controllers/Eqsl.php @@ -463,7 +463,7 @@ class eqsl extends CI_Controller { } function writeEqslNotSent($qslsnotsent, $custom_date_format) { - $table = ''; + $table = '
'; $table .= ""; $table .= ""; $table .= ""; diff --git a/application/controllers/Export.php b/application/controllers/Export.php deleted file mode 100644 index 9d2c4bf4..00000000 --- a/application/controllers/Export.php +++ /dev/null @@ -1,21 +0,0 @@ -load->model('user_model'); - if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } - - $data['page_title'] = "Data Export"; - - $this->load->view('interface_assets/header', $data); - $this->load->view('export/index'); - $this->load->view('interface_assets/footer'); - - } -} - -/* End of file welcome.php */ -/* Location: ./application/controllers/welcome.php */ \ No newline at end of file diff --git a/application/controllers/Kmlexport.php b/application/controllers/Kmlexport.php index 711ebc68..f76327b5 100644 --- a/application/controllers/Kmlexport.php +++ b/application/controllers/Kmlexport.php @@ -13,9 +13,9 @@ class Kmlexport extends CI_Controller { $this->load->model('user_model'); $this->load->model('modes'); $this->load->model('logbook_model'); - $this->load->model('bands'); + $this->load->model('bands'); - if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } + if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } $data['worked_bands'] = $this->bands->get_worked_bands(); // Used in the view for band select $data['modes'] = $this->modes->active(); // Used in the view for mode select @@ -29,6 +29,8 @@ class Kmlexport extends CI_Controller { } public function export() { + $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'); } // Load Libraries $this->load->library('qra'); $this->load->helper('file'); diff --git a/application/controllers/Logbook.php b/application/controllers/Logbook.php index 9ad45f30..fcd10061 100644 --- a/application/controllers/Logbook.php +++ b/application/controllers/Logbook.php @@ -127,7 +127,6 @@ class Logbook extends CI_Controller { "callsign_us_county" => "", "qsl_manager" => "", "bearing" => "", - "latlng" => "", "workedBefore" => false, "lotw_member" => $lotw_member, "lotw_days" => $lotw_days, @@ -145,14 +144,14 @@ class Logbook extends CI_Controller { $measurement_base = $this->session->userdata('user_measurement_base'); } - $return['callsign_name'] = $this->nval($callbook['name'], $this->logbook_model->call_name($callsign)); - $return['callsign_qra'] = $this->nval($callbook['gridsquare'], $this->logbook_model->call_qra($callsign)); + $return['callsign_name'] = $this->nval($callbook['name'] ?? '', $this->logbook_model->call_name($callsign)); + $return['callsign_qra'] = $this->nval($callbook['gridsquare'] ?? '', $this->logbook_model->call_qra($callsign)); $return['callsign_distance'] = $this->distance($return['callsign_qra']); - $return['callsign_qth'] = $this->nval($callbook['city'], $this->logbook_model->call_qth($callsign)); - $return['callsign_iota'] = $this->nval($callbook['iota'], $this->logbook_model->call_iota($callsign)); - $return['qsl_manager'] = $this->nval($callbook['qslmgr'], $this->logbook_model->call_qslvia($callsign)); - $return['callsign_state'] = $this->nval($callbook['state'], $this->logbook_model->call_state($callsign)); - $return['callsign_us_county'] = $this->nval($callbook['us_county'], $this->logbook_model->call_us_county($callsign)); + $return['callsign_qth'] = $this->nval($callbook['city'] ?? '', $this->logbook_model->call_qth($callsign)); + $return['callsign_iota'] = $this->nval($callbook['iota'] ?? '', $this->logbook_model->call_iota($callsign)); + $return['qsl_manager'] = $this->nval($callbook['qslmgr'] ?? '', $this->logbook_model->call_qslvia($callsign)); + $return['callsign_state'] = $this->nval($callbook['state'] ?? '', $this->logbook_model->call_state($callsign)); + $return['callsign_us_county'] = $this->nval($callbook['us_county'] ?? '', $this->logbook_model->call_us_county($callsign)); $return['workedBefore'] = $this->worked_grid_before($return['callsign_qra'], $type, $band, $mode); if ($this->session->userdata('user_show_profile_image')) { diff --git a/application/controllers/Logbookadvanced.php b/application/controllers/Logbookadvanced.php index 8b7f0cf8..f25fe68f 100644 --- a/application/controllers/Logbookadvanced.php +++ b/application/controllers/Logbookadvanced.php @@ -115,6 +115,7 @@ class Logbookadvanced extends CI_Controller { 'sota' => xss_clean($this->input->post('sota')), 'pota' => xss_clean($this->input->post('pota')), 'wwff' => xss_clean($this->input->post('wwff')), + 'qslimages' => xss_clean($this->input->post('qslimages')), ); $qsos = []; @@ -140,7 +141,7 @@ class Logbookadvanced extends CI_Controller { $callbook = $this->logbook_model->loadCallBook($qso['COL_CALL'], $this->config->item('use_fullname')); - if ($callbook['callsign'] !== "") { + if ($callbook['callsign'] ?? "" !== "") { $this->logbookadvanced_model->updateQsoWithCallbookInfo($qsoID, $qso, $callbook); $qso['COL_NAME'] = trim($callbook['name']); if (isset($callbook['qslmgr'])) { @@ -225,4 +226,11 @@ class Logbookadvanced extends CI_Controller { public function startAtLabel() { $this->load->view('logbookadvanced/startatform'); } + + public function qslSlideshow() { + $cleanids = $this->security->xss_clean($this->input->post('ids')); + $this->load->model('logbookadvanced_model'); + $data['qslimages'] = $this->logbookadvanced_model->getQslsForQsoIds($cleanids); + $this->load->view('logbookadvanced/qslcarousel', $data); + } } diff --git a/application/controllers/Qso.php b/application/controllers/Qso.php index a5053c5c..1df36bae 100755 --- a/application/controllers/Qso.php +++ b/application/controllers/Qso.php @@ -571,6 +571,17 @@ class QSO extends CI_Controller { echo json_encode($data); } + // Return Previous QSOs Made in the active logbook + public function component_past_contacts() { + $this->load->model('logbook_model'); + if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } + + $data['query'] = $this->logbook_model->last_custom('5'); + + // Load view + $this->load->view('qso/components/previous_contacts', $data); + } + function check_locator($grid) { $grid = $this->input->post('locator'); // Allow empty locator diff --git a/application/controllers/Uncfmd_Entity_Slots.php b/application/controllers/Uncfmd_Entity_Slots.php deleted file mode 100644 index e197f96a..00000000 --- a/application/controllers/Uncfmd_Entity_Slots.php +++ /dev/null @@ -1,114 +0,0 @@ -load->helper(array('form', 'url')); - - $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() - { - $this->load->model('user_model'); - if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } - - $data['page_title'] = "Showing unconfirmed Entities with Slots"; - - $this->load->view('interface_assets/header', $data); - $this->load->view('uncfmd_entity_slots/index'); - $this->load->view('interface_assets/footer'); - - } - - public function exportadif() - { - // Set memory limit to unlimited to allow heavy usage - ini_set('memory_limit', '-1'); - - $this->load->model('adif_data'); - - $data['qsos'] = $this->adif_data->export_printrequested(); - - $this->load->view('adif/data/exportall', $data); - } - - public function exportcsv() - { - // Set memory limit to unlimited to allow heavy usage - ini_set('memory_limit', '-1'); - - $this->load->model('logbook_model'); - - $myData = $this->logbook_model->get_qsos_for_printing(); - - // file name - $filename = 'qsl_export.csv'; - header("Content-Description: File Transfer"); - header("Content-Disposition: attachment; filename=$filename"); - header("Content-Type: application/csv;charset=iso-8859-1"); - - // file creation - $file = fopen('php://output', 'w'); - - $header = array("STATION_CALLSIGN", - "COL_CALL", - "COL_QSL_VIA", - "COL_TIME_ON", - "COL_MODE", - "COL_FREQ", - "COL_BAND", - "COL_RST_SENT", - "COL_SAT_NAME", - "COL_SAT_MODE", - "COL_QSL_RCVD", - "COL_COMMENT", - "COL_ROUTING", - "ADIF", - "ENTITY"); - - fputcsv($file, $header); - - foreach ($myData->result() as $qso) { - fputcsv($file, - array($qso->STATION_CALLSIGN, - str_replace("0", "Ø", $qso->COL_CALL), - $qso->COL_QSL_VIA!=""?"Via ".str_replace("0", "Ø", $qso->COL_QSL_VIA):"", - $qso->COL_TIME_ON, - $qso->COL_MODE, - $qso->COL_FREQ, - $qso->COL_BAND, - $qso->COL_RST_SENT, - $qso->COL_SAT_NAME, - $qso->COL_SAT_MODE, - $qso->COL_QSL_RCVD =='Y'?'TNX QSL':'PSE QSL', - $qso->COL_COMMENT, - $qso->COL_ROUTING, - $qso->ADIF, - $qso->ENTITY)); - } - - fclose($file); - exit; - } - - function qsl_printed() { - $this->load->model('qslprint_model'); - $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'); } - - // Update Logbook to Mark Paper Card Received - - $this->qslprint_model->mark_qsos_printed(); - - $this->session->set_flashdata('notice', 'QSOs are marked as sent via buro'); - - redirect('logbook'); - } -} - -/* End of file Qslprint.php */ -/* Location: ./application/controllers/Qslprint.php */ \ No newline at end of file diff --git a/application/language/chinese_simplified/account_lang.php b/application/language/chinese_simplified/account_lang.php index 98c95c79..2e86d689 100644 --- a/application/language/chinese_simplified/account_lang.php +++ b/application/language/chinese_simplified/account_lang.php @@ -8,3 +8,90 @@ $lang['account_column2_text'] = '选择第2列'; $lang['account_column3_text'] = '选择第3列'; $lang['account_column4_text'] = '选择第4列'; $lang['account_column5_text'] = '选择第5列(仅日志簿)'; + +$lang['account_create_user_account'] = '创建用户账户i'; +$lang['account_edit_account'] = '编辑账户'; + +$lang['account_account_information'] = '账户信息'; +$lang['account_username'] = '用户名'; +$lang['account_email_address'] = '电子邮件'; +$lang['account_password'] = '密码'; + +$lang['account_roles'] = '角色'; +$lang['account_user_role'] = '用户角色'; + +$lang['account_theme'] = '主题'; +$lang['account_stylesheet'] = '样式表'; + +$lang['account_personal_information'] = '个人信息'; +$lang['account_first_name'] = '姓'; +$lang['account_last_name'] = '名'; +$lang['account_callsign'] = '呼号'; +$lang['account_gridsquare'] = '梅登海德网格'; + +$lang['account_cloudlog_preferences'] = '偏好选项'; +$lang['account_timezone'] = '时区'; +$lang['account_date_format'] = '日期格式'; +$lang['account_measurement_preferences'] = '距离单位偏好'; +$lang['account_select_how_you_would_like_dates_shown_when_logged_into_your_account'] = '选择您登录账户时要显示的日期格式'; +$lang['account_choose_which_unit_distances_will_be_shown_in'] = '选择距离单位'; + +$lang['account_main_menu'] = '主菜单'; +$lang['account_show_notes_in_the_main_menu'] = '在主菜单显示便签栏'; + +$lang['account_gridsquare_and_location_autocomplete'] = '自动填写梅登海德网格和位置'; +$lang['account_location_auto_lookup'] = '自动查找位置'; +$lang['account_if_set_gridsquare_is_fetched_based_on_location_name'] = '如果开启本选项,将根据位置名称获取梅登海德网格。'; +$lang['account_sota_auto_lookup_gridsquare_and_name_for_summit'] = '根据SOTA编号自动查找梅登海德网格和峰名。'; +$lang['account_wwff_auto_lookup_gridsquare_and_name_for_reference'] = '根据WWFF编号自动查找梅登海德网格和名称。'; +$lang['account_pota_auto_lookup_gridsquare_and_name_for_park'] = '根据POTA编号自动查找梅登海德网格和名称。'; +$lang['account_if_set_name_and_gridsquare_is_fetched_from_the_api_and_filled_in_location_and_locator'] = '如果开启此项设置,将从API获取名称和梅登海德网格,并填写位置和定位器。'; + +$lang['account_previous_qsl_type'] = '上一个QSL类型'; +$lang['account_select_the_type_of_qsl_to_show_in_the_previous_qsos_section'] = '选择要在上一个QSO部分中显示的QSL类型。'; + +$lang['account_qrzcom_hamqthcom_images'] = 'qrz.com/hamqth.com Images'; +$lang['account_show_profile_picture_of_qso_partner_from_qrzcom_hamqthcom_profile_in_the_log_qso_section'] = '在日志QSO部分中显示qrz.com/hamqth.com配置文件的QSO合作伙伴的个人资料图片。'; +$lang['account_please_set_your_qrzcom_hamqthcom_credentials_in_the_general_config_file'] = '请在general_config.php文件中设置qrz.com/hamqth.com凭据。'; + +$lang['account_amsat_status_upload'] = '上传到AMSAT'; +$lang['account_upload_status_of_sat_qsos_to'] = '上传卫星QSO到'; + +$lang['account_logbook_of_the_world'] = 'Logbook of the World'; +$lang['account_logbook_of_the_world_lotw_username'] = 'Logbook of The World (LoTW) 用户名'; +$lang['account_logbook_of_the_world_lotw_password'] = 'Logbook of The World (LoTW) 密码'; +$lang['account_leave_blank_to_keep_existing_password'] = '留空以保留现有密码'; + +$lang['account_clublog'] = 'Club Log(俱乐部日志)'; +$lang['account_clublog_email_callsign'] = 'Club Log 邮件地址/呼号'; +$lang['account_clublog_password'] = 'Club Log 密码'; +$lang['account_the_email_or_callsign_you_use_to_login_to_club_log'] = '您用于登录Club Log的电子邮件或呼号。'; + +$lang['account_eqsl'] = 'eQSL'; +$lang['account_eqslcc_username'] = 'eQSL.cc 用户名'; +$lang['account_eqslcc_password'] = 'eQSL.cc 密码'; + +$lang['account_save_account_changes'] = '保存账户更改'; +$lang['account_create_account'] = '创建账户'; + +$lang['account_delete_user_account'] = '删除用户账户'; +$lang['account_are_you_sure_you_want_to_delete_the_user_account'] = '您确定要删除用户账户吗?'; +$lang['account_yes_delete_this_user'] = '是的,删除此用户'; +$lang['account_no_do_not_delete_this_user'] = '不,不要删除此用户'; + +$lang['account_forgot_password'] = '忘记密码'; +$lang['account_you_can_reset_your_password_here'] = '您可以在此处重置密码。'; +$lang['account_reset_password'] = '重置密码'; +$lang['account_the_email_field_is_required'] = '电子邮件必填'; +$lang['account_confirm_password'] = '确认密码'; + +$lang['account_forgot_your_password'] = '忘记密码?'; + +$lang['account_login_to_cloudlog'] = '登录Cloudlog'; +$lang['account_login'] = '登录'; + +$lang['account_mastodon'] = 'Mastodon服务器'; +$lang['account_user_mastodon'] = 'Mastodon 地址'; + +$lang['account_gridmap_settings'] = '网格地图设置'; +$lang['account_gridmap_default_band'] = '默认波段'; diff --git a/application/language/chinese_simplified/admin_lang.php b/application/language/chinese_simplified/admin_lang.php new file mode 100644 index 00000000..550c55b8 --- /dev/null +++ b/application/language/chinese_simplified/admin_lang.php @@ -0,0 +1,18 @@ +

Directory access is forbidden.

+1 \ No newline at end of file diff --git a/application/language/chinese_simplified/lotw_lang.php b/application/language/chinese_simplified/lotw_lang.php index b1b25958..6426ca40 100644 --- a/application/language/chinese_simplified/lotw_lang.php +++ b/application/language/chinese_simplified/lotw_lang.php @@ -11,7 +11,7 @@ $lang['lotw_title_export_p12_file_instruction'] = '导出 .p12 文件流程'; $lang['lotw_title_adif_import'] = 'ADIF 导入'; $lang['lotw_title_adif_import_options'] = '导入选项'; -$lang['lotw_beta_warning'] = '请明确 LoTW 同步处于 BETA 测试阶段, 查看 wiki 寻求帮助。'; +$lang['lotw_beta_warning'] = '请明确 LoTW 同步处于 BETA 测试阶段, 请查看 wiki 寻求帮助。'; $lang['lotw_no_certs_uploaded'] = '你需要上传 LoTW p12 证书以使用该功能。'; $lang['lotw_date_created'] = '创建日期'; @@ -22,6 +22,7 @@ $lang['lotw_status'] = '状态'; $lang['lotw_options'] = '选项'; $lang['lotw_valid'] = '有效'; $lang['lotw_expired'] = '过期'; +$lang['lotw_expiring'] = '即将到期'; $lang['lotw_not_synced'] = '未同步'; $lang['lotw_certificate_dxcc'] = '证书 DXCC'; @@ -29,7 +30,7 @@ $lang['lotw_certificate_dxcc_help_text'] = '证书的 DXCC 实体。例如: Scot $lang['lotw_input_a_file'] = '上传文件'; -$lang['lotw_upload_exported_adif_file_from_lotw'] = '下载从 LoTW Download Report 中导出的 ADIF 文件,以标记这些 QSO 在 LoTW上已得到确认。'; +$lang['lotw_upload_exported_adif_file_from_lotw'] = '下载从 LoTW Download Report 中导出的 ADIF 文件,并且标记在 LoTW上已得到确认的QSO。'; $lang['lotw_upload_type_must_be_adi'] = '日志文件的类型必须为 .adi'; $lang['lotw_pull_lotw_data_for_me'] = '为我拉取 LoTW 数据'; @@ -51,3 +52,10 @@ $lang['lotw_p12_export_step_three'] = '单击 "Save Callsign Certificate File" $lang['lotw_p12_export_step_four'] = '在下方上传文件。'; $lang['lotw_confirmed'] = '该 QSO 已在 LoTW 确认'; + +// LoTW Expiry +$lang['lotw_cert_expiring'] = '至少有一个LoTW证书即将过期!'; +$lang['lotw_cert_expired'] = '至少有一个LoTW证书已经过期!'; + +// Lotw User +$lang['lotw_user'] = '这个电台使用 LOTW。最后一次上传是'; diff --git a/application/language/chinese_simplified/menu_lang.php b/application/language/chinese_simplified/menu_lang.php new file mode 100644 index 00000000..49791713 --- /dev/null +++ b/application/language/chinese_simplified/menu_lang.php @@ -0,0 +1,84 @@ +Download Report Area, to mark QSOs as confirmed on LoTW.'; +$lang['lotw_upload_exported_adif_file_from_lotw'] = 'Nahraj exportovaný soubor z LoTW z Download Report Area, to mark QSOs as confirmed on LOTW.'; $lang['lotw_upload_type_must_be_adi'] = 'Deník musí být ve formátu .adi'; $lang['lotw_pull_lotw_data_for_me'] = 'Stáhni data z LoTW'; diff --git a/application/language/czech/menu_lang.php b/application/language/czech/menu_lang.php new file mode 100644 index 00000000..beb23311 --- /dev/null +++ b/application/language/czech/menu_lang.php @@ -0,0 +1,84 @@ +db->where('option_name', 'version'); + $this->db->update('options', array('option_value' => '2.4.7')); + } + + public function down() + { + $this->db->where('option_name', 'version'); + $this->db->update('options', array('option_value' => '2.4.6')); + } +} \ No newline at end of file diff --git a/application/models/Api_model.php b/application/models/Api_model.php index 1cc767ca..f470c713 100644 --- a/application/models/Api_model.php +++ b/application/models/Api_model.php @@ -183,191 +183,7 @@ class API_Model extends CI_Model { return 0; } - function insert_parse($arguments) - { -# $q = "INSERT INTO ".$this->config->item('table_name'); - - $f = explode(",", $arguments['query']); - $r = $this->_insert_field_translate($f); - - return $r; - } - - // FUNCTION: string select_parse(array $arguments) - // Converts an array of arguments into a MySQL query string - // See documentation for search() under the API controller for more details - function select_parse($arguments) - { - // Initialise our string - $q = "SELECT "; - - // Cycle through the fields, converting friendly names to MySQL column names - if($arguments['fields'] != "") { - $field = ""; - $fields = explode(",", $arguments['fields']); - foreach ($fields as $f) { - if($field != "") { - $field .= ","; - } - // Add field to the query, with '++' placeholders for later translation - $field .= "++$f++"; - } - // Handle any DISTINCT arguments - $field = str_replace("++distinct(", "DISTINCT(++", $field); - $field = str_replace(")++", "++)", $field); - // Add the MySQL column name to the query - $q .= $field." "; - } else { - // If no fields are specified, display all fields - $q .= "* "; - } - - // Append the table we're pulling data from - $q .= "FROM ".$this->config->item('table_name'); - if (isset($arguments["join_station_profile"]) && $arguments["join_station_profile"]) { - $q .= " INNER JOIN station_profile ON ".$this->config->item('table_name').".station_id = station_profile.station_id"; - } - - // Parse the 'query' string, which is converted into a standard MySQL 'WHERE' - // clause. - // $s and $r can be refactored into single array definitions, but during - // development it's easier to list them in this way for quick reference. - - if($arguments['query'] != "") - { - $q .= " WHERE "; - $q = $this->_query_parse($q, $arguments['query']); - } - - // Parse any order arguments - if($arguments['order'] != "") - { - $q .= " ORDER BY "; - - $s = null; - $r = null; - $s[0] = '/(/'; - $s[1] = '/)/'; - $s[2] = '/([a-zA-Z0-9\-\_]+)([,\(]{1}|$)/'; - $s[3] = '/\(asc\)/'; - $s[4] = '/\(desc\)/'; - $s[5] = '/,$/'; - $s[6] = '/\[/'; - $s[7] = '/\]/'; - - $r[0] = '('; - $r[1] = ')'; - $r[2] = '++$1++ $2'; - $r[3] = ' ASC '; - $r[4] = ' DESC '; - $r[5] = ''; - $r[6] = ''; - $r[7] = ''; - - $q .= preg_replace($s, $r, $arguments['order']); - - } - - $q = $this->_select_field_translate($q); - - // Parse any limit arguments - if($arguments['limit'] != "") - { - // Add the limit arguments, removing any characters other than numbers and commas - $q .= " LIMIT " . preg_replace(array("/[^0-9\,]/","/,$/"), "", $arguments['limit']); - } - else - { - // If no limit argument is given, default to the first 20 results - $q .= " LIMIT 0,20"; - } - - return $q; - } - - private function _query_parse($q, $qs) - { - if($qs != "") - { - $s = null; - $r = null; - // (and), becomes ' AND ' - $s[0] = '/(and)/'; - // (or), becomes ' OR ' - $s[1] = '/(or)/'; - // <, >, [ and ] all translated from their urlencoded forms - $s[2] = '/%3C/'; - $s[3] = '/%3E/'; - $s[4] = '/%5B/'; - $s[5] = '/%5D/'; - // FieldName=, which becomes '++FieldName++ = ' - $s[6] = '/([a-zA-Z0-9\-\_\*\(\)\=\~]+)=/'; - // =Value, which becomes '= 'Value'' - $s[7] = '/=([a-zA-Z0-9\-\_\*\(\)\=\~]+)/'; - // now(), which becomes 'UNIX_TIMESTAMP(NOW())' - $s[8] = '/now()/'; - // (, and ), which are translated to their non-HTML entity forms, - // and with added padding - $s[9] = '/(/'; - $s[10] = '/)/'; - // FieldName~, becomes '++FieldName++ LIKE~' - $s[11] = '/([a-zA-Z0-9\-\_\*\(\)\=\~]+)~/'; - // ~Value, becomes ' 'Value'' - $s[12] = '/~([a-zA-Z0-9\-\_\*\(\)\=\~]+)/'; - // *, which becomes '%' - $s[13] = '/\*/'; - - $r[0] = ' AND '; - $r[1] = ' OR '; - $r[2] = ' < '; - $r[3] = ' > '; - // Strip out square brackets - $r[4] = ''; - $r[5] = ''; - $r[6] = '++$1++ ='; - $r[7] = '= \'$1\''; - $r[8] = 'UNIX_TIMESTAMP(NOW())'; - $r[9] = '( '; - $r[10] = ' )'; - $r[11] = '++$1++ LIKE~'; - $r[12] = ' \'$1\''; - $r[13] = '%'; - - // Bulk replace everything - $q .= preg_replace($s, $r, $qs); - } - - return $q; - } - - private function _select_field_translate($q) - { - // Do search/replace on field names, to convert from friendly names - // to MySQL column names - - foreach($this->_columnName as $key => $val) { - $q = str_replace("++".$val['Name']."++", $key, $q); - } - - - - return $q; - } - - private function _insert_field_translate($q) - { - // Do search/replace on field names, to convert from friendly names - // to MySQL column names - $r = array(); - - foreach($q as $key => $val) { - $f = explode('=', $val); - $r[$this->column($f[0])] = $f[1]; - } - - return $r; - } - + // ARRAY: $_columnName // An array matching MySQL column names to friendly names, descriptions and types private $_columnName = array( diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 6c05d6a8..f0e54c2e 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -337,37 +337,55 @@ class Logbook_model extends CI_Model { $this->db->join('dxcc_entities', 'dxcc_entities.adif = '.$this->config->item('table_name').'.COL_DXCC', 'left outer'); $this->db->join('lotw_users', 'lotw_users.callsign = '.$this->config->item('table_name').'.col_call', 'left outer'); switch ($type) { - case 'DXCC': - $this->db->where('COL_COUNTRY', $searchphrase); - break; - case 'DXCC2': - $this->db->where('COL_DXCC', $searchphrase); - break; - case 'IOTA': - $this->db->where('COL_IOTA', $searchphrase); - break; - case 'VUCC': - $this->db->where("(COL_GRIDSQUARE like '%" . $searchphrase . "%' OR COL_VUCC_GRIDS like'%" . $searchphrase ."%')"); - break; - case 'CQZone': - $this->db->where('COL_CQZ', $searchphrase); - break; - case 'WAS': - $this->db->where('COL_STATE', $searchphrase); - $this->db->where_in('COL_DXCC', ['291', '6', '110']); - break; - case 'SOTA': - $this->db->where('COL_SOTA_REF', $searchphrase); - break; - case 'WWFF': - $this->db->where('COL_WWFF_REF', $searchphrase); - break; - case 'POTA': - $this->db->where('COL_POTA_REF', $searchphrase); - break; - case 'DOK': - $this->db->where('COL_DARC_DOK', $searchphrase); - break; + case 'DXCC': + $this->db->where('COL_COUNTRY', $searchphrase); + break; + case 'DXCC2': + $this->db->where('COL_DXCC', $searchphrase); + break; + case 'IOTA': + $this->db->where('COL_IOTA', $searchphrase); + break; + case 'VUCC': + $this->db->where("(COL_GRIDSQUARE like '%" . $searchphrase . "%' OR COL_VUCC_GRIDS like'%" . $searchphrase ."%')"); + break; + case 'CQZone': + $this->db->where('COL_CQZ', $searchphrase); + break; + case 'WAS': + $this->db->where('COL_STATE', $searchphrase); + $this->db->where_in('COL_DXCC', ['291', '6', '110']); + break; + case 'SOTA': + $this->db->where('COL_SOTA_REF', $searchphrase); + break; + case 'WWFF': + $this->db->where('COL_WWFF_REF', $searchphrase); + break; + case 'POTA': + $this->db->where('COL_POTA_REF', $searchphrase); + break; + case 'DOK': + $this->db->where('COL_DARC_DOK', $searchphrase); + break; + case 'QSLRDATE': + $this->db->where('date(COL_QSLRDATE)=date(SYSDATE())'); + break; + case 'QSLSDATE': + $this->db->where('date(COL_QSLSDATE)=date(SYSDATE())'); + break; + case 'EQSLRDATE': + $this->db->where('date(COL_EQSL_QSLRDATE)=date(SYSDATE())'); + break; + case 'EQSLSDATE': + $this->db->where('date(COL_EQSL_QSLSDATE)=date(SYSDATE())'); + break; + case 'LOTWRDATE': + $this->db->where('date(COL_LOTW_QSLRDATE)=date(SYSDATE())'); + break; + case 'LOTWSDATE': + $this->db->where('date(COL_LOTW_QSLSDATE)=date(SYSDATE())'); + break; } $this->db->where_in($this->config->item('table_name').'.station_id', $logbooks_locations_array); @@ -883,9 +901,12 @@ class Logbook_model extends CI_Model { $CI =& get_instance(); $CI->load->model('stations'); if (!$CI->stations->check_station_is_accessible($stationId)) { - return; + return; } + $station_profile=$CI->stations->profile_clean($stationId); + $stationCallsign=$station_profile->station_callsign; + $mode = $this->get_main_mode_if_submode($this->input->post('mode')); if ($mode == null) { $mode = $this->input->post('mode'); @@ -912,7 +933,7 @@ class Logbook_model extends CI_Model { $srx_string = null; } - if (stristr($this->input->post('usa_county'), ',')) { + if (stristr($this->input->post('usa_county') ?? '', ',')) { $uscounty = $this->input->post('usa_county'); } else { $uscounty = $this->input->post('usa_state') .",".$this->input->post('usa_county'); @@ -1058,6 +1079,7 @@ class Logbook_model extends CI_Model { 'COL_CONTEST_ID' => $this->input->post('contest_name'), 'COL_QSL_VIA' => $this->input->post('qsl_via_callsign'), 'station_id' => $stationId, + 'COL_STATION_CALLSIGN' => $stationCallsign, 'COL_OPERATOR' => $this->input->post('operator_callsign'), 'COL_STATE' =>$this->input->post('usa_state'), 'COL_CNTY' => $uscounty @@ -2241,64 +2263,88 @@ class Logbook_model extends CI_Model { function get_QSLStats($StationLocationsArray = null) { - 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; - } + 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; + } - if(!empty($logbooks_locations_array)) { - $this->db->select(' - COUNT(IF(COL_QSL_SENT="Y",COL_QSL_SENT,null)) as QSL_Sent, - COUNT(IF(COL_QSL_RCVD="Y",COL_QSL_RCVD,null)) as QSL_Received, - COUNT(IF(COL_QSL_SENT IN("Q", "R") ,COL_QSL_SENT,null)) as QSL_Requested, - COUNT(IF(COL_EQSL_QSL_SENT="Y",COL_EQSL_QSL_SENT,null)) as eQSL_Sent, - COUNT(IF(COL_EQSL_QSL_RCVD="Y",COL_EQSL_QSL_RCVD,null)) as eQSL_Received, - COUNT(IF(COL_LOTW_QSL_SENT="Y",COL_LOTW_QSL_SENT,null)) as LoTW_Sent, - COUNT(IF(COL_LOTW_QSL_RCVD="Y",COL_LOTW_QSL_RCVD,null)) as LoTW_Received - '); - $this->db->where_in('station_id', $logbooks_locations_array); + if(!empty($logbooks_locations_array)) { + $this->db->select(' + COUNT(IF(COL_QSL_SENT="Y",COL_QSL_SENT,null)) as QSL_Sent, + COUNT(IF(COL_QSL_RCVD="Y",COL_QSL_RCVD,null)) as QSL_Received, + COUNT(IF(COL_QSL_SENT IN("Q", "R") ,COL_QSL_SENT,null)) as QSL_Requested, + COUNT(IF(COL_EQSL_QSL_SENT="Y",COL_EQSL_QSL_SENT,null)) as eQSL_Sent, + COUNT(IF(COL_EQSL_QSL_RCVD="Y",COL_EQSL_QSL_RCVD,null)) as eQSL_Received, + COUNT(IF(COL_LOTW_QSL_SENT="Y",COL_LOTW_QSL_SENT,null)) as LoTW_Sent, + COUNT(IF(COL_LOTW_QSL_RCVD="Y",COL_LOTW_QSL_RCVD,null)) as LoTW_Received, + COUNT(IF(COL_QSL_SENT="Y" and DATE(COL_QSLSDATE)=DATE(SYSDATE()),COL_QSL_SENT,null)) as QSL_Sent_today, + COUNT(IF(COL_QSL_RCVD="Y" and DATE(COL_QSLRDATE)=DATE(SYSDATE()),COL_QSL_RCVD,null)) as QSL_Received_today, + COUNT(IF(COL_QSL_SENT IN("Q", "R") and DATE(COL_QSLSDATE)=DATE(SYSDATE()) ,COL_QSL_SENT,null)) as QSL_Requested_today, + COUNT(IF(COL_EQSL_QSL_SENT="Y" and DATE(COL_EQSL_QSLSDATE)=DATE(SYSDATE()),COL_EQSL_QSL_SENT,null)) as eQSL_Sent_today, + COUNT(IF(COL_EQSL_QSL_RCVD="Y" and DATE(COL_EQSL_QSLRDATE)=DATE(SYSDATE()),COL_EQSL_QSL_RCVD,null)) as eQSL_Received_today, + COUNT(IF(COL_LOTW_QSL_SENT="Y" and DATE(COL_LOTW_QSLSDATE)=DATE(SYSDATE()),COL_LOTW_QSL_SENT,null)) as LoTW_Sent_today, + COUNT(IF(COL_LOTW_QSL_RCVD="Y" and DATE(COL_LOTW_QSLRDATE)=DATE(SYSDATE()),COL_LOTW_QSL_RCVD,null)) as LoTW_Received_today + '); + $this->db->where_in('station_id', $logbooks_locations_array); - if ($query = $this->db->get($this->config->item('table_name'))) - { - $this->db->last_query(); - foreach ($query->result() as $row) - { - $QSLBreakdown['QSL_Sent'] = $row->QSL_Sent; - $QSLBreakdown['QSL_Received'] = $row->QSL_Received; - $QSLBreakdown['QSL_Requested'] = $row->QSL_Requested; - $QSLBreakdown['eQSL_Sent'] = $row->eQSL_Sent; - $QSLBreakdown['eQSL_Received'] = $row->eQSL_Received; - $QSLBreakdown['LoTW_Sent'] = $row->LoTW_Sent; - $QSLBreakdown['LoTW_Received'] = $row->LoTW_Received; - } + if ($query = $this->db->get($this->config->item('table_name'))) { + $this->db->last_query(); + foreach ($query->result() as $row) { + $QSLBreakdown['QSL_Sent'] = $row->QSL_Sent; + $QSLBreakdown['QSL_Received'] = $row->QSL_Received; + $QSLBreakdown['QSL_Requested'] = $row->QSL_Requested; + $QSLBreakdown['eQSL_Sent'] = $row->eQSL_Sent; + $QSLBreakdown['eQSL_Received'] = $row->eQSL_Received; + $QSLBreakdown['LoTW_Sent'] = $row->LoTW_Sent; + $QSLBreakdown['LoTW_Received'] = $row->LoTW_Received; + $QSLBreakdown['QSL_Sent_today'] = $row->QSL_Sent_today; + $QSLBreakdown['QSL_Received_today'] = $row->QSL_Received_today; + $QSLBreakdown['QSL_Requested_today'] = $row->QSL_Requested_today; + $QSLBreakdown['eQSL_Sent_today'] = $row->eQSL_Sent_today; + $QSLBreakdown['eQSL_Received_today'] = $row->eQSL_Received_today; + $QSLBreakdown['LoTW_Sent_today'] = $row->LoTW_Sent_today; + $QSLBreakdown['LoTW_Received_today'] = $row->LoTW_Received_today; + } - return $QSLBreakdown; - } - else - { - $QSLBreakdown['QSL_Sent'] = 0; - $QSLBreakdown['QSL_Received'] = 0; - $QSLBreakdown['QSL_Requested'] = 0; - $QSLBreakdown['eQSL_Sent'] = 0; - $QSLBreakdown['eQSL_Received'] = 0; - $QSLBreakdown['LoTW_Sent'] = 0; - $QSLBreakdown['LoTW_Received'] = 0; + return $QSLBreakdown; + } else { + $QSLBreakdown['QSL_Sent'] = 0; + $QSLBreakdown['QSL_Received'] = 0; + $QSLBreakdown['QSL_Requested'] = 0; + $QSLBreakdown['eQSL_Sent'] = 0; + $QSLBreakdown['eQSL_Received'] = 0; + $QSLBreakdown['LoTW_Sent'] = 0; + $QSLBreakdown['LoTW_Received'] = 0; + $QSLBreakdown['QSL_Sent_today'] = 0; + $QSLBreakdown['QSL_Received_today'] = 0; + $QSLBreakdown['QSL_Requested_today'] = 0; + $QSLBreakdown['eQSL_Sent_today'] = 0; + $QSLBreakdown['eQSL_Received_today'] = 0; + $QSLBreakdown['LoTW_Sent_today'] = 0; + $QSLBreakdown['LoTW_Received_today'] = 0; - return $QSLBreakdown; - } - } else { - $QSLBreakdown['QSL_Sent'] = 0; - $QSLBreakdown['QSL_Received'] = 0; - $QSLBreakdown['QSL_Requested'] = 0; - $QSLBreakdown['eQSL_Sent'] = 0; - $QSLBreakdown['eQSL_Received'] = 0; - $QSLBreakdown['LoTW_Sent'] = 0; - $QSLBreakdown['LoTW_Received'] = 0; + return $QSLBreakdown; + } + } else { + $QSLBreakdown['QSL_Sent'] = 0; + $QSLBreakdown['QSL_Received'] = 0; + $QSLBreakdown['QSL_Requested'] = 0; + $QSLBreakdown['eQSL_Sent'] = 0; + $QSLBreakdown['eQSL_Received'] = 0; + $QSLBreakdown['LoTW_Sent'] = 0; + $QSLBreakdown['LoTW_Received'] = 0; + $QSLBreakdown['QSL_Sent_today'] = 0; + $QSLBreakdown['QSL_Received_today'] = 0; + $QSLBreakdown['QSL_Requested_today'] = 0; + $QSLBreakdown['eQSL_Sent_today'] = 0; + $QSLBreakdown['eQSL_Received_today'] = 0; + $QSLBreakdown['LoTW_Sent_today'] = 0; + $QSLBreakdown['LoTW_Received_today'] = 0; - return $QSLBreakdown; + return $QSLBreakdown; } } @@ -2629,30 +2675,6 @@ class Logbook_model extends CI_Model { } } - function api_search_query($query) { - $time_start = microtime(true); - $results = $this->db->query($query); - if(!$results) { - return array('query' => $query, 'error' => $this->db->_error_number(), 'time' => 0); - } - $time_end = microtime(true); - $time = round($time_end - $time_start, 4); - - return array('query' => $query, 'results' => $results, 'time' => $time); - } - - function api_insert_query($query) { - $time_start = microtime(true); - $results = $this->db->insert($this->config->item('table_name'), $query); - if(!$results) { - return array('query' => $query, 'error' => $this->db->_error_number(), 'time' => 0); - } - $time_end = microtime(true); - $time = round($time_end - $time_start, 4); - - return array('query' => $this->db->queries[2], 'result_string' => $results, 'time' => $time); - } - /* Delete QSO based on the QSO ID */ function delete($id) { if ($this->check_qso_is_accessible($id)) { diff --git a/application/models/Logbookadvanced_model.php b/application/models/Logbookadvanced_model.php index d51d54d1..de032084 100644 --- a/application/models/Logbookadvanced_model.php +++ b/application/models/Logbookadvanced_model.php @@ -86,19 +86,19 @@ class Logbookadvanced_model extends CI_Model { } if ($searchCriteria['eqslSent'] !== '') { - $condition = "COL_EQSL_SENT = ?"; + $condition = "COL_EQSL_QSL_SENT = ?"; if ($searchCriteria['eqslSent'] == 'N') { $condition = '('.$condition; - $condition .= " OR COL_EQSL_SENT IS NULL OR COL_EQSL_SENT = '')"; + $condition .= " OR COL_EQSL_QSL_SENT IS NULL OR COL_EQSL_QSL_SENT = '')"; } $conditions[] = $condition; $binding[] = $searchCriteria['eqslSent']; } if ($searchCriteria['eqslReceived'] !== '') { - $condition = "COL_EQSL_RCVD = ?"; + $condition = "COL_EQSL_QSL_RCVD = ?"; if ($searchCriteria['eqslReceived'] == 'N') { $condition = '('.$condition; - $condition .= " OR COL_EQSL_RCVD IS NULL OR COL_EQSL_RCVD = '')"; + $condition .= " OR COL_EQSL_QSL_RCVD IS NULL OR COL_EQSL_QSL_RCVD = '')"; } $conditions[] = $condition; $binding[] = $searchCriteria['eqslReceived']; @@ -168,6 +168,18 @@ class Logbookadvanced_model extends CI_Model { $limit = $searchCriteria['qsoresults']; + $where2 = ''; + + if ($searchCriteria['qslimages'] !== '') { + if ($searchCriteria['qslimages'] == 'Y') { + $where2 .= ' and x.qslcount > "0"'; + } + if ($searchCriteria['qslimages'] == 'N') { + $where2 .= ' and x.qslcount is null'; + } + } + + $sql = " SELECT * FROM " . $this->config->item('table_name') . " qsos @@ -181,6 +193,7 @@ class Logbookadvanced_model extends CI_Model { ) x on qsos.COL_PRIMARY_KEY = x.qsoid WHERE station_profile.user_id = ? $where + $where2 ORDER BY qsos.COL_TIME_ON desc, qsos.COL_PRIMARY_KEY desc LIMIT $limit "; @@ -391,4 +404,19 @@ class Logbookadvanced_model extends CI_Model { return $modes; } + + function getQslsForQsoIds($ids) { + $CI =& get_instance(); + $CI->load->model('logbooks_model'); + $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + + $this->db->select('*'); + $this->db->from($this->config->item('table_name')); + $this->db->join('qsl_images', 'qsl_images.qsoid = ' . $this->config->item('table_name') . '.col_primary_key'); + $this->db->where_in('qsoid', $ids); + $this->db->where_in('station_id', $logbooks_locations_array); + $this->db->order_by("id", "desc"); + + return $this->db->get()->result(); + } } diff --git a/application/views/dashboard/index.php b/application/views/dashboard/index.php index 02f4aabe..16243236 100644 --- a/application/views/dashboard/index.php +++ b/application/views/dashboard/index.php @@ -216,21 +216,25 @@ function echoQrbCalcLink($mygrid, $grid, $vucc) {
DateTime
+ - + + - + + - + +
@@ -239,16 +243,19 @@ function echoQrbCalcLink($mygrid, $grid, $vucc) { + - + + - + +
@@ -257,16 +264,19 @@ function echoQrbCalcLink($mygrid, $grid, $vucc) { + - + + - + +
diff --git a/application/views/export/index.php b/application/views/export/index.php deleted file mode 100644 index 5fac1319..00000000 --- a/application/views/export/index.php +++ /dev/null @@ -1,12 +0,0 @@ -
-

- -

Below are all the exportable data options available in Cloudlog

- -

Data Types

- - -
\ No newline at end of file diff --git a/application/views/hrdlog/export.php b/application/views/hrdlog/export.php index 85767b58..9b8662b4 100644 --- a/application/views/hrdlog/export.php +++ b/application/views/hrdlog/export.php @@ -46,7 +46,7 @@ echo '' . $station->modcount . ''; echo '' . $station->notcount . ''; echo '' . $station->totcount . ''; - echo ''; + echo ''; echo ''; } echo ''; diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index def9c498..27ecf041 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -940,8 +940,9 @@ $(document).on('keypress',function(e) { uri->segment(1) == "qso") { ?> - -config->item('winkey')) { ?> + +optionslib->get_option('dxcache_url') != ''){ ?> - -uri->segment(2) == "dok") { ?> - - - uri->segment(2) == "iota") { ?> @@ -2395,6 +2387,53 @@ function viewEqsl(picture, callsign) { }); } + function displayContactsOnMap(target, searchphrase, band, mode, type, qsl) { + $.ajax({ + url: base_url + 'index.php/awards/qso_details_ajax', + type: 'post', + data: { + 'Searchphrase': searchphrase, + 'Band': band, + 'Mode': mode, + 'Type': type, + 'QSL' : qsl + }, + success: function (html) { + var dialog = new BootstrapDialog({ + title: 'QSO Data', + size: BootstrapDialog.SIZE_WIDE, + cssClass: 'qso-dialog', + nl2br: false, + message: html, + onshown: function(dialog) { + $('[data-toggle="tooltip"]').tooltip(); + $('.contacttable').DataTable({ + "pageLength": 25, + responsive: false, + ordering: false, + "scrollY": "550px", + "scrollCollapse": true, + "paging": false, + "scrollX": true, + dom: 'Bfrtip', + buttons: [ + 'csv' + ] + }); + }, + buttons: [{ + label: 'Close', + action: function (dialogItself) { + dialogItself.close(); + } + }] + }); + dialog.realize(); + target.append(dialog.getModal()); + dialog.open(); + } + }); + } function uploadQsl() { var baseURL= ""; var formdata = new FormData(document.getElementById("fileinfo")); @@ -2794,7 +2833,7 @@ function viewEqsl(picture, callsign) { uri->segment(1) == "eqsl") { ?> diff --git a/application/views/interface_assets/header.php b/application/views/interface_assets/header.php index 9c2fe0f7..42f3dbfe 100644 --- a/application/views/interface_assets/header.php +++ b/application/views/interface_assets/header.php @@ -318,7 +318,7 @@ $oqrs_requests = $CI->oqrs_model->oqrs_requests($location_list); diff --git a/application/views/logbookadvanced/index.php b/application/views/logbookadvanced/index.php index 13528f30..49d63ce3 100644 --- a/application/views/logbookadvanced/index.php +++ b/application/views/logbookadvanced/index.php @@ -247,12 +247,20 @@ +
+ + +
-
- With selected : +
+ With selected: @@ -266,12 +274,13 @@ +
-
- Quick search with selected : +
+ Quick search with selected: diff --git a/application/views/logbookadvanced/qslcarousel.php b/application/views/logbookadvanced/qslcarousel.php new file mode 100644 index 00000000..2f4e7fcb --- /dev/null +++ b/application/views/logbookadvanced/qslcarousel.php @@ -0,0 +1,74 @@ + + 1) { ?> + + + Previous + + + + Next + + +
diff --git a/application/views/qrz/export.php b/application/views/qrz/export.php index 1f51b4c8..95a89dd2 100644 --- a/application/views/qrz/export.php +++ b/application/views/qrz/export.php @@ -45,7 +45,7 @@ echo '' . $station->modcount . ''; echo '' . $station->notcount . ''; echo '' . $station->totcount . ''; - echo ''; + echo ''; echo ''; } echo ''; diff --git a/application/views/qslcard/qslcarousel.php b/application/views/qslcard/qslcarousel.php index 78aad712..3f26ed00 100644 --- a/application/views/qslcard/qslcarousel.php +++ b/application/views/qslcard/qslcarousel.php @@ -1,4 +1,5 @@ \ No newline at end of file + 1) { ?> + + + Previous + + + + Next + + +
diff --git a/application/views/qslprint/qslprint.php b/application/views/qslprint/qslprint.php index 7b347030..a9dbd0f9 100644 --- a/application/views/qslprint/qslprint.php +++ b/application/views/qslprint/qslprint.php @@ -13,9 +13,10 @@ if (empty($station_id)) { } if ($qsos->result() != NULL) { - echo ' + echo '
+ @@ -25,7 +26,7 @@ if ($qsos->result() != NULL) { - +'; @@ -41,6 +42,7 @@ if ($qsos->result() != NULL) { foreach ($qsos->result() as $qsl) { echo ''; + echo ''; echo ''; echo ''; echo ''; @@ -57,11 +59,15 @@ if ($qsos->result() != NULL) { echo '
'.lang('gen_hamradio_callsign').' ' . lang('general_word_date') . ' '. lang('general_word_time') .'' . lang('gen_hamradio_station') . ' Sent method Mark as sentDeleteRemove QSO List
' . $qsl->COL_CALL . ''; $timestamp = strtotime($qsl->COL_TIME_ON); echo date($custom_date_format, $timestamp); echo ''; $timestamp = strtotime($qsl->COL_TIME_ON); echo date('H:i', $timestamp); echo '
'; ?> -

Export requested QSLs to CSV-file

+

-

Export requested QSLs to ADIF-file

+

-

Mark requested QSLs as sent

+

Export requested QSLs to CSV-file + + Export requested QSLs to ADIF-file + + Mark requested QSLs as sent

+ +
+ + + + + + + + session->userdata('user_column1')=='Frequency' || $this->session->userdata('user_column2')=='Frequency' || $this->session->userdata('user_column3')=='Frequency' || $this->session->userdata('user_column4')=='Frequency' || $this->session->userdata('user_column5')=='Frequency') { + echo ''; + } else { + echo ''; + } + ?> + + + session->userdata('user_date_format')) { + // If Logged in and session exists + $custom_date_format = $this->session->userdata('user_date_format'); + } else { + // Get Default date format from /config/cloudlog.php + $custom_date_format = $this->config->item('qso_date_format'); + } + + $i = 0; + if($query != false) { + foreach ($query->result() as $row) { + echo ''; + echo ' + + + + + COL_SAT_NAME != null) { ?> + + session->userdata('user_column1')=='Frequency' || $this->session->userdata('user_column2')=='Frequency' || $this->session->userdata('user_column3')=='Frequency' || $this->session->userdata('user_column4')=='Frequency' || $this->session->userdata('user_column5')=='Frequency') { + echo ''; + } else { + echo ''; + } + } ?> + + +
/'.lang('gen_hamradio_frequency').''.lang('gen_hamradio_band').'
'; + $timestamp = strtotime($row->COL_TIME_ON); + echo date($custom_date_format, $timestamp); + echo date(' H:i',strtotime($row->COL_TIME_ON)); + ?> + + COL_CALL)); ?> + COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE; ?>COL_RST_SENT; ?>COL_RST_RCVD; ?>COL_SAT_NAME; ?>'; + if ($row->COL_FREQ != null) { + echo $this->frequency->hz_to_mhz($row->COL_FREQ); + } else { + echo $row->COL_BAND; + } + echo ''.$row->COL_BAND.'
+
+
\ No newline at end of file diff --git a/application/views/qso/index.php b/application/views/qso/index.php index 0624e8ab..93ccd14d 100755 --- a/application/views/qso/index.php +++ b/application/views/qso/index.php @@ -502,13 +502,13 @@
- -
+
diff --git a/application/views/view_log/index.php b/application/views/view_log/index.php index 10f459cc..fceaeff4 100644 --- a/application/views/view_log/index.php +++ b/application/views/view_log/index.php @@ -1,11 +1,14 @@ + +

- -
logbooks_model->find_name($this->session->userdata('active_station_logbook')); ?> stations->find_name(); ?>
- - - session->flashdata('notice')) { ?>
'; echo ''; echo ''; - echo ''; + echo ''; echo ''; } } diff --git a/assets/css/general.css b/assets/css/general.css index 50f6f767..a4705e96 100644 --- a/assets/css/general.css +++ b/assets/css/general.css @@ -507,4 +507,12 @@ div#station_logbooks_linked_table_paginate { .highcharts-data-table tr:hover { background: #f1f7ff; +} + +#radio_cat_state { + margin-bottom: 10px; +} + +.previous-qsos table { + margin-bottom: 0px; } \ No newline at end of file diff --git a/assets/js/sections/common.js b/assets/js/sections/common.js index 030a298f..265f27f1 100644 --- a/assets/js/sections/common.js +++ b/assets/js/sections/common.js @@ -152,8 +152,8 @@ function qso_edit(id) { $('#locator').change(function(){ if ($(this).val().length >= 4) { - $('#locator_info').load("logbook/searchbearing/" + $(this).val() + "/" + $('#stationProfile').val()).fadeIn("slow"); - $.get('logbook/searchdistance/' + $(this).val() + "/" + $('#stationProfile').val(), function(result) { + $('#locator_info').load(base_url + "index.php/logbook/searchbearing/" + $(this).val() + "/" + $('#stationProfile').val()).fadeIn("slow"); + $.get(base_url + 'index.php/logbook/searchdistance/' + $(this).val() + "/" + $('#stationProfile').val(), function(result) { document.getElementById("distance").value = result; }); } diff --git a/assets/js/sections/cqmap.js b/assets/js/sections/cqmap.js index 1e688830..dba3eed4 100644 --- a/assets/js/sections/cqmap.js +++ b/assets/js/sections/cqmap.js @@ -190,5 +190,5 @@ function load_cq_map2(data) { function onClick(e) { var marker = e.target; - displayContacts(marker.options.title, $('#band2').val(), $('#mode').val(), 'CQZone'); + displayContactsOnMap($("#cqmap"),marker.options.title, $('#band2').val(), $('#mode').val(), 'CQZone'); } diff --git a/assets/js/sections/dxccmap.js b/assets/js/sections/dxccmap.js index 8a8a9f8f..73bde64e 100644 --- a/assets/js/sections/dxccmap.js +++ b/assets/js/sections/dxccmap.js @@ -155,5 +155,5 @@ function addMarker(L, D, mapColor, map) { function onClick(e) { var marker = e.target; - displayContacts(marker.options.adif, $('#band2').val(), $('#mode').val(), 'DXCC2'); + displayContactsOnMap($("#dxccmap"),marker.options.adif, $('#band2').val(), $('#mode').val(), 'DXCC2'); } diff --git a/assets/js/sections/hrdlog.js b/assets/js/sections/hrdlog.js index 9679c50a..59180622 100644 --- a/assets/js/sections/hrdlog.js +++ b/assets/js/sections/hrdlog.js @@ -17,16 +17,16 @@ function ExportHrd(station_id) { if ($(".errormessages").length > 0) { $(".errormessages").remove(); } - $(".ld-ext-right").addClass('running'); - $(".ld-ext-right").prop('disabled', true); + $(".ld-ext-right-"+station_id).addClass('running'); + $(".ld-ext-right-"+station_id).prop('disabled', true); $.ajax({ url: base_url + 'index.php/hrdlog/upload_station', type: 'post', data: {'station_id': station_id}, success: function (data) { - $(".ld-ext-right").removeClass('running'); - $(".ld-ext-right").prop('disabled', false); + $(".ld-ext-right-"+station_id).removeClass('running'); + $(".ld-ext-right-"+station_id).prop('disabled', false); if (data.status == 'OK') { $.each(data.info, function(index, value){ $('#modcount'+value.station_id).html(value.modcount); diff --git a/assets/js/sections/iotamap.js b/assets/js/sections/iotamap.js index 5c579387..9df3a054 100644 --- a/assets/js/sections/iotamap.js +++ b/assets/js/sections/iotamap.js @@ -169,5 +169,5 @@ function addMarker(L, D, mapColor, map) { function onClick(e) { var marker = e.target; - displayContacts(marker.options.iota, $('#band2').val(), $('#mode').val(), 'IOTA'); + displayContactsOnMap($("#iotamap"), marker.options.iota,$('#band2').val(), $('#mode').val(), 'IOTA'); } diff --git a/assets/js/sections/logbookadvanced.js b/assets/js/sections/logbookadvanced.js index 90a27663..6b393de5 100644 --- a/assets/js/sections/logbookadvanced.js +++ b/assets/js/sections/logbookadvanced.js @@ -197,6 +197,7 @@ $(document).ready(function () { sota: this.sota.value, pota: this.pota.value, wwff: this.wwff.value, + qslimages: this.qslimages.value, }, dataType: 'json', success: function (data) { @@ -287,7 +288,10 @@ $(document).ready(function () { $('#deleteQsos').prop("disabled", false); }) } - } + }, + onhide: function(dialogRef){ + $('#deleteQsos').prop("disabled", false); + }, }); }); @@ -408,6 +412,49 @@ $(document).ready(function () { quickSearch('pota'); }); + $('#qslSlideshow').click(function (event) { + var elements = $('#qsoList tbody input:checked'); + var nElements = elements.length; + if (nElements == 0) { + return; + } + $('#qslSlideshow').prop("disabled", true); + var id_list=[]; + elements.each(function() { + let id = $(this).first().closest('tr').data('qsoID') + id_list.push(id); + }); + $.ajax({ + url: base_url + 'index.php/logbookadvanced/qslSlideshow', + type: 'post', + data: { + ids: id_list, + }, + success: function (html) { + BootstrapDialog.show({ + title: 'QSL Card', + size: BootstrapDialog.SIZE_WIDE, + cssClass: 'lookup-dialog', + nl2br: false, + message: html, + onshown: function(dialog) { + + }, + buttons: [{ + label: 'Close', + action: function (dialogItself) { + $('#qslSlideshow').prop("disabled", false); + dialogItself.close(); + } + }], + onhide: function(dialogRef){ + $('#qslSlideshow').prop("disabled", false); + }, + }); + } + }); + }); + function quickSearch(type) { var elements = $('#qsoList tbody input:checked'); var nElements = elements.length; diff --git a/assets/js/sections/qrzlogbook.js b/assets/js/sections/qrzlogbook.js index 7d379ed5..d8a0f7aa 100644 --- a/assets/js/sections/qrzlogbook.js +++ b/assets/js/sections/qrzlogbook.js @@ -17,16 +17,16 @@ function ExportQrz(station_id) { if ($(".errormessages").length > 0) { $(".errormessages").remove(); } - $(".ld-ext-right").addClass('running'); - $(".ld-ext-right").prop('disabled', true); + $(".ld-ext-right-"+station_id).addClass('running'); + $(".ld-ext-right-"+station_id).prop('disabled', true); $.ajax({ url: base_url + 'index.php/qrz/upload_station', type: 'post', data: {'station_id': station_id}, success: function (data) { - $(".ld-ext-right").removeClass('running'); - $(".ld-ext-right").prop('disabled', false); + $(".ld-ext-right-"+station_id).removeClass('running'); + $(".ld-ext-right-"+station_id).prop('disabled', false); if (data.status == 'OK') { $.each(data.info, function(index, value){ $('#modcount'+value.station_id).html(value.modcount); diff --git a/assets/js/sections/qslprint.js b/assets/js/sections/qslprint.js index a9be815b..f55caa57 100644 --- a/assets/js/sections/qslprint.js +++ b/assets/js/sections/qslprint.js @@ -126,3 +126,91 @@ function mark_qsl_sent(id, method) { } }); } + +$('#checkBoxAll').change(function (event) { + if (this.checked) { + $('.qslprint tbody tr').each(function (i) { + $(this).closest('tr').addClass('activeRow'); + $(this).closest('tr').find("input[type=checkbox]").prop("checked", true); + }); + } else { + $('.qslprint tbody tr').each(function (i) { + $(this).closest('tr').removeClass('activeRow'); + $(this).closest('tr').find("input[type=checkbox]").prop("checked", false); + }); + } +}); + +$('.qslprint').on('click', 'input[type="checkbox"]', function() { + if ($(this).is(":checked")) { + $(this).closest('tr').addClass('activeRow'); + } else { + $(this).closest('tr').removeClass('activeRow'); + } +}); + +function markSelectedQsos() { + var elements = $('.qslprint tbody input:checked'); + var nElements = elements.length; + if (nElements == 0) { + return; + } + $('.markallprinted').prop("disabled", true); + var id_list=[]; + elements.each(function() { + let id = $(this).first().closest('tr').attr('id'); + id = id.match(/\d/g); + id = id.join(""); + id_list.push(id); + }); + $.ajax({ + url: base_url + 'index.php/logbookadvanced/update_qsl', + type: 'post', + data: {'id': JSON.stringify(id_list, null, 2), + 'sent' : 'Y', + 'method' : 'B' + }, + success: function(data) { + if (data !== []) { + $.each(data, function(k, v) { + $("#qslprint_"+this.qsoID).remove(); + }); + } + $('.markallprinted').prop("disabled", false); + } + }); +} + +function removeSelectedQsos() { + var elements = $('.qslprint tbody input:checked'); + var nElements = elements.length; + if (nElements == 0) { + return; + } + $('.removeall').prop("disabled", true); + + var id_list=[]; + elements.each(function() { + let id = $(this).first().closest('tr').attr('id'); + id = id.match(/\d/g); + id = id.join(""); + id_list.push(id); + }); + + $.ajax({ + url: base_url + 'index.php/logbookadvanced/update_qsl', + type: 'post', + data: {'id': JSON.stringify(id_list, null, 2), + 'sent' : 'N', + 'method' : '' + }, + success: function(data) { + if (data !== []) { + $.each(data, function(k, v) { + $("#qslprint_"+this.qsoID).remove(); + }); + } + $('.removeall').prop("disabled", false); + } + }); +} diff --git a/assets/js/sections/qso.js b/assets/js/sections/qso.js index 4efbb6a9..3ad082e5 100644 --- a/assets/js/sections/qso.js +++ b/assets/js/sections/qso.js @@ -307,7 +307,7 @@ $(document).on('change', 'input', function(){ function changebadge(entityname) { if($("#sat_name" ).val() != "") { - $.getJSON('logbook/jsonlookupdxcc/' + convert_case(entityname) + '/SAT/0/0', function(result) + $.getJSON(base_url + 'index.php/logbook/jsonlookupdxcc/' + convert_case(entityname) + '/SAT/0/0', function(result) { $('#callsign_info').removeClass("badge-secondary"); @@ -327,7 +327,7 @@ function changebadge(entityname) { } }) } else { - $.getJSON('logbook/jsonlookupdxcc/' + convert_case(entityname) + '/0/' + $("#band").val() +'/' + $("#mode").val(), function(result) + $.getJSON(base_url + 'index.php/logbook/jsonlookupdxcc/' + convert_case(entityname) + '/0/' + $("#band").val() +'/' + $("#mode").val(), function(result) { // Reset CSS values before updating $('#callsign_info').removeClass("badge-secondary"); @@ -426,7 +426,7 @@ $("#callsign").focusout(function() { find_callsign.replace(/\//g, "-"); // Replace / in a callsign with - to stop urls breaking - $.getJSON('logbook/json/' + find_callsign.replace(/\//g, "-") + '/' + sat_type + '/' + json_band + '/' + json_mode + '/' + $('#stationProfile').val(), function(result) + $.getJSON(base_url + 'index.php/logbook/json/' + find_callsign.replace(/\//g, "-") + '/' + sat_type + '/' + json_band + '/' + json_mode + '/' + $('#stationProfile').val(), function(result) { // Make sure the typed callsign and json result match @@ -441,7 +441,7 @@ $("#callsign").focusout(function() { if($("#sat_name" ).val() != "") { //logbook/jsonlookupgrid/io77/SAT/0/0 - $.getJSON('logbook/jsonlookupcallsign/' + find_callsign.replace(/\//g, "-") + '/SAT/0/0', function(result) + $.getJSON(base_url + 'index.php/logbook/jsonlookupcallsign/' + find_callsign.replace(/\//g, "-") + '/SAT/0/0', function(result) { // Reset CSS values before updating $('#callsign').removeClass("workedGrid"); @@ -460,7 +460,7 @@ $("#callsign").focusout(function() { } }) } else { - $.getJSON('logbook/jsonlookupcallsign/' + find_callsign.replace(/\//g, "-") + '/0/' + $("#band").val() +'/' + $("#mode").val(), function(result) + $.getJSON(base_url + 'index.php/logbook/jsonlookupcallsign/' + find_callsign.replace(/\//g, "-") + '/0/' + $("#band").val() +'/' + $("#mode").val(), function(result) { // Reset CSS values before updating $('#callsign').removeClass("workedGrid"); @@ -507,7 +507,7 @@ $("#callsign").focusout(function() { var $dok_select = $('#darc_dok').selectize(); var dok_selectize = $dok_select[0].selectize; if (result.dxcc.adif == '230') { - $.get('lookup/dok/' + $('#callsign').val().toUpperCase(), function(result) { + $.get(base_url + 'index.php/lookup/dok/' + $('#callsign').val().toUpperCase(), function(result) { if (result) { dok_selectize.addOption({name: result}); dok_selectize.setValue(result, false); @@ -634,7 +634,7 @@ $("#callsign").focusout(function() { // Only set the frequency when not set by userdata/PHP. if ($('#frequency').val() == "") { - $.get('qso/band_to_freq/' + $('#band').val() + '/' + $('.mode').val(), function(result) { + $.get(base_url + 'index.php/qso/band_to_freq/' + $('#band').val() + '/' + $('.mode').val(), function(result) { $('#frequency').val(result); $('#frequency_rx').val(""); }); @@ -663,7 +663,7 @@ $('#start_date').change(function() { /* on mode change */ $('.mode').change(function() { - $.get('qso/band_to_freq/' + $('#band').val() + '/' + $('.mode').val(), function(result) { + $.get(base_url + 'index.php/qso/band_to_freq/' + $('#band').val() + '/' + $('.mode').val(), function(result) { $('#frequency').val(result); $('#frequency_rx').val(""); }); @@ -672,7 +672,7 @@ $('.mode').change(function() { /* Calculate Frequency */ /* on band change */ $('#band').change(function() { - $.get('qso/band_to_freq/' + $(this).val() + '/' + $('.mode').val(), function(result) { + $.get(base_url + 'index.php/qso/band_to_freq/' + $(this).val() + '/' + $('.mode').val(), function(result) { $('#frequency').val(result); $('#frequency_rx').val(""); }); @@ -692,7 +692,7 @@ $("#locator").keyup(function(){ //logbook/jsonlookupgrid/io77/SAT/0/0 - $.getJSON('logbook/jsonlookupgrid/' + qra_lookup.toUpperCase() + '/SAT/0/0', function(result) + $.getJSON(base_url + 'index.php/logbook/jsonlookupgrid/' + qra_lookup.toUpperCase() + '/SAT/0/0', function(result) { // Reset CSS values before updating $('#locator').removeClass("workedGrid"); @@ -711,7 +711,7 @@ $("#locator").keyup(function(){ } }) } else { - $.getJSON('logbook/jsonlookupgrid/' + qra_lookup.toUpperCase() + '/0/' + $("#band").val() +'/' + $("#mode").val(), function(result) + $.getJSON(base_url + 'index.php/logbook/jsonlookupgrid/' + qra_lookup.toUpperCase() + '/0/' + $("#band").val() +'/' + $("#mode").val(), function(result) { // Reset CSS values before updating $('#locator').removeClass("workedGrid"); @@ -733,7 +733,7 @@ $("#locator").keyup(function(){ } if(qra_input.length >= 4 && $(this).val().length > 0) { - $.getJSON('logbook/qralatlngjson/' + $(this).val(), function(result) + $.getJSON(base_url + 'index.php/logbook/qralatlngjson/' + $(this).val(), function(result) { // Set Map to Lat/Long markers.clearLayers(); @@ -751,8 +751,8 @@ $("#locator").keyup(function(){ markers.addLayer(marker).addTo(mymap); }) - $('#locator_info').load("logbook/searchbearing/" + $(this).val() + "/" + $('#stationProfile').val()).fadeIn("slow"); - $.get('logbook/searchdistance/' + $(this).val() + "/" + $('#stationProfile').val(), function(result) { + $('#locator_info').load(base_url +"index.php/logbook/searchbearing/" + $(this).val() + "/" + $('#stationProfile').val()).fadeIn("slow"); + $.get(base_url + 'index.php/logbook/searchdistance/' + $(this).val() + "/" + $('#stationProfile').val(), function(result) { document.getElementById("distance").value = result; }); } @@ -772,7 +772,7 @@ function convert_case(str) { } $('#dxcc_id').on('change', function() { - $.getJSON('logbook/jsonentity/' + $(this).val(), function (result) { + $.getJSON(base_url + 'index.php/logbook/jsonentity/' + $(this).val(), function (result) { if (result.dxcc.name != undefined) { $('#country').val(convert_case(result.dxcc.name)); diff --git a/assets/js/sections/webadif.js b/assets/js/sections/webadif.js index 2687d11d..fb200dd1 100644 --- a/assets/js/sections/webadif.js +++ b/assets/js/sections/webadif.js @@ -29,16 +29,16 @@ function ExportWebADIF(station_id) { if ($(".errormessages").length > 0) { $(".errormessages").remove(); } - $(".ld-ext-right").addClass('running'); - $(".ld-ext-right").prop('disabled', true); + $(".ld-ext-right-"+station_id).addClass('running'); + $(".ld-ext-right-"+station_id).prop('disabled', true); $.ajax({ url: base_url + 'index.php/webadif/upload_station', type: 'post', data: {'station_id': station_id}, success: function (data) { - $(".ld-ext-right").removeClass('running'); - $(".ld-ext-right").prop('disabled', false); + $(".ld-ext-right-"+station_id).removeClass('running'); + $(".ld-ext-right-"+station_id).prop('disabled', false); if (data.status == 'OK') { $.each(data.info, function(index, value){ $('#notcount'+value.station_id).html(value.notcount); diff --git a/assets/json/satellite_data.json b/assets/json/satellite_data.json index 8f21974b..75d31420 100644 --- a/assets/json/satellite_data.json +++ b/assets/json/satellite_data.json @@ -281,7 +281,7 @@ }, "IO-117":{ "Modes":{ - "U":[ + "U/U":[ { "Uplink_Mode":"PKT", "Uplink_Freq":"435310000", @@ -303,6 +303,18 @@ ] } }, + "LEDSAT":{ + "Modes":{ + "U/U":[ + { + "Uplink_Mode":"PKT", + "Uplink_Freq":"435310000", + "Downlink_Mode":"PKT", + "Downlink_Freq":"435190000" + } + ] + } + }, "Lilacsat-1":{ "Modes":{ "V/U":[ diff --git a/docker/Dockerfile b/docker/Dockerfile index bee0e909..725bc2c6 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -13,18 +13,11 @@ RUN docker-php-ext-install mysqli mbstring xml RUN rm -rf /var/www/html/docker/ COPY ./ /var/www/html/ WORKDIR /var/www/html +# Setting permissions as: https://github.com/magicbug/Cloudlog/wiki/Installation RUN cd /var/www/html \ -&& echo "Setting root as owner of the folder..." \ -&& chown -R root:root /var/www/html \ -&& echo "Setting permissions to the install folder" \ -&& chown -R root:www-data ./application/config/ \ -&& chown -R root:www-data ./application/logs/ \ -&& chown -R root:www-data ./assets/qslcard/ \ -&& chown -R root:www-data ./backup/ \ -&& chown -R root:www-data ./updates/ \ -&& chown -R root:www-data ./uploads/ \ -&& chown -R root:www-data ./images/eqsl_card_images/ \ -&& chown -R root:www-data ./assets/json/ \ +&& echo "Setting root as owner of the html folder" \ +&& chown -R root:www-data /var/www/html +RUN echo "Setting permissions to the install folder" \ && chmod -R g+rw ./application/config/ \ && chmod -R g+rw ./application/logs/ \ && chmod -R g+rw ./assets/qslcard/ \ @@ -33,6 +26,4 @@ RUN cd /var/www/html \ && chmod -R g+rw ./uploads/ \ && chmod -R g+rw ./images/eqsl_card_images/ \ && chmod -R g+rw ./assets/json/ \ -&& chmod 777 /var/www/html/install \ -&& echo "Make sure everything is fine" \ -&& dir -ls +&& chmod -R 777 /var/www/html/install \ No newline at end of file diff --git a/install/includes/core_class.php b/install/includes/core_class.php index 37604e26..09cc9ee1 100644 --- a/install/includes/core_class.php +++ b/install/includes/core_class.php @@ -123,5 +123,4 @@ class Core { } } -?> - +?> \ No newline at end of file diff --git a/install/includes/database_class.php b/install/includes/database_class.php index 4cdc634c..b843862e 100644 --- a/install/includes/database_class.php +++ b/install/includes/database_class.php @@ -43,5 +43,4 @@ class Database { return true; } } -?> - +?> \ No newline at end of file diff --git a/install/index.php b/install/index.php index cc0e5d8b..1e65398d 100644 --- a/install/index.php +++ b/install/index.php @@ -7,13 +7,21 @@ $db_file_path = $db_config_path."database.php"; function delDir($dir) { $files = glob( $dir . '*', GLOB_MARK ); - foreach( $files as $file ){ - if( substr( $file, -1 ) == '/' ) - delDir( $file ); - else - unlink( $file ); + foreach ( $files as $file ) { + if ( substr( $file, -1 ) == '/' ) { + if (file_exists($file)) { + delDir( $file ); + } + } else { + if (file_exists($file)) { + unlink( $file ); + } + } } - rmdir( $dir ); + // This step may be not needed + if (file_exists($dir)) { + rmdir( $dir ); + } } if (file_exists($db_file_path)) { diff --git a/src/QSLManager/QSO.php b/src/QSLManager/QSO.php index 1db43ced..97c98d26 100644 --- a/src/QSLManager/QSO.php +++ b/src/QSLManager/QSO.php @@ -117,7 +117,6 @@ class QSO 'COL_STATE', 'COL_COUNTRY', 'COL_IOTA', - 'name' ]; @@ -196,16 +195,16 @@ class QSO $this->cqzone = ($data['COL_CQZ'] === null) ? '' : ''.$data['COL_CQZ'].''; $this->state = ($data['COL_STATE'] === null) ? '' :$data['COL_STATE']; - $this->dxcc = ($data['name'] === null) ? '- NONE -' : ''.ucwords(strtolower($data['name']), "- (/").''; + $this->dxcc = (($data['name'] ?? null) === null) ? '- NONE -' : ''.ucwords(strtolower($data['name']), "- (/").''; $this->iota = ($data['COL_IOTA'] === null) ? '' : $this->getIotaLink($data['COL_IOTA']); if (array_key_exists('end', $data)) { $this->end = ($data['end'] === null) ? null : DateTime::createFromFormat("Y-m-d", $data['end'], new DateTimeZone('UTC')); } else { $this->end = null; } - $this->callsign = ($data['callsign'] === null) ? '' :$data['callsign']; - $this->lastupload = ($data['lastupload'] === null) ? '' : date($custom_date_format . " H:i", strtotime($data['lastupload'])); - $this->lotw_hint = $this->getLotwHint($data['lastupload']); + $this->callsign = ($data['callsign'] ?? null === null) ? '' :$data['callsign']; + $this->lastupload = ($data['lastupload'] ?? null === null) ? '' : date($custom_date_format . " H:i", strtotime($data['lastupload'] ?? null)); + $this->lotw_hint = $this->getLotwHint($data['lastupload'] ?? null); } /** @@ -323,7 +322,7 @@ class QSO } } $qslstring .= '">▼'; - if ($data['qslcount'] != null) { + if ($data['qslcount'] ?? null != null) { $qslstring .= ' '; } return $qslstring;
' . $station->station_callsign . '' . $station->notcount . '' . $station->totcount . '