diff --git a/application/controllers/Adif.php b/application/controllers/Adif.php index 5b72a561d..fa9277253 100644 --- a/application/controllers/Adif.php +++ b/application/controllers/Adif.php @@ -214,7 +214,9 @@ class adif extends CI_Controller { } if (!($stopnow)) { - $this->load->library('adif_parser'); + if (!$this->load->is_loaded('adif_parser')) { + $this->load->library('adif_parser'); + } $this->adif_parser->load_from_file('./uploads/'.$p_adif); unlink('./uploads/'.$p_adif); @@ -293,7 +295,9 @@ class adif extends CI_Controller { $this->load->model('logbook_model'); - $this->load->library('adif_parser'); + if (!$this->load->is_loaded('adif_parser')) { + $this->load->library('adif_parser'); + } $this->adif_parser->load_from_file('./uploads/'.$data['upload_data']['file_name']); diff --git a/application/controllers/Api.php b/application/controllers/Api.php index 3112c808e..f0ba2f1b5 100644 --- a/application/controllers/Api.php +++ b/application/controllers/Api.php @@ -200,7 +200,9 @@ class API extends CI_Controller { $this->load->model('logbook_model'); // Load ADIF Parser - $this->load->library('adif_parser'); + if (!$this->load->is_loaded('adif_parser')) { + $this->load->library('adif_parser'); + } // Feed in the ADIF string $this->adif_parser->feed($obj['string']); diff --git a/application/controllers/Lotw.php b/application/controllers/Lotw.php index d69bf4c18..3e1ab4793 100644 --- a/application/controllers/Lotw.php +++ b/application/controllers/Lotw.php @@ -479,7 +479,9 @@ class Lotw extends CI_Controller { ini_set('memory_limit', '-1'); set_time_limit(0); - $this->load->library('adif_parser'); + if (!$this->load->is_loaded('adif_parser')) { + $this->load->library('adif_parser'); + } $this->adif_parser->load_from_file($filepath); diff --git a/application/controllers/Qrz.php b/application/controllers/Qrz.php index 965489808..fcf82a63b 100644 --- a/application/controllers/Qrz.php +++ b/application/controllers/Qrz.php @@ -113,7 +113,9 @@ class Qrz extends CI_Controller { $data['qsos'] = $this->logbook_model->get_qrz_qsos($station_id, $trusted); $errormessages=array(); - $this->load->library('AdifHelper'); + if (!$this->load->is_loaded('AdifHelper')) { + $this->load->library('AdifHelper'); + } if ($data['qsos']) { foreach ($data['qsos']->result() as $qso) { @@ -368,7 +370,9 @@ class Qrz extends CI_Controller { ini_set('memory_limit', '-1'); set_time_limit(0); - $this->load->library('adif_parser'); + if (!$this->load->is_loaded('adif_parser')) { + $this->load->library('adif_parser'); + } $this->adif_parser->load_from_file($filepath); diff --git a/application/controllers/Webadif.php b/application/controllers/Webadif.php index b3781adbd..dc1d1bcf0 100644 --- a/application/controllers/Webadif.php +++ b/application/controllers/Webadif.php @@ -51,7 +51,9 @@ class Webadif extends CI_Controller { $data['qsos'] = $this->logbook_model->get_webadif_qsos($station_id, null, null, $trusted); $errormessages=array(); - $this->load->library('AdifHelper'); + if (!$this->load->is_loaded('AdifHelper')) { + $this->load->library('AdifHelper'); + } if ($data['qsos']) { foreach ($data['qsos']->result() as $qso) { diff --git a/application/models/Clublog_model.php b/application/models/Clublog_model.php index 26fcd0022..34bc8c94d 100644 --- a/application/models/Clublog_model.php +++ b/application/models/Clublog_model.php @@ -26,7 +26,9 @@ class Clublog_model extends CI_Model error_reporting(E_ALL); $this->load->helper('file'); - $this->load->library('AdifHelper'); + if (!$this->load->is_loaded('AdifHelper')) { + $this->load->library('AdifHelper'); + } $station_profiles = $this->all_with_count($clean_userid); diff --git a/application/models/Hrdlog_model.php b/application/models/Hrdlog_model.php index 6e44ea47b..fe0bb3a01 100644 --- a/application/models/Hrdlog_model.php +++ b/application/models/Hrdlog_model.php @@ -51,7 +51,9 @@ class Hrdlog_model extends CI_Model { $data['qsos'] = $this->logbook_model->get_hrdlog_qsos($station_id); $errormessages = array(); - $this->load->library('AdifHelper'); + if (!$this->load->is_loaded('AdifHelper')) { + $this->load->library('AdifHelper'); + } if ($data['qsos']) { foreach ($data['qsos']->result() as $qso) { diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index a62c2689b..3ad463f09 100644 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -738,7 +738,9 @@ class Logbook_model extends CI_Model { $result = $this->exists_clublog_credentials($data['station_id']); if (isset($result->ucp) && isset($result->ucn) && (($result->ucp ?? '') != '') && (($result->ucn ?? '') != '') && ($result->clublogrealtime == 1)) { - $this->load->library('AdifHelper'); + if (!$this->load->is_loaded('AdifHelper')) { + $this->load->library('AdifHelper'); + } $qso = $this->get_qso($last_id,true)->result(); $adif = $this->adifhelper->getAdifLine($qso[0]); @@ -752,7 +754,9 @@ class Logbook_model extends CI_Model { $result = $this->exists_hrdlog_credentials($data['station_id']); // Push qso to hrdlog if code is set, and realtime upload is enabled, and we're not importing an adif-file if (isset($result->hrdlog_code) && isset($result->hrdlog_username) && $result->hrdlogrealtime == 1) { - $this->load->library('AdifHelper'); + if (!$this->load->is_loaded('AdifHelper')) { + $this->load->library('AdifHelper'); + } $qso = $this->get_qso($last_id,true)->result(); $adif = $this->adifhelper->getAdifLine($qso[0]); @@ -765,7 +769,9 @@ class Logbook_model extends CI_Model { $result = $this->exists_qrz_api_key($data['station_id']); // Push qso to qrz if apikey is set, and realtime upload is enabled, and we're not importing an adif-file if (isset($result->qrzapikey) && $result->qrzrealtime == 1) { - $this->load->library('AdifHelper'); + if (!$this->load->is_loaded('AdifHelper')) { + $this->load->library('AdifHelper'); + } $qso = $this->get_qso($last_id,true)->result(); $adif = $this->adifhelper->getAdifLine($qso[0]); @@ -778,7 +784,9 @@ class Logbook_model extends CI_Model { $result = $this->exists_webadif_api_key($data['station_id']); // Push qso to webadif if apikey is set, and realtime upload is enabled, and we're not importing an adif-file if (isset($result->webadifapikey) && $result->webadifrealtime == 1) { - $this->load->library('AdifHelper'); + if (!$this->load->is_loaded('AdifHelper')) { + $this->load->library('AdifHelper'); + } $qso = $this->get_qso($last_id,true)->result(); $adif = $this->adifhelper->getAdifLine($qso[0]); diff --git a/application/views/adif/data/exportall.php b/application/views/adif/data/exportall.php index 28a74e4d7..4be715d73 100644 --- a/application/views/adif/data/exportall.php +++ b/application/views/adif/data/exportall.php @@ -14,7 +14,9 @@ Wavelog ADIF export load->library('AdifHelper'); +if (!$CI->load->is_loaded('AdifHelper')) { + $CI->load->library('AdifHelper'); +} foreach ($qsos->result() as $qso) { echo $CI->adifhelper->getAdifLine($qso); diff --git a/application/views/adif/data/exportsat.php b/application/views/adif/data/exportsat.php index 13120f148..acd7cd05f 100644 --- a/application/views/adif/data/exportsat.php +++ b/application/views/adif/data/exportsat.php @@ -10,7 +10,9 @@ Wavelog ADIF export load->library('AdifHelper'); +if (!$CI->load->is_loaded('AdifHelper')) { + $CI->load->library('AdifHelper'); +} foreach ($qsos->result() as $qso) { echo $CI->adifhelper->getAdifLine($qso); diff --git a/application/views/backup/exportall.php b/application/views/backup/exportall.php index 456bdf101..ec7555b2a 100644 --- a/application/views/backup/exportall.php +++ b/application/views/backup/exportall.php @@ -6,7 +6,9 @@ Wavelog ADIF export load->library('AdifHelper'); +if (!$CI->load->is_loaded('AdifHelper')) { + $CI->load->library('AdifHelper'); +} foreach ($qsos->result() as $qso) { echo $CI->adifhelper->getAdifLine($qso);