[QSO Entry] County can now be saved and changed when editing a QSO.
这个提交包含在:
		
							父节点
							
								
									7892846e8a
								
							
						
					
					
						当前提交
						44a1dd5691
					
				
					共有  4 个文件被更改,包括 68 次插入 和 1 次删除
				
			
		|  | @ -150,6 +150,7 @@ class Logbook_model extends CI_Model { | |||
|             'COL_DXCC' => $dxcc_id, | ||||
|             'COL_CQZ' => $cqz, | ||||
|             'COL_STATE' => trim($this->input->post('usa_state')), | ||||
|             'COL_USACA_COUNTIES' => trim($this->input->post('county')), | ||||
|             'COL_SOTA_REF' => trim($this->input->post('sota_ref')), | ||||
|             'COL_SIG' => trim($this->input->post('sig')), | ||||
|             'COL_SIG_INFO' => trim($this->input->post('sig_info')), | ||||
|  | @ -529,7 +530,8 @@ class Logbook_model extends CI_Model { | |||
|        'COL_QSL_VIA' => $this->input->post('qsl_via_callsign'), | ||||
|        'station_id' => $this->input->post('station_profile'), | ||||
|        'COL_OPERATOR' => $this->input->post('operator_callsign'), | ||||
|        'COL_STATE' =>$this->input->post('usa_state') | ||||
|        'COL_STATE' =>$this->input->post('usa_state'), | ||||
|        'COL_USACA_COUNTIES' =>$this->input->post('usa_county'), | ||||
|     ); | ||||
| 
 | ||||
|     if ($this->exists_qrz_api_key($data['station_id'])) { | ||||
|  |  | |||
|  | @ -2040,6 +2040,26 @@ $(document).ready(function(){ | |||
|                         nl2br: false, | ||||
|                         message: html, | ||||
|                         onshown: function(dialog) { | ||||
|                             var state = $("#input_usa_state option:selected").text(); | ||||
|                             if (state != "") { | ||||
|                                 $("#stationCntyInput").prop('disabled', false); | ||||
|                                 selectize_usa_county(); | ||||
|                             } | ||||
| 
 | ||||
|                             $('#input_usa_state').change(function(){ | ||||
|                                 var state = $("#input_usa_state option:selected").text(); | ||||
|                                 if (state != "") { | ||||
|                                     $("#stationCntyInput").prop('disabled', false); | ||||
| 
 | ||||
|                                     selectize_usa_county(); | ||||
| 
 | ||||
|                                 } else { | ||||
|                                     $("#stationCntyInput").prop('disabled', true); | ||||
|                                     $('#stationCntyInput')[0].selectize.destroy(); | ||||
|                                     $("#stationCntyInput").val(""); | ||||
|                                 } | ||||
|                             }); | ||||
| 
 | ||||
|                             $('#sota_ref').selectize({ | ||||
|                                 maxItems: 1, | ||||
|                                 closeAfterSelect: true, | ||||
|  | @ -2101,6 +2121,40 @@ $(document).ready(function(){ | |||
|             }); | ||||
|         } | ||||
| 
 | ||||
|         function selectize_usa_county() { | ||||
|             var baseURL= "<?php echo base_url();?>"; | ||||
|             $('#stationCntyInput').selectize({ | ||||
|                 maxItems: 1, | ||||
|                 closeAfterSelect: true, | ||||
|                 loadThrottle: 250, | ||||
|                 valueField: 'name', | ||||
|                 labelField: 'name', | ||||
|                 searchField: 'name', | ||||
|                 options: [], | ||||
|                 create: false, | ||||
|                 load: function(query, callback) { | ||||
|                     var state = $("#input_usa_state option:selected").text(); | ||||
| 
 | ||||
|                     if (!query || state == "") return callback(); | ||||
|                     $.ajax({ | ||||
|                         url: baseURL+'index.php/qso/get_county', | ||||
|                         type: 'GET', | ||||
|                         dataType: 'json', | ||||
|                         data: { | ||||
|                             query: query, | ||||
|                             state: state, | ||||
|                         }, | ||||
|                         error: function() { | ||||
|                             callback(); | ||||
|                         }, | ||||
|                         success: function(res) { | ||||
|                             callback(res); | ||||
|                         } | ||||
|                     }); | ||||
|                 } | ||||
|             }); | ||||
|         } | ||||
| 
 | ||||
|         function qso_save() { | ||||
|             var baseURL= "<?php echo base_url();?>"; | ||||
|             var myform = document.getElementById("qsoform"); | ||||
|  |  | |||
|  | @ -371,6 +371,11 @@ | |||
|                                     </select> | ||||
|                                 </div> | ||||
| 
 | ||||
|                                 <div class="form-group"> | ||||
|                                     <label for="stationCntyInput">USA County</label> | ||||
|                                     <input disabled="disabled" class="form-control" id="stationCntyInput" type="text" name="usa_county" value="<?php echo $qso->COL_USACA_COUNTIES; ?>" /> | ||||
|                                 </div> | ||||
| 
 | ||||
|                                 <div class="form-group"> | ||||
|                                     <label for="iota_ref">IOTA</label> | ||||
|                                     <select class="custom-select" id="iota_ref" name="iota_ref"> | ||||
|  |  | |||
|  | @ -144,6 +144,12 @@ | |||
|                     </tr> | ||||
|                     <?php } ?>
 | ||||
| 
 | ||||
|                     <?php if($row->COL_USACA_COUNTIES != null) { ?>
 | ||||
|                         <tr> | ||||
|                             <td>USA County:</td> | ||||
|                             <td><?php echo $row->COL_USACA_COUNTIES; ?></td>
 | ||||
|                         </tr> | ||||
|                     <?php } ?>
 | ||||
| 
 | ||||
|                     <?php if($row->COL_NAME != null) { ?>
 | ||||
|                     <tr> | ||||
|  |  | |||
		正在加载…
	
		在新工单中引用