From 59a3df06b69a1ba07a27956a2a8a01598253bb06 Mon Sep 17 00:00:00 2001 From: phl0 Date: Mon, 15 Aug 2022 16:57:37 +0200 Subject: [PATCH] Add DB column and edit/view functiions --- application/config/migration.php | 2 +- .../migrations/096_add_wwff_columns.php | 28 +++++++++++++++++++ application/models/Logbook_model.php | 3 ++ application/views/qso/edit_ajax.php | 2 +- application/views/view_log/qso.php | 7 +++++ 5 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 application/migrations/096_add_wwff_columns.php diff --git a/application/config/migration.php b/application/config/migration.php index bcbb0a02..af82de1b 100644 --- a/application/config/migration.php +++ b/application/config/migration.php @@ -21,7 +21,7 @@ $config['migration_enabled'] = TRUE; | be upgraded / downgraded to. | */ -$config['migration_version'] = 95; +$config['migration_version'] = 96; /* |-------------------------------------------------------------------------- diff --git a/application/migrations/096_add_wwff_columns.php b/application/migrations/096_add_wwff_columns.php new file mode 100644 index 00000000..bd1b8961 --- /dev/null +++ b/application/migrations/096_add_wwff_columns.php @@ -0,0 +1,28 @@ +db->field_exists('COL_WWFF_REF', 'TABLE_HRD_CONTACTS_V01')) { + $fields = array( + 'COL_WWFF_REF VARCHAR(30) DEFAULT NULL', + ); + $this->dbforge->add_column('TABLE_HRD_CONTACTS_V01', $fields, 'COL_VUCC_GRIDS'); + } + } + + public function down() + { + $this->dbforge->drop_column('TABLE_HRD_CONTACTS_V01', 'COL_WWFF_REF'); + } +} diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index f06cda11..be03dadf 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -177,6 +177,7 @@ class Logbook_model extends CI_Model { 'COL_STATE' => trim($this->input->post('usa_state')), 'COL_CNTY' => $clean_county_input, 'COL_SOTA_REF' => trim($this->input->post('sota_ref')), + 'COL_WWFF_REF' => trim($this->input->post('wwff_ref')), 'COL_SIG' => trim($this->input->post('sig')), 'COL_SIG_INFO' => trim($this->input->post('sig_info')), 'COL_DARC_DOK' => strtoupper(trim($darc_dok)), @@ -661,6 +662,7 @@ class Logbook_model extends CI_Model { 'COL_LOTW_QSL_RCVD' => $this->input->post('lotw_recv'), 'COL_IOTA' => $this->input->post('iota_ref'), 'COL_SOTA_REF' => $this->input->post('sota_ref'), + 'COL_WWFF_REF' => $this->input->post('wwff_ref'), 'COL_TX_PWR' => $txpower, 'COL_SIG' => $this->input->post('sig'), 'COL_SIG_INFO' => $this->input->post('sig_info'), @@ -2656,6 +2658,7 @@ class Logbook_model extends CI_Model { 'COL_SILENT_KEY' => (!empty($record['silent_key'])) ? $record['silent_key'] : '', 'COL_SKCC' => (!empty($record['skcc'])) ? $record['skcc'] : '', 'COL_SOTA_REF' => (!empty($record['sota_ref'])) ? $record['sota_ref'] : '', + 'COL_WWFF_REF' => (!empty($record['wwff_ref'])) ? $record['wwff_ref'] : '', 'COL_SRX' => (!empty($record['srx'])) ? $record['srx'] : null, 'COL_SRX_STRING' => (!empty($record['srx_string'])) ? $record['srx_string'] : '', 'COL_STATE' => (!empty($record['state'])) ? strtoupper($record['state']) : '', diff --git a/application/views/qso/edit_ajax.php b/application/views/qso/edit_ajax.php index a83fb359..25854cda 100644 --- a/application/views/qso/edit_ajax.php +++ b/application/views/qso/edit_ajax.php @@ -396,7 +396,7 @@
- +
diff --git a/application/views/view_log/qso.php b/application/views/view_log/qso.php index b5f1efd8..cffa4ceb 100644 --- a/application/views/view_log/qso.php +++ b/application/views/view_log/qso.php @@ -208,6 +208,13 @@ + COL_WWFF_REF != null) { ?> + + lang->line('gen_hamradio_wwff_reference'); ?> + COL_WWFF_REF; ?> + + + COL_SIG != null) { ?> lang->line('gen_hamradio_sig'); ?>