Trying to get full names working correctly

这个提交包含在:
Jeremy Brown 2020-11-11 12:18:37 -05:00
父节点 593db48556
当前提交 4064418942
共有 3 个文件被更改,包括 24 次插入11 次删除

查看文件

@ -122,7 +122,7 @@ class Logbook extends CI_Controller {
$measurement_base = $this->session->userdata('user_measurement_base'); $measurement_base = $this->session->userdata('user_measurement_base');
} }
$return['callsign_name'] = $this->logbook_model->call_name($callsign); $return['callsign_name'] = $this->logbook_model->call_name($callsign);
$return['callsign_qra'] = $this->logbook_model->call_qra($callsign); $return['callsign_qra'] = $this->logbook_model->call_qra($callsign);
$return['callsign_qth'] = $this->logbook_model->call_qth($callsign); $return['callsign_qth'] = $this->logbook_model->call_qth($callsign);
$return['callsign_iota'] = $this->logbook_model->call_iota($callsign); $return['callsign_iota'] = $this->logbook_model->call_iota($callsign);
@ -138,7 +138,8 @@ class Logbook extends CI_Controller {
return; return;
} }
$callbook = $this->logbook_model->loadCallBook($callsign);
$callbook = $this->logbook_model->loadCallBook($callsign, $this->config->item('personal'));
if (isset($callbook)) if (isset($callbook))
@ -490,8 +491,8 @@ class Logbook extends CI_Controller {
$qrz_session_key = $this->qrz->session($this->config->item('qrz_username'), $this->config->item('qrz_password')); $qrz_session_key = $this->qrz->session($this->config->item('qrz_username'), $this->config->item('qrz_password'));
$this->session->set_userdata('qrz_session_key', $qrz_session_key); $this->session->set_userdata('qrz_session_key', $qrz_session_key);
} }
echo("Part 1: ". (int)$this->config->item('personal'));
$data['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key')); $data['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key'), $this->config->item('personal'));
} }
// There's no hamli integration? Disabled for now. // There's no hamli integration? Disabled for now.
@ -544,11 +545,11 @@ class Logbook extends CI_Controller {
$this->load->library('qrz'); $this->load->library('qrz');
if(!$this->session->userdata('qrz_session_key')) { if(!$this->session->userdata('qrz_session_key')) {
$qrz_session_key = $this->qrz->session($this->config->item('qrz_username'), $this->config->item('qrz_password')); $qrz_session_key = $this->qrz->session($this->config->item('qrz_username'));
$this->session->set_userdata('qrz_session_key', $qrz_session_key); $this->session->set_userdata('qrz_session_key', $qrz_session_key);
} }
echo ("Part 2: ". $this->config->item('personal'). "<br/>");
$data['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key')); $data['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key'), $this->config->item('qrz_password'), $this->config->item('personal'));
} else { } else {
// Lookup using hamli // Lookup using hamli
$this->load->library('hamli'); $this->load->library('hamli');

查看文件

@ -54,8 +54,11 @@ class Qrz {
} }
public function search($callsign, $key) public function search($callsign, $key, $private="dog")
{ {
echo("Callsign: ".$callsign."<br/>");
echo("key: ".$key."<br/>");
echo("FOOOOOO: ". $private."<br/>");
$data = null; $data = null;
try { try {
// URL to the XML Source // URL to the XML Source
@ -75,7 +78,12 @@ class Qrz {
// Return Required Fields // Return Required Fields
$data['callsign'] = (string)$xml->Callsign->call; $data['callsign'] = (string)$xml->Callsign->call;
$data['name'] = (string)$xml->Callsign->fname . ' ' . (string)$xml->Callsign->name;
if ($private === true) {
$data['name'] = (string)$xml->Callsign->fname . ' AAAA ' . (string)$xml->Callsign->name;
} else {
$data['name'] = (string)$xml->Callsign->fname;
}
$data['gridsquare'] = (string)$xml->Callsign->grid; $data['gridsquare'] = (string)$xml->Callsign->grid;
$data['city'] = (string)$xml->Callsign->addr2; $data['city'] = (string)$xml->Callsign->addr2;
$data['lat'] = (string)$xml->Callsign->lat; $data['lat'] = (string)$xml->Callsign->lat;

查看文件

@ -2168,7 +2168,7 @@ class Logbook_model extends CI_Model {
} }
} }
public function loadCallBook($callsign) public function loadCallBook($callsign, $personal=false)
{ {
$callbook = null; $callbook = null;
try { try {
@ -2181,7 +2181,11 @@ class Logbook_model extends CI_Model {
$this->session->set_userdata('qrz_session_key', $qrz_session_key); $this->session->set_userdata('qrz_session_key', $qrz_session_key);
} }
$callbook = $this->qrz->search($callsign, $this->session->userdata('qrz_session_key'));
$personal = "foo";
echo ("part 3: ". $personal. "<br/>");
$callbook = $this->qrz->search($callsign, $this->session->userdata('qrz_session_key'), $this->config->item('qrz_password'), "foobar");
echo ("part 4: ". $personal. "<br/>");
} }
if ($this->config->item('callbook') == "hamqth" && $this->config->item('hamqth_username') != null && $this->config->item('hamqth_password') != null) { if ($this->config->item('callbook') == "hamqth" && $this->config->item('hamqth_username') != null && $this->config->item('hamqth_password') != null) {