kopia lustrzana https://github.com/magicbug/Cloudlog
Add option to select previous QSL type
rodzic
37e24ebc7d
commit
08108b4638
|
@ -21,7 +21,7 @@ $config['migration_enabled'] = TRUE;
|
|||
| be upgraded / downgraded to.
|
||||
|
|
||||
*/
|
||||
$config['migration_version'] = 105;
|
||||
$config['migration_version'] = 106;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
|
@ -533,7 +533,20 @@ class Logbook extends CI_Controller {
|
|||
$html .= "<td>RST (R)</td>";
|
||||
$html .= "<td>Band</td>";
|
||||
$html .= "<td>Mode</td>";
|
||||
$html .= "<td>QSL</td>";
|
||||
switch($this->session->userdata('user_previous_qsl_type')) {
|
||||
case 0:
|
||||
$html .= "<td>".$this->lang->line('gen_hamradio_qsl')."</td>";
|
||||
break;
|
||||
case 1:
|
||||
$html .= "<td>".$this->lang->line('lotw_short')."</td>";
|
||||
break;
|
||||
case 2:
|
||||
$html .= "<td>".$this->lang->line('eqsl_short')."</td>";
|
||||
break;
|
||||
default:
|
||||
$html .= "<td>".$this->lang->line('gen_hamradio_qsl')."</td>";
|
||||
break;
|
||||
}
|
||||
$html .= "<td></td>";
|
||||
$html .= "</tr>";
|
||||
|
||||
|
@ -565,44 +578,88 @@ class Logbook extends CI_Controller {
|
|||
$html .= "<td>".$row->COL_MODE."</td>";
|
||||
else
|
||||
$html .= "<td>".$row->COL_SUBMODE."</td>";
|
||||
$html .= "<td class=\"qsl\">";
|
||||
$html .= "<span class=\"qsl-";
|
||||
switch ($row->COL_QSL_SENT) {
|
||||
case "Y":
|
||||
$html .= "green";
|
||||
break;
|
||||
case "Q":
|
||||
$html .= "yellow";
|
||||
break;
|
||||
case "R":
|
||||
$html .= "yellow";
|
||||
break;
|
||||
case "I":
|
||||
$html .= "grey";
|
||||
break;
|
||||
default:
|
||||
$html .= "red";
|
||||
if ($this->session->userdata('user_previous_qsl_type') == 1) {
|
||||
$html .= "<td class=\"lotw\">";
|
||||
$html .= "<span class=\"qsl-";
|
||||
switch ($row->COL_LOTW_QSL_SENT) {
|
||||
case "Y":
|
||||
$html .= "green";
|
||||
break;
|
||||
default:
|
||||
$html .= "red";
|
||||
}
|
||||
$html .= "\">▲</span>";
|
||||
$html .= "<span class=\"qsl-";
|
||||
switch ($row->COL_LOTW_QSL_RCVD) {
|
||||
case "Y":
|
||||
$html .= "green";
|
||||
break;
|
||||
default:
|
||||
$html .= "red";
|
||||
}
|
||||
$html .= "\">▼</span>";
|
||||
$html .= "</td>";
|
||||
} else if ($this->session->userdata('user_previous_qsl_type') == 2) {
|
||||
$html .= "<td class=\"eqsl\">";
|
||||
$html .= "<span class=\"qsl-";
|
||||
switch ($row->COL_EQSL_QSL_SENT) {
|
||||
case "Y":
|
||||
$html .= "green";
|
||||
break;
|
||||
default:
|
||||
$html .= "red";
|
||||
}
|
||||
$html .= "\">▲</span>";
|
||||
$html .= "<span class=\"qsl-";
|
||||
switch ($row->COL_EQSL_QSL_RCVD) {
|
||||
case "Y":
|
||||
$html .= "green";
|
||||
break;
|
||||
default:
|
||||
$html .= "red";
|
||||
}
|
||||
$html .= "\">▼</span>";
|
||||
$html .= "</td>";
|
||||
} else {
|
||||
$html .= "<td class=\"qsl\">";
|
||||
$html .= "<span class=\"qsl-";
|
||||
switch ($row->COL_QSL_SENT) {
|
||||
case "Y":
|
||||
$html .= "green";
|
||||
break;
|
||||
case "Q":
|
||||
$html .= "yellow";
|
||||
break;
|
||||
case "R":
|
||||
$html .= "yellow";
|
||||
break;
|
||||
case "I":
|
||||
$html .= "grey";
|
||||
break;
|
||||
default:
|
||||
$html .= "red";
|
||||
}
|
||||
$html .= "\">▲</span>";
|
||||
$html .= "<span class=\"qsl-";
|
||||
switch ($row->COL_QSL_RCVD) {
|
||||
case "Y":
|
||||
$html .= "green";
|
||||
break;
|
||||
case "Q":
|
||||
$html .= "yellow";
|
||||
break;
|
||||
case "R":
|
||||
$html .= "yellow";
|
||||
break;
|
||||
case "I":
|
||||
$html .= "grey";
|
||||
break;
|
||||
default:
|
||||
$html .= "red";
|
||||
}
|
||||
$html .= "\">▼</span>";
|
||||
$html .= "</td>";
|
||||
}
|
||||
$html .= "\">▲</span>";
|
||||
$html .= "<span class=\"qsl-";
|
||||
switch ($row->COL_QSL_RCVD) {
|
||||
case "Y":
|
||||
$html .= "green";
|
||||
break;
|
||||
case "Q":
|
||||
$html .= "yellow";
|
||||
break;
|
||||
case "R":
|
||||
$html .= "yellow";
|
||||
break;
|
||||
case "I":
|
||||
$html .= "grey";
|
||||
break;
|
||||
default:
|
||||
$html .= "red";
|
||||
}
|
||||
$html .= "\">▼</span>";
|
||||
$html .= "</td>";
|
||||
$html .= "<td><span class=\"badge badge-info\">".$row->station_callsign."</span></td>";
|
||||
$html .= "</tr>";
|
||||
}
|
||||
|
|
|
@ -9,6 +9,8 @@ class User extends CI_Controller {
|
|||
// Load language files
|
||||
$this->lang->load(array(
|
||||
'account',
|
||||
'lotw',
|
||||
'eqsl',
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -78,6 +80,7 @@ class User extends CI_Controller {
|
|||
$data['user_column4'] = $this->input->post('user_column4');
|
||||
$data['user_column5'] = $this->input->post('user_column5');
|
||||
$data['user_show_profile_image'] = $this->input->post('user_show_profile_image');
|
||||
$data['user_previous_qsl_type'] = $this->input->post('user_previous_qsl_type');
|
||||
$this->load->view('user/add', $data);
|
||||
} else {
|
||||
$this->load->view('user/add', $data);
|
||||
|
@ -107,7 +110,8 @@ class User extends CI_Controller {
|
|||
$this->input->post('user_column3'),
|
||||
$this->input->post('user_column4'),
|
||||
$this->input->post('user_column5'),
|
||||
$this->input->post('user_show_profile_image'))) {
|
||||
$this->input->post('user_show_profile_image'),
|
||||
$this->input->post('user_previous_qsl_type'))) {
|
||||
// Check for errors
|
||||
case EUSERNAMEEXISTS:
|
||||
$data['username_error'] = 'Username <b>'.$this->input->post('user_name').'</b> already in use!';
|
||||
|
@ -147,6 +151,7 @@ class User extends CI_Controller {
|
|||
$data['user_column4'] = $this->input->post('user_column4');
|
||||
$data['user_column5'] = $this->input->post('user_column5');
|
||||
$data['user_show_profile_image'] = $this->input->post('user_show_profile_image');
|
||||
$data['user_previous_qsl_type'] = $this->input->post('user_previous_qsl_type');
|
||||
$this->load->view('user/add', $data);
|
||||
$this->load->view('interface_assets/footer');
|
||||
}
|
||||
|
@ -336,6 +341,12 @@ class User extends CI_Controller {
|
|||
$data['user_show_profile_image'] = $q->user_show_profile_image;
|
||||
}
|
||||
|
||||
if($this->input->post('user_previous_qsl_type')) {
|
||||
$data['user_previous_qsl_type'] = $this->input->post('user_previous_qsl_type', false);
|
||||
} else {
|
||||
$data['user_previous_qsl_type'] = $q->user_previous_qsl_type;
|
||||
}
|
||||
|
||||
if($this->input->post('user_column1')) {
|
||||
$data['user_column1'] = $this->input->post('user_column1', true);
|
||||
} else {
|
||||
|
@ -418,6 +429,7 @@ class User extends CI_Controller {
|
|||
$data['user_column4'] = $this->input->post('user_column4');
|
||||
$data['user_column5'] = $this->input->post('user_column5');
|
||||
$data['user_show_profile_image'] = $this->input->post('user_show_profile_image');
|
||||
$data['user_previous_qsl_type'] = $this->input->post('user_previous_qsl_type');
|
||||
$this->load->view('user/edit');
|
||||
$this->load->view('interface_assets/footer');
|
||||
}
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
/*
|
||||
* This adds an option to select the QSL type for previous QSOs
|
||||
*/
|
||||
|
||||
class Migration_add_user_previous_qsl_type extends CI_Migration {
|
||||
|
||||
public function up()
|
||||
{
|
||||
if (!$this->db->field_exists('user_previous_qsl_type', 'users')) {
|
||||
$fields = array(
|
||||
'user_previous_qsl_type integer DEFAULT 0',
|
||||
);
|
||||
|
||||
$this->dbforge->add_column('users', $fields);
|
||||
}
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
if ($this->db->field_exists('user_previous_qsl_type', 'users')) {
|
||||
$this->dbforge->drop_column('users', 'user_previous_qsl_type');
|
||||
}
|
||||
}
|
||||
}
|
|
@ -114,7 +114,7 @@ class User_Model extends CI_Model {
|
|||
function add($username, $password, $email, $type, $firstname, $lastname, $callsign, $locator, $timezone,
|
||||
$measurement, $user_date_format, $user_stylesheet, $user_qth_lookup, $user_sota_lookup, $user_wwff_lookup,
|
||||
$user_show_notes, $user_column1, $user_column2, $user_column3, $user_column4, $user_column5,
|
||||
$user_show_profile_image) {
|
||||
$user_show_profile_image, $user_previous_qsl_type) {
|
||||
// Check that the user isn't already used
|
||||
if(!$this->exists($username)) {
|
||||
$data = array(
|
||||
|
@ -140,6 +140,7 @@ class User_Model extends CI_Model {
|
|||
'user_column4' => xss_clean($user_column4),
|
||||
'user_column5' => xss_clean($user_column5),
|
||||
'user_show_profile_image' => xss_clean($user_show_profile_image),
|
||||
'user_previous_qsl_type' => xss_clean($user_previous_qsl_type),
|
||||
);
|
||||
|
||||
// Check the password is valid
|
||||
|
@ -193,6 +194,7 @@ class User_Model extends CI_Model {
|
|||
'user_column4' => xss_clean($fields['user_column4']),
|
||||
'user_column5' => xss_clean($fields['user_column5']),
|
||||
'user_show_profile_image' => xss_clean($fields['user_show_profile_image']),
|
||||
'user_previous_qsl_type' => xss_clean($fields['user_previous_qsl_type']),
|
||||
);
|
||||
|
||||
// Check to see if the user is allowed to change user levels
|
||||
|
@ -310,6 +312,7 @@ class User_Model extends CI_Model {
|
|||
'user_column3' => isset($u->row()->user_column3) ? $u->row()->user_column3: 'RSTR',
|
||||
'user_column4' => isset($u->row()->user_column4) ? $u->row()->user_column4: 'Band',
|
||||
'user_column5' => isset($u->row()->user_column5) ? $u->row()->user_column5: 'Country',
|
||||
'user_previous_qsl_type' => isset($u->row()->user_previous_qsl_type) ? $u->row()->user_previous_qsl_type: 0,
|
||||
'active_station_logbook' => $u->row()->active_station_logbook,
|
||||
);
|
||||
|
||||
|
|
|
@ -247,6 +247,15 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="previousqsltype">Select the type of QSL to show in the previous QSOs section.</label>
|
||||
<select class="custom-select" id="previousqsltype" name="user_previous_qsl_type">
|
||||
<option value="0"><?php echo $this->lang->line('gen_hamradio_qsl'); ?></option>
|
||||
<option value="1"><?php echo $this->lang->line('lotw_short'); ?></option>
|
||||
<option value="2"><?php echo $this->lang->line('eqsl_short'); ?></option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="profileimages">Show profile picture of QSO partner from qrz.com/hamqth.com profile in the log QSO section.</label>
|
||||
<select class="custom-select" id="profileimages" name="user_show_profile_image">
|
||||
|
|
|
@ -436,6 +436,29 @@
|
|||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<!-- qrz.com Images -->
|
||||
<div class="col-md">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
Previous QSL Type
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label for="profileimages">Select the type of QSL to show in the previous QSOs section.</label>
|
||||
<select class="custom-select" id="previousqsltype" name="user_previous_qsl_type">
|
||||
<option value="0" <?php if ($user_previous_qsl_type == 0) { echo " selected =\"selected\""; } ?>><?php echo $this->lang->line('gen_hamradio_qsl'); ?></option>
|
||||
<option value="1" <?php if ($user_previous_qsl_type == 1) { echo " selected =\"selected\""; } ?>><?php echo $this->lang->line('lotw_short'); ?></option>
|
||||
<option value="2" <?php if ($user_previous_qsl_type == 2) { echo " selected =\"selected\""; } ?>><?php echo $this->lang->line('eqsl_short'); ?></option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<!-- qrz.com Images -->
|
||||
<div class="col-md">
|
||||
|
|
Ładowanie…
Reference in New Issue