diff --git a/application/config/migration.php b/application/config/migration.php
index ed1cc07a..3441f9fa 100644
--- a/application/config/migration.php
+++ b/application/config/migration.php
@@ -22,7 +22,7 @@ $config['migration_enabled'] = TRUE;
|
*/
-$config['migration_version'] = 162;
+$config['migration_version'] = 163;
/*
|--------------------------------------------------------------------------
diff --git a/application/controllers/Adif.php b/application/controllers/Adif.php
index 55f8c8c3..533e8a10 100644
--- a/application/controllers/Adif.php
+++ b/application/controllers/Adif.php
@@ -183,7 +183,6 @@ class adif extends CI_Controller {
} else {
if ($this->stations->check_station_is_accessible($this->input->post('station_profile'))) {
$data = array('upload_data' => $this->upload->data());
-
ini_set('memory_limit', '-1');
set_time_limit(0);
@@ -192,6 +191,8 @@ class adif extends CI_Controller {
$this->load->library('adif_parser');
$this->adif_parser->load_from_file('./uploads/'.$data['upload_data']['file_name']);
+ unlink('./uploads/'.$data['upload_data']['file_name']);
+ $data['upload_data']=''; // free memory
$this->adif_parser->initialize();
$custom_errors = "";
@@ -202,14 +203,8 @@ class adif extends CI_Controller {
break;
};
array_push($alladif,$record);
- // $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."
";
- // }
};
- unlink('./uploads/'.$data['upload_data']['file_name']);
- $record='';
- $data='';
+ $record=''; // free memory
$custom_errors = $this->logbook_model->import_bulk($alladif, $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'));
} else {
$custom_errors='Station Profile not valid for User';
@@ -218,7 +213,7 @@ class adif extends CI_Controller {
$data['adif_errors'] = $custom_errors;
$data['skip_dupes'] = $this->input->post('skipDuplicate');
-
+ log_message("Error","Finished ADIF Import");
$data['page_title'] = "ADIF Imported";
$this->load->view('interface_assets/header', $data);
$this->load->view('adif/import_success');
diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php
index 47a76ee4..26a53d7f 100755
--- a/application/models/Logbook_model.php
+++ b/application/models/Logbook_model.php
@@ -3080,7 +3080,7 @@ function lotw_last_qsl_date($user_id) {
function import_bulk($records, $station_id = "0", $skipDuplicate = false, $markClublog = false, $markLotw = false, $dxccAdif = false, $markQrz = false, $markHrd = false,$skipexport = false, $operatorName = false, $apicall = false, $skipStationCheck = false) {
$custom_errors='';
foreach ($records as $record) {
- $one_error = $this->logbook_model->import($record, $station_id, $skipDuplicate, $markClublog, $markLotw,$dxccadif, $markQrz, $markHrd, $skipexport, $operatorName, $apicall, $skipStationCheck);
+ $one_error = $this->logbook_model->import($record, $station_id, $skipDuplicate, $markClublog, $markLotw,$dxccAdif, $markQrz, $markHrd, $skipexport, $operatorName, $apicall, $skipStationCheck);
if ($one_error != '') {
$custom_errors.=$one_error."
";
}
@@ -3097,13 +3097,12 @@ function lotw_last_qsl_date($user_id) {
*/
function import($record, $station_id = "0", $skipDuplicate = false, $markClublog = false, $markLotw = false, $dxccAdif = false, $markQrz = false, $markHrd = false,$skipexport = false, $operatorName = false, $apicall = false, $skipStationCheck = false) {
// be sure that station belongs to user
- $CI =& get_instance();
- $CI->load->model('stations');
- if (!$CI->stations->check_station_is_accessible($station_id) && $apicall == false ) {
+ $this->load->model('stations');
+ if (!$this->stations->check_station_is_accessible($station_id) && $apicall == false ) {
return 'Station not accessible
';
}
- $station_profile=$CI->stations->profile_clean($station_id);
+ $station_profile=$this->stations->profile_clean($station_id);
$station_profile_call=$station_profile->station_callsign;
if (($station_id !=0 ) && (!(isset($record['station_callsign'])))) {
@@ -3115,8 +3114,7 @@ function lotw_last_qsl_date($user_id) {
"
See the Cloudlog Wiki for hints about errors in ADIF files.";
}
- $CI =& get_instance();
- $CI->load->library('frequency');
+ $this->load->library('frequency');
$my_error = "";
// Join date+time
@@ -3198,7 +3196,7 @@ function lotw_last_qsl_date($user_id) {
} else {
if (isset($record['freq'])){
if($freq != "0") {
- $band = $CI->frequency->GetBand($freq);
+ $band = $this->frequency->GetBand($freq);
}
}
}
@@ -3208,7 +3206,7 @@ function lotw_last_qsl_date($user_id) {
} else {
if (isset($record['freq_rx'])){
if($freq != "0") {
- $band_rx = $CI->frequency->GetBand($freqRX);
+ $band_rx = $this->frequency->GetBand($freqRX);
}
} else {
$band_rx = "";
@@ -3434,9 +3432,8 @@ function lotw_last_qsl_date($user_id) {
// Get active station_id from station profile if one hasn't been provided
if($station_id == "" || $station_id == "0") {
- $CI =& get_instance();
- $CI->load->model('stations');
- $station_id = $CI->stations->find_active();
+ $this->load->model('stations');
+ $station_id = $this->stations->find_active();
}
// Check if QSO is already in the database
@@ -3692,10 +3689,9 @@ function lotw_last_qsl_date($user_id) {
}
function update_dok($record, $ignoreAmbiguous, $onlyConfirmed, $overwriteDok) {
- $CI =& get_instance();
- $CI->load->model('logbooks_model');
+ $this->load->model('logbooks_model');
$custom_date_format = $this->session->userdata('user_date_format');
- $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
+ $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
if(isset($record['call'])) {
$call = strtoupper($record['call']);
@@ -3712,7 +3708,7 @@ function lotw_last_qsl_date($user_id) {
} else {
if (isset($record['freq'])){
if($record['freq'] != "0") {
- $band = $CI->frequency->GetBand($record['freq']);
+ $band = $this->frequency->GetBand($record['freq']);
}
}
}