From 7c2c6cf4f0593129ebe6607cea8eab3cce362456 Mon Sep 17 00:00:00 2001 From: Jeremy Brown Date: Wed, 11 Nov 2020 18:42:32 -0500 Subject: [PATCH] Checks to see if eithere the name and gridsquare is set on import, and if neithere is not set, it will do the lookup. If both are set in the adi for import, no lookup will be done. --- application/models/Logbook_model.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index b2c9678e..6092fddb 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -1793,11 +1793,16 @@ class Logbook_model extends CI_Model { // if we are doing lookups and grid square and name aren't set, do the lookup now - $callbook = $this->loadCallBook(strtoupper($record['call'])); - if (isset($callbook)) { - $record['name']= $callbook['name']; - if (empty($record['gridsquare'])) { - $record['gridsquare'] = $callbook['gridsquare']; + if ((empty($record['name'])) || empty($record['gridsquare'])) { + $callbook = $this->loadCallBook(strtoupper($record['call']), $this->config->item('use_fullname')); + if (isset($callbook)) { + if (empty($record['name'])) { + $record['name'] = $callbook['name']; + } + + if (empty($record['gridsquare'])) { + $record['gridsquare'] = $callbook['gridsquare']; + } } }