diff --git a/application/config/cloudlog.php b/application/config/cloudlog.php index be642888..b33bb906 100644 --- a/application/config/cloudlog.php +++ b/application/config/cloudlog.php @@ -75,4 +75,4 @@ $config['cat_timeout_interval'] = 300; $config['public_search'] = FALSE; -$config['callsign_tags'] = TRUE; \ No newline at end of file +$config['callsign_tags'] = TRUE; diff --git a/application/controllers/Qslprint.php b/application/controllers/Qslprint.php index 743a5803..b6bfab49 100644 --- a/application/controllers/Qslprint.php +++ b/application/controllers/Qslprint.php @@ -54,7 +54,8 @@ class QSLPrint extends CI_Controller { // file creation $file = fopen('php://output', 'w'); - $header = array("COL_CALL", + $header = array("STATION_CALLSIGN", + "COL_CALL", "COL_QSL_VIA", "COL_TIME_ON", "COL_MODE", @@ -72,7 +73,8 @@ class QSLPrint extends CI_Controller { foreach ($myData->result() as $qso) { fputcsv($file, - array(str_replace("0", "Ø", $qso->COL_CALL), + array($qso->STATION_CALLSIGN, + str_replace("0", "Ø", $qso->COL_CALL), $qso->COL_QSL_VIA!=""?"Via ".str_replace("0", "Ø", $qso->COL_QSL_VIA):"", $qso->COL_TIME_ON, $qso->COL_MODE, diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 1b80ac30..0824cc6e 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -404,7 +404,8 @@ class Logbook_model extends CI_Model { // Set Paper to recived - function paperqsl_update($qso_id, $method) { + function paperqsl_update($qso_id, $method) { + $data = array( 'COL_QSLRDATE' => date('Y-m-d'), 'COL_QSL_RCVD' => 'Y', @@ -417,7 +418,34 @@ class Logbook_model extends CI_Model { } function get_qsos_for_printing() { - $query = $this->db->query('SELECT COL_PRIMARY_KEY, COL_CALL, COL_QSL_VIA, COL_TIME_ON, COL_MODE, COL_FREQ, UPPER(COL_BAND) as COL_BAND, COL_RST_SENT, COL_SAT_NAME, COL_SAT_MODE, COL_QSL_RCVD, (CASE WHEN COL_QSL_VIA != \'\' THEN COL_QSL_VIA ELSE COL_CALL END) AS COL_ROUTING, ADIF, ENTITY FROM '.$this->config->item('table_name').', dxcc_prefixes WHERE COL_QSL_SENT LIKE \'R\' and (CASE WHEN COL_QSL_VIA != \'\' THEN COL_QSL_VIA ELSE COL_CALL END) like CONCAT(dxcc_prefixes.call,\'%\') and (end is null or end > now()) ORDER BY adif, col_routing'); + $CI =& get_instance(); + $CI->load->model('Stations'); + $station_id = $CI->Stations->find_active(); + + $query = $this->db->query('SELECT + STATION_CALLSIGN, + COL_PRIMARY_KEY, + COL_CALL, + COL_QSL_VIA, + COL_TIME_ON, + COL_MODE, + COL_FREQ, + UPPER(COL_BAND) as COL_BAND, + COL_RST_SENT, + COL_SAT_NAME, + COL_SAT_MODE, + COL_QSL_RCVD, + (CASE WHEN COL_QSL_VIA != \'\' THEN COL_QSL_VIA ELSE COL_CALL END) AS COL_ROUTING, + ADIF, + ENTITY + FROM '.$this->config->item('table_name').', dxcc_prefixes, station_profile + WHERE + COL_QSL_SENT LIKE \'R\' + and (CASE WHEN COL_QSL_VIA != \'\' THEN COL_QSL_VIA ELSE COL_CALL END) like CONCAT(dxcc_prefixes.call,\'%\') + and (end is null or end > now()) + and '.$this->config->item('table_name').'.station_id = '.$station_id.' + and '.$this->config->item('table_name').'.station_id = station_profile.station_id + ORDER BY adif, col_routing'); return $query; } diff --git a/application/models/Qslprint_model.php b/application/models/Qslprint_model.php index 92db5c31..736c0c61 100644 --- a/application/models/Qslprint_model.php +++ b/application/models/Qslprint_model.php @@ -8,6 +8,10 @@ class Qslprint_model extends CI_Model { } function mark_qsos_printed() { + $CI =& get_instance(); + $CI->load->model('Stations'); + $station_id = $CI->Stations->find_active(); + $data = array( 'COL_QSLSDATE' => date('Y-m-d'), 'COL_QSL_SENT' => "Y", @@ -15,6 +19,7 @@ class Qslprint_model extends CI_Model { ); $this->db->where("COL_QSL_SENT", "R"); + $this->db->where("station_id", $station_id); $this->db->update($this->config->item('table_name'), $data); } } diff --git a/application/views/qslprint/index.php b/application/views/qslprint/index.php index 3878af86..077344b3 100644 --- a/application/views/qslprint/index.php +++ b/application/views/qslprint/index.php @@ -16,7 +16,7 @@

- Here you can export requested QSLs as CSV-file or ADIF and mark them as sent via buro in a mass transaction if you like. + Here you can export requested QSLs as CSV-file or ADIF and mark them as sent via buro in a mass transaction if you like. The considered QSOs for this functions would be those of the active station profile.