diff --git a/application/controllers/Logbook.php b/application/controllers/Logbook.php index 456254bd..abf00390 100755 --- a/application/controllers/Logbook.php +++ b/application/controllers/Logbook.php @@ -151,7 +151,7 @@ class Logbook extends CI_Controller { $return['callsign_state'] = $this->logbook_model->call_state($callsign); $return['bearing'] = $this->bearing($return['callsign_qra'], $measurement_base, $station_id); $return['workedBefore'] = $this->worked_grid_before($return['callsign_qra'], $type, $band, $mode); - if ($this->config->item('show_qrz_image')) { + if ($this->session->userdata('user_show_qrz_image')) { if (isset($callbook)) { if ($callbook['image'] == "") { $return['image'] = "n/a"; @@ -179,7 +179,7 @@ class Logbook extends CI_Controller { $return['callsign_iota'] = $callbook['iota']; $return['callsign_state'] = $callbook['state']; $return['callsign_us_county'] = $callbook['us_county']; - if ($this->config->item('show_qrz_image')) { + if ($this->session->userdata('user_show_qrz_image')) { if ($callbook['image'] == "") { $return['image'] = "n/a"; } else { diff --git a/application/controllers/User.php b/application/controllers/User.php index dbb48912..a2de73ce 100644 --- a/application/controllers/User.php +++ b/application/controllers/User.php @@ -74,6 +74,7 @@ class User extends CI_Controller { $data['user_column3'] = $this->input->post('user_column3'); $data['user_column4'] = $this->input->post('user_column4'); $data['user_column5'] = $this->input->post('user_column5'); + $data['user_show_qrz_image'] = $this->input->post('user_show_qrz_image'); $this->load->view('user/add', $data); } else { $this->load->view('user/add', $data); @@ -100,7 +101,8 @@ class User extends CI_Controller { $this->input->post('user_column2'), $this->input->post('user_column3'), $this->input->post('user_column4'), - $this->input->post('user_column5'))) { + $this->input->post('user_column5'), + $this->input->post('user_show_qrz_image'))) { // Check for errors case EUSERNAMEEXISTS: $data['username_error'] = 'Username '.$this->input->post('user_name').' already in use!'; @@ -137,6 +139,7 @@ class User extends CI_Controller { $data['user_column3'] = $this->input->post('user_column3'); $data['user_column4'] = $this->input->post('user_column4'); $data['user_column5'] = $this->input->post('user_column5'); + $data['user_show_qrz_image'] = $this->input->post('user_show_qrz_image'); $this->load->view('user/add', $data); $this->load->view('interface_assets/footer'); } @@ -308,6 +311,12 @@ class User extends CI_Controller { $data['user_show_notes'] = $q->user_show_notes; } + if($this->input->post('user_show_qrz_image')) { + $data['user_show_qrz_image'] = $this->input->post('user_show_qrz_image', false); + } else { + $data['user_show_qrz_image'] = $q->user_show_qrz_image; + } + if($this->input->post('user_column1')) { $data['user_column1'] = $this->input->post('user_column1', true); } else { @@ -387,6 +396,7 @@ class User extends CI_Controller { $data['user_column4'] = $this->input->post('user_column4'); $data['user_column4'] = $this->input->post('user_column4'); $data['user_column5'] = $this->input->post('user_column5'); + $data['user_show_qrz_image'] = $this->input->post('user_show_qrz_image'); $this->load->view('user/edit'); $this->load->view('interface_assets/footer'); } @@ -599,4 +609,4 @@ class User extends CI_Controller { redirect('user/login'); } } -} \ No newline at end of file +} diff --git a/application/migrations/087_add_qrz_image_option.php b/application/migrations/087_add_qrz_image_option.php index f817c7b9..2abf6593 100644 --- a/application/migrations/087_add_qrz_image_option.php +++ b/application/migrations/087_add_qrz_image_option.php @@ -14,16 +14,16 @@ class Migration_add_qrz_image_option extends CI_Migration { public function up() { - if (!$this->db->field_exists('show_qrz_image', 'users')) { + if (!$this->db->field_exists('user_show_qrz_image', 'users')) { $fields = array( - 'show_qrz_image BOOLEAN DEFAULT FALSE', + 'user_show_qrz_image BOOLEAN DEFAULT FALSE', ); - $this->dbforge->add_column('users', $fields); + $this->dbforge->add_column('users', $fields, 'user_column5'); } } public function down() { - $this->dbforge->drop_column('users', 'show_qrz_image'); + $this->dbforge->drop_column('users', 'user_show_qrz_image'); } } diff --git a/application/models/User_model.php b/application/models/User_model.php index 5f18f212..d9e2b360 100644 --- a/application/models/User_model.php +++ b/application/models/User_model.php @@ -113,7 +113,7 @@ class User_Model extends CI_Model { // Add a user function add($username, $password, $email, $type, $firstname, $lastname, $callsign, $locator, $timezone, $measurement, $user_date_format, $user_stylesheet, $user_sota_lookup, $user_show_notes, - $user_column1, $user_column2, $user_column3, $user_column4, $user_column5) { + $user_column1, $user_column2, $user_column3, $user_column4, $user_column5, $user_show_qrz_image) { // Check that the user isn't already used if(!$this->exists($username)) { $data = array( @@ -136,6 +136,7 @@ class User_Model extends CI_Model { 'user_column3' => xss_clean($user_column3), 'user_column4' => xss_clean($user_column4), 'user_column5' => xss_clean($user_column5), + 'user_show_qrz_image' => xss_clean($user_show_qrz_image), ); // Check the password is valid @@ -184,6 +185,7 @@ class User_Model extends CI_Model { 'user_column3' => xss_clean($fields['user_column3']), 'user_column4' => xss_clean($fields['user_column4']), 'user_column5' => xss_clean($fields['user_column5']), + 'user_show_qrz_image' => xss_clean($fields['user_show_qrz_image']), ); // Check to see if the user is allowed to change user levels @@ -293,6 +295,7 @@ class User_Model extends CI_Model { 'user_stylesheet' => $u->row()->user_stylesheet, 'user_sota_lookup' => isset($u->row()->user_sota_lookup) ? $u->row()->user_sota_lookup : 0, 'user_show_notes' => isset($u->row()->user_show_notes) ? $u->row()->user_show_notes : 1, + 'user_show_qrz_image' => isset($u->row()->user_show_qrz_image) ? $u->row()->user_show_qrz_image : 0, 'user_column1' => isset($u->row()->user_column1) ? $u->row()->user_column1: 'Mode', 'user_column2' => isset($u->row()->user_column2) ? $u->row()->user_column2: 'RSTS', 'user_column3' => isset($u->row()->user_column3) ? $u->row()->user_column3: 'RSTR', diff --git a/application/views/qso/index.php b/application/views/qso/index.php index c5c6ae19..c2019933 100755 --- a/application/views/qso/index.php +++ b/application/views/qso/index.php @@ -521,7 +521,7 @@
- config->item('show_qrz_image')) { ?> + session->userdata('user_show_qrz_image')) { ?> +
+ + +
Please set your qrz.com credentials in the station locations configuration (XML subscription required).
+
+ diff --git a/application/views/user/edit.php b/application/views/user/edit.php index d1c086de..c823f23b 100644 --- a/application/views/user/edit.php +++ b/application/views/user/edit.php @@ -414,6 +414,29 @@ +
+
+ +
+
+
+ qrz.com Images +
+
+
+ + +
Please set your qrz.com credentials in the station locations configuration (XML subscription required).
+
+ +
+
+
+ +