the QRZ.com Logbook settings page";
$lang['station_location_qrz_realtime_upload'] = 'QRZ.com Logbook Realtime Upload';
diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php
index 5bb57c37..c7ee44fa 100755
--- a/application/models/Logbook_model.php
+++ b/application/models/Logbook_model.php
@@ -260,6 +260,13 @@ class Logbook_model extends CI_Model {
$station = $this->check_station($station_id);
$data['station_id'] = $station_id;
+ // [eQSL default msg] add info to QSO for Contest or SFLE //
+ if (empty($data['COL_QSLMSG']) && (($this->input->post('isSFLE')==true) || (!empty($data['COL_CONTEST_ID'])))) {
+ $this->load->model('user_options_model');
+ $options_object = $this->user_options_model->get_options('eqsl_default_qslmsg',array('option_name'=>'key_station_id','option_key'=>$station_id))->result();
+ $data['COL_QSLMSG'] = (isset($options_object[0]->option_value))?$options_object[0]->option_value:'';
+ }
+
if (strpos(trim($station['station_gridsquare']), ',') !== false) {
$data['COL_MY_VUCC_GRIDS'] = strtoupper(trim($station['station_gridsquare']));
} else {
diff --git a/application/models/Stations.php b/application/models/Stations.php
index 6a51e018..49674824 100644
--- a/application/models/Stations.php
+++ b/application/models/Stations.php
@@ -114,8 +114,13 @@ class Stations extends CI_Model {
'webadifrealtime' => xss_clean($this->input->post('webadifrealtime', true)),
);
- // Insert Records
- $this->db->insert('station_profile', $data);
+ // Insert Records & return insert id //
+ if ($this->db->insert('station_profile', $data)===true) {
+ $station_user_list = $this->all_of_user()->result();
+ if ((count($station_user_list)>0) && (isset($station_user_list[intval(count($station_user_list)-1)]->station_id))) {
+ return $station_user_list[intval(count($station_user_list)-1)]->station_id;
+ }
+ }
}
function edit() {
diff --git a/application/models/User_options_model.php b/application/models/User_options_model.php
index 9a383338..71253ecd 100644
--- a/application/models/User_options_model.php
+++ b/application/models/User_options_model.php
@@ -16,16 +16,32 @@ class User_options_model extends CI_Model {
}
}
- public function get_options($option_type) {
+ public function get_options($option_type, $option_array=null) {
$uid=$this->session->userdata('user_id');
- $sql='select option_name,option_key,option_value from user_options where user_id=? and option_type=?';
- return $this->db->query($sql, array($uid, $option_type));
+ $sql_more = "";
+ $array_sql_value = array($uid, $option_type);
+ if (is_array($option_array)) {
+ foreach ($option_array as $key => $value) {
+ $sql_more .= ' and '.$key.'=?';
+ $array_sql_value[] = $value;
+ }
+ }
+ $sql='select option_name,option_key,option_value from user_options where user_id=? and option_type=?'.$sql_more;
+ return $this->db->query($sql, $array_sql_value);
}
- public function del_option($option_type, $option_name) {
+ public function del_option($option_type, $option_name, $option_array=null) {
$uid=$this->session->userdata('user_id');
- $sql='delete from user_options where user_id=? and option_type=? and option_name=?';
- return $this->db->query($sql, array($uid, $option_type,$option_name));
+ $sql_more = "";
+ $array_sql_value = array($uid, $option_type, $option_name);
+ if (is_array($option_array)) {
+ foreach ($option_array as $key => $value) {
+ $sql_more .= ' and '.$key.'=?';
+ $array_sql_value[] = $value;
+ }
+ }
+ $sql='delete from user_options where user_id=? and option_type=? and option_name=?'.$sql_more;
+ return $this->db->query($sql, $array_sql_value);
}
}
diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php
index a32a71a4..9c8c5fcb 100644
--- a/application/views/interface_assets/footer.php
+++ b/application/views/interface_assets/footer.php
@@ -1238,7 +1238,11 @@ $(document).on('keypress',function(e) {
$('#transmit_power').val('');
},
});
+ // [eQSL default msg] change value on change station profle //
+ qso_set_eqsl_qslmsg(stationProfile,false,'.qso_panel');
});
+ // [eQSL default msg] change value on clic //
+ $('.qso_panel .qso_eqsl_qslmsg_update').off('click').on('click',function() { qso_set_eqsl_qslmsg($('.qso_panel #stationProfile').val(),true,'.qso_panel'); });
session->userdata('user_qth_lookup') == 1) { ?>
$('#qth').focusout(function() {
diff --git a/application/views/qso/edit_ajax.php b/application/views/qso/edit_ajax.php
index 1236be47..3efde2b1 100644
--- a/application/views/qso/edit_ajax.php
+++ b/application/views/qso/edit_ajax.php
@@ -511,13 +511,14 @@
diff --git a/application/views/qso/index.php b/application/views/qso/index.php
index 3a581113..b6cbed4b 100755
--- a/application/views/qso/index.php
+++ b/application/views/qso/index.php
@@ -532,8 +532,9 @@
diff --git a/application/views/station_profile/create.php b/application/views/station_profile/create.php
index 4418fa0a..bcd2ff0b 100644
--- a/application/views/station_profile/create.php
+++ b/application/views/station_profile/create.php
@@ -249,6 +249,12 @@
+
+
+
+ 240.
+
+
+
+
+
+
+ 240.
+
diff --git a/assets/css/general.css b/assets/css/general.css
index faa7beab..18577b8b 100644
--- a/assets/css/general.css
+++ b/assets/css/general.css
@@ -624,3 +624,8 @@ table.dataTable tfoot td {
.orange {
color: var(--orange);
}
+
+.qso_eqsl_qslmsg_update {
+ cursor: pointer;
+ margin-left: 10px;
+}
\ No newline at end of file
diff --git a/assets/js/sections/common.js b/assets/js/sections/common.js
index 2072e293..123cb4a0 100644
--- a/assets/js/sections/common.js
+++ b/assets/js/sections/common.js
@@ -294,6 +294,9 @@ function qso_edit(id) {
});
}
});
+ // [eQSL default msg] change value (for qso edit page) //
+ $('.modal-content #stationProfile').change(function() { qso_set_eqsl_qslmsg($('.modal-content #stationProfile').val(),false,'.modal-content'); });
+ $('.modal-content .qso_eqsl_qslmsg_update').off('click').on('click',function() { qso_set_eqsl_qslmsg($('.modal-content #stationProfile').val(),true,'.modal-content'); });
},
});
}
@@ -543,3 +546,22 @@ function displayQsl(id) {
}
});
}
+
+
+// [eQSL default msg] function to load default qslmsg to qslmsg field on qso add/edit //
+function qso_set_eqsl_qslmsg(station_id, force_diff_to_origin=false, object='') {
+ $.ajax({
+ url: base_url+'index.php/station/get_options',
+ type: 'post', data: {'option_type':'eqsl_default_qslmsg','option_name':'key_station_id','option_key':station_id },
+ success: function(res) {
+ if (typeof res.eqsl_default_qslmsg !== "undefined") {
+ object = (object!='')?(object+' '):'';
+ if ((force_diff_to_origin) || ($(object+'#qslmsg').val()==$(object+'#qslmsg_hide').html())) {
+ $(object+'#qslmsg').val(res.eqsl_default_qslmsg);
+ $(object+'#qslmsg_hide').html(res.eqsl_default_qslmsg);
+ }
+ }
+ },
+ error: function() { },
+ });
+}
\ No newline at end of file
diff --git a/assets/js/sections/simplefle.js b/assets/js/sections/simplefle.js
index 534e4977..12f090bf 100644
--- a/assets/js/sections/simplefle.js
+++ b/assets/js/sections/simplefle.js
@@ -760,6 +760,7 @@ $(".js-save-to-log").click(function () {
iota_ref: iota_ref,
pota_ref: pota_ref,
wwff_ref: wwff_ref,
+ isSFLE: true
},
success: function (result) {},
});