Skip to content

Commit b955740

Browse files
authored
Merge pull request wavelog#2363 from HB9HIL/redundance
Redundancy "get_plaincall()" method
2 parents 24548f8 + a0663ea commit b955740

File tree

2 files changed

+2
-19
lines changed

2 files changed

+2
-19
lines changed

application/controllers/Logbook.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ function json($tempcallsign, $tempband, $tempmode, $tempstation_id = null, $date
145145

146146
$return['dxcc'] = $this->dxcheck($callsign,$date);
147147

148-
$lookupcall = $this->logbook_model->get_plaincall($callsign);
148+
$this->load->library('callbook');
149+
$lookupcall = $this->callbook->get_plaincall($callsign);
149150

150151
$callbook = $this->logbook_model->loadCallBook($callsign, $this->config->item('use_fullname'));
151152

application/models/Logbook_model.php

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5484,24 +5484,6 @@ public function check_for_station_id() {
54845484
}
54855485
}
54865486

5487-
function get_plaincall($callsign) {
5488-
$split_callsign = explode('/', $callsign);
5489-
if (count($split_callsign) == 1) { // case F0ABC --> return cel 0 //
5490-
$lookupcall = $split_callsign[0];
5491-
} else if (count($split_callsign) == 3) { // case EA/F0ABC/P --> return cel 1 //
5492-
$lookupcall = $split_callsign[1];
5493-
} else { // case F0ABC/P --> return cel 0 OR case EA/FOABC --> retunr 1 (normaly not exist) //
5494-
if (in_array(strtoupper($split_callsign[1]), array('P', 'M', 'MM', 'QRP', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'))) {
5495-
$lookupcall = $split_callsign[0];
5496-
} else if (strlen($split_callsign[1]) > 3) { // Last Element longer than 3 chars? Take that as call
5497-
$lookupcall = $split_callsign[1];
5498-
} else { // Last Element up to 3 Chars? Take first element as Call
5499-
$lookupcall = $split_callsign[0];
5500-
}
5501-
}
5502-
return $lookupcall;
5503-
}
5504-
55055487
public function loadCallBook($callsign, $use_fullname = false) {
55065488
$callbook = null;
55075489
try {

0 commit comments

Comments
 (0)