diff --git a/application/config/migration.php b/application/config/migration.php index 5acd6dbd9..e527bb97e 100644 --- a/application/config/migration.php +++ b/application/config/migration.php @@ -22,7 +22,7 @@ $config['migration_enabled'] = TRUE; | */ -$config['migration_version'] = 257; +$config['migration_version'] = 258; /* |-------------------------------------------------------------------------- diff --git a/application/migrations/258_adif_3_1_6.php b/application/migrations/258_adif_3_1_6.php new file mode 100644 index 000000000..bcb23abdd --- /dev/null +++ b/application/migrations/258_adif_3_1_6.php @@ -0,0 +1,91 @@ + "FSK", 'submode' => "SCAMP_FAST", 'qrgmode' => "DATA", 'active' => 1), + array('mode' => "FSK", 'submode' => "SCAMP_SLOW", 'qrgmode' => "DATA", 'active' => 1), + array('mode' => "FSK", 'submode' => "SCAMP_VSLOW", 'qrgmode' => "DATA", 'active' => 1), + array('mode' => "MTONE", 'submode' => "SCAMP_OO", 'qrgmode' => "DATA", 'active' => 1), + array('mode' => "MTONE", 'submode' => "SCAMP_OO_SLW", 'qrgmode' => "DATA", 'active' => 1), + ); + + foreach ($modes as $mode) { + $exists = $this->db->where('submode', $mode['submode']) + ->get('adif_modes') + ->num_rows() > 0; + + if (!$exists) { + $this->db->insert('adif_modes', $mode); + } + } + + // Add new contests from ADIF 3.1.6 specification + $contests = array( + array('name' => 'DARC CW Trainee Contest', 'adifname' => 'DARC-CWA', 'active' => 1), + array('name' => 'DARC 10m Contest', 'adifname' => 'DARC-10', 'active' => 1), + array('name' => 'DARC Trainee Contest', 'adifname' => 'DARC-TRAINEE', 'active' => 1), + array('name' => 'DARC Hell Contest', 'adifname' => 'DARC-HELL', 'active' => 1), + array('name' => 'DARC Microwave Contest', 'adifname' => 'DARC-MICROWAVE', 'active' => 1), + array('name' => 'DARC RTTY Short Contest', 'adifname' => 'ShortRY', 'active' => 1), + array('name' => 'DARC UKW Spring Contest', 'adifname' => 'DARC-UKW-SPRING', 'active' => 1), + array('name' => 'DARC UKW Field Day Contests', 'adifname' => 'DARC-UKW-FIELD-DAY', 'active' => 1), + array('name' => 'DARC VHF-, UHF-, Microwave Contest', 'adifname' => 'DARC-VHF-UHF-MICROWAVE', 'active' => 1), + array('name' => 'DARC Easter Contest', 'adifname' => 'EASTER', 'active' => 1), + array('name' => 'International Naval Contest (INC)', 'adifname' => 'NAVAL', 'active' => 1), + array('name' => 'ORARI Banggai DX Contest', 'adifname' => 'BANGGAI-DX', 'active' => 1), + array('name' => 'ORARI Bekasi Merdeka Contest', 'adifname' => 'BEKASI-MERDEKA-CONTEST', 'active' => 1), + array('name' => 'ORARI DX Contest', 'adifname' => 'ORARI-DX', 'active' => 1), + ); + + foreach ($contests as $contest) { + $exists = $this->db->where('adifname', $contest['adifname']) + ->get('contest') + ->num_rows() > 0; + + if (!$exists) { + $this->db->insert('contest', $contest); + } + } + } + + public function down() { + // remove the modes that were added in this migration + $mode_names = array( + 'SCAMP_FAST', + 'SCAMP_SLOW', + 'SCAMP_VSLOW', + 'SCAMP_OO', + 'SCAMP_OO_SLW' + ); + + $this->db->where_in('submode', $mode_names); + $this->db->delete('adif_modes'); + + // Remove the contests added in this migration + $contest_names = array( + 'DARC-CWA', + 'DARC-10', + 'DARC-TRAINEE', + 'DARC-HELL', + 'DARC-MICROWAVE', + 'ShortRY', + 'DARC-UKW-SPRING', + 'DARC-UKW-FIELD-DAY', + 'DARC-VHF-UHF-MICROWAVE', + 'EASTER', + 'NAVAL', + 'BANGGAI-DX', + 'BEKASI-MERDEKA-CONTEST', + 'ORARI-DX' + ); + + $this->db->where_in('adifname', $contest_names); + $this->db->delete('contest'); + } + +} diff --git a/application/views/adif/data/clublog.php b/application/views/adif/data/clublog.php index 83076d77c..2a2f786b9 100644 --- a/application/views/adif/data/clublog.php +++ b/application/views/adif/data/clublog.php @@ -1,5 +1,5 @@ Wavelog ADIF export -3.1.5 +3.1.6 config->item('app_name')); ?>>config->item('app_name')."\r\n"; ?> optionslib->get_option('version')); ?>>optionslib->get_option('version')."\r\n"; ?> diff --git a/application/views/adif/data/dcl.php b/application/views/adif/data/dcl.php index 83076d77c..2a2f786b9 100644 --- a/application/views/adif/data/dcl.php +++ b/application/views/adif/data/dcl.php @@ -1,5 +1,5 @@ Wavelog ADIF export -3.1.5 +3.1.6 config->item('app_name')); ?>>config->item('app_name')."\r\n"; ?> optionslib->get_option('version')); ?>>optionslib->get_option('version')."\r\n"; ?> diff --git a/application/views/adif/data/exportall.php b/application/views/adif/data/exportall.php index 76a4d6b0f..9f2b6b603 100644 --- a/application/views/adif/data/exportall.php +++ b/application/views/adif/data/exportall.php @@ -7,7 +7,7 @@ } ?> Wavelog ADIF export -3.1.5 +3.1.6 config->item('app_name')); ?>>config->item('app_name')."\r\n"; ?> optionslib->get_option('version')); ?>>optionslib->get_option('version')."\r\n"; ?> diff --git a/application/views/adif/data/exportsat.php b/application/views/adif/data/exportsat.php index b394fe6d4..acc3a863f 100644 --- a/application/views/adif/data/exportsat.php +++ b/application/views/adif/data/exportsat.php @@ -3,7 +3,7 @@ header('Content-Disposition: attachment; filename="'.$this->session->userdata('user_callsign').'-'.date('Ymd-Hi').'.adi"') ?> Wavelog ADIF export -3.1.5 +3.1.6 config->item('app_name')); ?>>config->item('app_name')."\r\n"; ?> optionslib->get_option('version')); ?>>optionslib->get_option('version')."\r\n"; ?> diff --git a/application/views/backup/exportall.php b/application/views/backup/exportall.php index 0b3184213..f9dfc90ef 100644 --- a/application/views/backup/exportall.php +++ b/application/views/backup/exportall.php @@ -1,5 +1,5 @@ Wavelog ADIF export -3.1.5 +3.1.6 config->item('app_name')); ?>>config->item('app_name')."\n"; ?> optionslib->get_option('version')); ?>>optionslib->get_option('version')."\r\n"; ?>