Add fields for continent and update function
这个提交包含在:
		
							父节点
							
								
									20178df2c0
								
							
						
					
					
						当前提交
						72c2853fc6
					
				
					共有  9 个文件被更改,包括 121 次插入 和 0 次删除
				
			
		|  | @ -238,6 +238,11 @@ class Update extends CI_Controller { | |||
| 
 | ||||
| 	} | ||||
| 	 | ||||
| 	public function check_missing_continent() { | ||||
| 		$this->load->model('logbook_model'); | ||||
| 		$this->logbook_model->check_missing_continent(); | ||||
| 	} | ||||
| 
 | ||||
| 	public function check_missing_grid($all = false){ | ||||
| 	    $this->load->model('logbook_model'); | ||||
|         $this->logbook_model->check_missing_grid_id($all); | ||||
|  |  | |||
|  | @ -94,6 +94,7 @@ $lang['gen_hamradio_logbook'] = 'Logbook'; | |||
| 
 | ||||
| $lang['gen_hamradio_cq_zone'] = 'CQ Zone'; | ||||
| $lang['gen_hamradio_dxcc'] = 'DXCC'; | ||||
| $lang['gen_hamradio_continent'] = 'Continent'; | ||||
| $lang['gen_hamradio_usa_state'] = 'USA State'; | ||||
| $lang['gen_hamradio_county_reference'] = 'USA County'; | ||||
| $lang['gen_hamradio_iota_reference'] = 'IOTA Reference'; | ||||
|  | @ -125,3 +126,11 @@ $lang['gen_this_qso_was_confirmed_on'] = 'This QSO was confirmed on'; | |||
| $lang['error_no_logbook_found'] = 'No logbooks were found. You need to define a logbook under Station Logbooks! Do it here:'; | ||||
| 
 | ||||
| $lang['copy_to_clipboard'] = 'Copy to clipboard'; | ||||
| 
 | ||||
| $lang['africa'] = 'Africa'; | ||||
| $lang['antarctica'] = 'Antarctica'; | ||||
| $lang['asia'] = 'Asia'; | ||||
| $lang['europe'] = 'Europe'; | ||||
| $lang['northamerica'] = 'North America'; | ||||
| $lang['oceania'] = 'Oceania'; | ||||
| $lang['southamerica'] = 'South America'; | ||||
|  |  | |||
|  | @ -94,6 +94,7 @@ $lang['gen_hamradio_logbook'] = 'Logbuch'; | |||
| 
 | ||||
| $lang['gen_hamradio_cq_zone'] = 'CQ Zone'; | ||||
| $lang['gen_hamradio_dxcc'] = 'DXCC'; | ||||
| $lang['gen_hamradio_continent'] = 'Kontinent'; | ||||
| $lang['gen_hamradio_usa_state'] = 'USA-Staat'; | ||||
| $lang['gen_hamradio_county_reference'] = 'USA County'; | ||||
| $lang['gen_hamradio_iota_reference'] = 'IOTA Referenznummer'; | ||||
|  | @ -124,3 +125,11 @@ $lang['gen_from_date'] = 'Ab Datum'; | |||
| $lang['gen_this_qso_was_confirmed_on'] = 'Dieses QSO wurde bestätigt am'; | ||||
| 
 | ||||
| $lang['copy_to_clipboard'] = 'In die Zwischenablage kopieren'; | ||||
| 
 | ||||
| $lang['africa'] = 'Afrika'; | ||||
| $lang['antarctica'] = 'Antarktis'; | ||||
| $lang['asia'] = 'Asien'; | ||||
| $lang['europe'] = 'Europa'; | ||||
| $lang['northamerica'] = 'Nord-Amerika'; | ||||
| $lang['oceania'] = 'Ozeanien'; | ||||
| $lang['southamerica'] = 'Süd-Amerika'; | ||||
|  |  | |||
|  | @ -78,6 +78,19 @@ class Logbook_model extends CI_Model { | |||
|         $dxcc_id = $this->input->post('dxcc_id'); | ||||
|     } | ||||
| 
 | ||||
|     if($this->input->post('continent') == "") { | ||||
| 
 | ||||
|       $dxcc = $this->check_dxcc_table(strtoupper(trim($this->input->post('callsign'))), $datetime); | ||||
|       if (empty($dxcc[3])) { | ||||
|         $continent = null; | ||||
|       } else { | ||||
|        $continent = $dxcc[3]; | ||||
|       } | ||||
| 
 | ||||
|     } else { | ||||
|         $continent = $this->input->post('continent'); | ||||
|     } | ||||
| 
 | ||||
|     $mode = $this->get_main_mode_if_submode($this->input->post('mode')); | ||||
|     if ($mode == null) { | ||||
|         $mode = $this->input->post('mode'); | ||||
|  | @ -139,6 +152,7 @@ class Logbook_model extends CI_Model { | |||
|             'COL_SAT_NAME' => strtoupper($this->input->post('sat_name')), | ||||
|             'COL_SAT_MODE' => strtoupper($this->input->post('sat_mode')), | ||||
|             'COL_COUNTRY' => $country, | ||||
|             'COL_CONT' => $continent, | ||||
|             'COL_QSLSDATE' => $qslsdate, | ||||
|             'COL_QSLRDATE' => $qslrdate, | ||||
|             'COL_QSL_SENT' => $qsl_sent, | ||||
|  | @ -785,6 +799,7 @@ class Logbook_model extends CI_Model { | |||
|        'COL_COMMENT' => $this->input->post('comment'), | ||||
|        'COL_NAME' => $this->input->post('name'), | ||||
|        'COL_COUNTRY' => $country, | ||||
|        'COL_CONT' => $this->input->post('continent'), | ||||
|        'COL_DXCC'=> $this->input->post('dxcc_id'), | ||||
|        'COL_CQZ' => $this->input->post('cqz'), | ||||
|        'COL_SAT_NAME' => $this->input->post('sat_name'), | ||||
|  | @ -2960,6 +2975,7 @@ class Logbook_model extends CI_Model { | |||
|           $row['adif'] = 0; | ||||
|           $row['entity'] = 'None'; | ||||
|           $row['cqz'] = 0; | ||||
|           $row['cont'] = ''; | ||||
|           return array($row['adif'], $row['entity'], $row['cqz']); | ||||
|         } else { | ||||
|           $call = $result . "AA"; | ||||
|  | @ -3288,6 +3304,16 @@ class Logbook_model extends CI_Model { | |||
|         print("$count updated\n"); | ||||
|     } | ||||
| 
 | ||||
|     public function check_missing_continent(){ | ||||
|        // get all records with no COL_CONT
 | ||||
|        $this->db->trans_start(); | ||||
|        $sql = "UPDATE ".$this->config->item('table_name')." JOIN dxcc_entities ON ".$this->config->item('table_name').".col_dxcc = dxcc_entities.adif SET col_cont = dxcc_entities.cont WHERE COALESCE(".$this->config->item('table_name').".col_cont, '') = ''"; | ||||
| 
 | ||||
|         $query = $this->db->query($sql); | ||||
|         print($this->db->affected_rows()." updated\n"); | ||||
|         $this->db->trans_complete(); | ||||
|     } | ||||
| 
 | ||||
| 	public function check_missing_grid_id($all){ | ||||
|         // get all records with no COL_GRIDSQUARE
 | ||||
|         $this->db->select("COL_PRIMARY_KEY, COL_CALL, COL_TIME_ON, COL_TIME_OFF"); | ||||
|  |  | |||
|  | @ -215,6 +215,8 @@ | |||
| 
 | ||||
|                                     <input type="hidden" class="form-control" id="country" name="country" value="<?php echo $qso->COL_COUNTRY; ?>"> | ||||
| 
 | ||||
|                                 </div> | ||||
|                                 <div class="form-row"> | ||||
|                                     <div class="form-group col-sm-6"> | ||||
|                                         <label for="dxcc_id">DXCC</label> | ||||
|                                         <select class="custom-select" id="dxcc_id" name="dxcc_id" required> | ||||
|  | @ -231,6 +233,19 @@ | |||
| 
 | ||||
|                                         </select> | ||||
|                                     </div> | ||||
|                                     <div class="form-group col-sm-6"> | ||||
|                                         <label for="continent"><?php echo $this->lang->line('gen_hamradio_continent'); ?></label>
 | ||||
|                                         <select class="custom-select" id="continent" name="continent"> | ||||
|                                             <option value=""></option> | ||||
|                                             <option value="AF" <?php if($qso->COL_CONT == "AF") { echo "selected=\"selected\""; } ?>><?php echo $this->lang->line('africa'); ?></option>
 | ||||
|                                             <option value="AN" <?php if($qso->COL_CONT == "AN") { echo "selected=\"selected\""; } ?>><?php echo $this->lang->line('antarctica'); ?></option>
 | ||||
|                                             <option value="AS" <?php if($qso->COL_CONT == "AS") { echo "selected=\"selected\""; } ?>><?php echo $this->lang->line('asia'); ?></option>
 | ||||
|                                             <option value="EU" <?php if($qso->COL_CONT == "EU") { echo "selected=\"selected\""; } ?>><?php echo $this->lang->line('europe'); ?></option>
 | ||||
|                                             <option value="NA" <?php if($qso->COL_CONT == "NA") { echo "selected=\"selected\""; } ?>><?php echo $this->lang->line('northamerica'); ?></option>
 | ||||
|                                             <option value="OC" <?php if($qso->COL_CONT == "OC") { echo "selected=\"selected\""; } ?>><?php echo $this->lang->line('oceania'); ?></option>
 | ||||
|                                             <option value="SA" <?php if($qso->COL_CONT == "SA") { echo "selected=\"selected\""; } ?>><?php echo $this->lang->line('southamerica'); ?></option>
 | ||||
|                                         </select> | ||||
|                                     </div> | ||||
|                                 </div> | ||||
| 
 | ||||
|                             </div> | ||||
|  |  | |||
|  | @ -222,6 +222,19 @@ | |||
| 
 | ||||
|                   </select> | ||||
|               </div> | ||||
|               <div class="form-group"> | ||||
|                   <label for="continent"><?php echo $this->lang->line('gen_hamradio_continent'); ?></label>
 | ||||
|                   <select class="custom-select" id="continent" name="continent"> | ||||
|                       <option value=""></option> | ||||
|                       <option value="AF"><?php echo $this->lang->line('africa'); ?></option>
 | ||||
|                       <option value="AN"><?php echo $this->lang->line('antarctica'); ?></option>
 | ||||
|                       <option value="AS"><?php echo $this->lang->line('asia'); ?></option>
 | ||||
|                       <option value="EU"><?php echo $this->lang->line('europe'); ?></option>
 | ||||
|                       <option value="NA"><?php echo $this->lang->line('northamerica'); ?></option>
 | ||||
|                       <option value="OC"><?php echo $this->lang->line('oceania'); ?></option>
 | ||||
|                       <option value="SA"><?php echo $this->lang->line('southamerica'); ?></option>
 | ||||
|                   </select> | ||||
|               </div> | ||||
|               <div class="form-group"> | ||||
|                   <label for="cqz"><?php echo $this->lang->line('gen_hamradio_cq_zone'); ?></label>
 | ||||
|                   <select class="custom-select" id="cqz" name="cqz" required> | ||||
|  |  | |||
|  | @ -30,6 +30,11 @@ | |||
| 				<p><a class="btn btn-primary" href="<?php echo site_url('update/check_missing_dxcc');?>">Check QSOs missing DXCC data</a></p> | ||||
| 				<p><a class="btn btn-primary" href="<?php echo site_url('update/check_missing_dxcc/all');?>">Re-check all QSOs in logbook</a></p> | ||||
| 
 | ||||
| 				<h5>Apply Continent Data to Logbook</h5> | ||||
| 				<p class="card-text"> | ||||
| 					This function can be used to update QSO continent information for all QSOs in Cloudlog missing that information. | ||||
| 				</p> | ||||
| 				<p><a class="btn btn-primary" href="<?php echo site_url('update/check_missing_continent');?>">Check QSOs missing continent data</a></p> | ||||
| 				<style> | ||||
| 					#dxcc_update_status{
 | ||||
| 					display: None; | ||||
|  |  | |||
|  | @ -188,6 +188,39 @@ | |||
|                     </tr> | ||||
|                     <?php } ?>
 | ||||
| 
 | ||||
|                     <?php if($row->COL_CONT != null) { ?>
 | ||||
|                     <tr> | ||||
|                         <td><?php echo $this->lang->line('gen_hamradio_continent'); ?></td>
 | ||||
|                         <td> | ||||
|                         <?php | ||||
|                            switch($row->COL_CONT) { | ||||
|                              case "AF": | ||||
|                                echo $this->lang->line('africa'); | ||||
|                                break; | ||||
|                              case "AN": | ||||
|                                echo $this->lang->line('antarctica'); | ||||
|                                break; | ||||
|                              case "AS": | ||||
|                                echo $this->lang->line('asia'); | ||||
|                                break; | ||||
|                              case "EU": | ||||
|                                echo $this->lang->line('europe'); | ||||
|                                break; | ||||
|                              case "NA": | ||||
|                                echo $this->lang->line('northamerica'); | ||||
|                                break; | ||||
|                              case "OC": | ||||
|                                echo $this->lang->line('oceania'); | ||||
|                                break; | ||||
|                              case "SA": | ||||
|                                echo $this->lang->line('southamerica'); | ||||
|                                break; | ||||
|                            } | ||||
|                         ?>
 | ||||
|                         </td> | ||||
|                     </tr> | ||||
|                     <?php } ?>
 | ||||
| 
 | ||||
|                     <?php if($row->COL_CONTEST_ID != null) { ?>
 | ||||
|                     <tr> | ||||
|                         <td><?php echo $this->lang->line('contesting_contest_name'); ?></td>
 | ||||
|  |  | |||
|  | @ -327,6 +327,7 @@ function reset_fields() { | |||
| 
 | ||||
| 	$('#locator_info').text(""); | ||||
| 	$('#country').val(""); | ||||
| 	$('#continent').val(""); | ||||
| 	$('#lotw_info').text(""); | ||||
| 	$('#qrz_info').text(""); | ||||
| 	$('#hamqth_info').text(""); | ||||
|  | @ -536,6 +537,10 @@ $("#callsign").focusout(function() { | |||
| 					$('#name').val(result.callsign_name); | ||||
| 				} | ||||
| 
 | ||||
| 				if($('#continent').val() == "") { | ||||
| 					$('#continent').val(result.dxcc.cont); | ||||
| 				} | ||||
| 
 | ||||
| 				if($('#qth').val() == "") { | ||||
| 					$('#qth').val(result.callsign_qth); | ||||
| 				} | ||||
|  | @ -772,6 +777,7 @@ function resetDefaultQSOFields() { | |||
| 	$('#callsign_info').text(""); | ||||
| 	$('#locator_info').text(""); | ||||
| 	$('#country').val(""); | ||||
| 	$('#continent').val(""); | ||||
| 	$('#dxcc_id').val(""); | ||||
| 	$('#cqz').val(""); | ||||
| 	$('#name').val(""); | ||||
|  |  | |||
		正在加载…
	
		在新工单中引用