Merge pull request #2383 from int2001/clublog_checkbox
Added "Already imported to clublog" to ADIF-Importer
这个提交包含在:
		
						当前提交
						d4ce0b8077
					
				
					共有  4 个文件被更改,包括 43 次插入 和 13 次删除
				
			
		|  | @ -200,7 +200,7 @@ class adif extends CI_Controller { | ||||||
| 						break; | 						break; | ||||||
| 					}; | 					}; | ||||||
| 
 | 
 | ||||||
| 					$one_error = $this->logbook_model->import($record, $this->input->post('station_profile'), $this->input->post('skipDuplicate'), $this->input->post('markLotw'), $this->input->post('dxccAdif'), $this->input->post('markQrz'), $this->input->post('markHrd'), true, $this->input->post('operatorName')); | 					$one_error = $this->logbook_model->import($record, $this->input->post('station_profile'), $this->input->post('skipDuplicate'), $this->input->post('markClublog'),$this->input->post('markLotw'), $this->input->post('dxccAdif'), $this->input->post('markQrz'), $this->input->post('markHrd'), true, $this->input->post('operatorName')); | ||||||
| 					if ($one_error != '') { | 					if ($one_error != '') { | ||||||
| 						$custom_errors.=$one_error."<br/>"; | 						$custom_errors.=$one_error."<br/>"; | ||||||
| 					} | 					} | ||||||
|  |  | ||||||
|  | @ -461,7 +461,7 @@ class API extends CI_Controller { | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 				if(isset($obj['station_profile_id'])) { | 				if(isset($obj['station_profile_id'])) { | ||||||
| 					$this->logbook_model->import($record, $obj['station_profile_id'], NULL, NULL, NULL, NULL, NULL, false, false, true); | 					$this->logbook_model->import($record, $obj['station_profile_id'], NULL, NULL, NULL, NULL, NULL, NULL, false, false, true); | ||||||
| 				} | 				} | ||||||
| 
 | 
 | ||||||
| 			}; | 			}; | ||||||
|  |  | ||||||
|  | @ -2776,7 +2776,7 @@ class Logbook_model extends CI_Model { | ||||||
|      * $markHrd - used in ADIF import to mark QSOs as exported to HRDLog.net Logbook when importing QSOs |      * $markHrd - used in ADIF import to mark QSOs as exported to HRDLog.net Logbook when importing QSOs | ||||||
|      * $skipexport - used in ADIF import to skip the realtime upload to QRZ Logbook when importing QSOs from ADIF |      * $skipexport - used in ADIF import to skip the realtime upload to QRZ Logbook when importing QSOs from ADIF | ||||||
|      */ |      */ | ||||||
| 	function import($record, $station_id = "0", $skipDuplicate = false, $markLotw = false, $dxccAdif = false, $markQrz = false, $markHrd = false,$skipexport = false, $operatorName = false, $apicall = false) { | 	function import($record, $station_id = "0", $skipDuplicate = false, $markClublog = false, $markLotw = false, $dxccAdif = false, $markQrz = false, $markHrd = false,$skipexport = false, $operatorName = false, $apicall = false) { | ||||||
|         // be sure that station belongs to user
 |         // be sure that station belongs to user
 | ||||||
|         $CI =& get_instance(); |         $CI =& get_instance(); | ||||||
|         $CI->load->model('stations'); |         $CI->load->model('stations'); | ||||||
|  | @ -3031,6 +3031,26 @@ class Logbook_model extends CI_Model { | ||||||
|             $input_qsl_sent_via = ""; |             $input_qsl_sent_via = ""; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  | 	// Validate Clublog-Fields
 | ||||||
|  | 	if (isset($record['clublog_qso_upload_status'])){ | ||||||
|  | 		$input_clublog_qsl_sent = mb_strimwidth($record['clublog_qso_upload_status'], 0, 1); | ||||||
|  | 	} else if ($markClublog != NULL) { | ||||||
|  | 		$input_clublog_qsl_sent = "Y"; | ||||||
|  | 	} else { | ||||||
|  | 		$input_clublog_qsl_sent = NULL; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	if (isset($record['clublog_qso_upload_date'])){ | ||||||
|  | 		if(validateADIFDate($record['clublog_qso_upload_date']) == true){ | ||||||
|  | 			$input_clublog_qslsdate = $record['clublog_qso_upload_date']; | ||||||
|  | 		} else { | ||||||
|  | 			$input_clublog_qslsdate = NULL; | ||||||
|  | 			$my_error .= "Error QSO: Date: ".$time_on." Callsign: ".$record['call']." the clublog_qso_upload_date is invalid (YYYYMMDD): ".$record['clublog_qso_upload_date']."<br>"; | ||||||
|  | 		} | ||||||
|  | 	} else { | ||||||
|  | 		$input_clublog_qslsdate = NULL; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|         /* |         /* | ||||||
|           Validate LoTW Fields |           Validate LoTW Fields | ||||||
|         */ |         */ | ||||||
|  | @ -3040,14 +3060,6 @@ class Logbook_model extends CI_Model { | ||||||
|             $input_lotw_qsl_rcvd = NULL; |             $input_lotw_qsl_rcvd = NULL; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         if (isset($record['lotw_qsl_sent'])){ |  | ||||||
|             $input_lotw_qsl_sent = mb_strimwidth($record['lotw_qsl_sent'], 0, 1); |  | ||||||
|         } else if ($markLotw != NULL) { |  | ||||||
|             $input_lotw_qsl_sent = "Y"; |  | ||||||
|         } else { |  | ||||||
|             $input_lotw_qsl_sent = NULL; |  | ||||||
|         } |  | ||||||
| 
 |  | ||||||
|         if (isset($record['lotw_qslrdate'])){ |         if (isset($record['lotw_qslrdate'])){ | ||||||
|             if(validateADIFDate($record['lotw_qslrdate']) == true){ |             if(validateADIFDate($record['lotw_qslrdate']) == true){ | ||||||
|               $input_lotw_qslrdate = $record['lotw_qslrdate']; |               $input_lotw_qslrdate = $record['lotw_qslrdate']; | ||||||
|  | @ -3059,6 +3071,14 @@ class Logbook_model extends CI_Model { | ||||||
|             $input_lotw_qslrdate = NULL; |             $input_lotw_qslrdate = NULL; | ||||||
|         } |         } | ||||||
| 	 | 	 | ||||||
|  | 	if (isset($record['lotw_qsl_sent'])){ | ||||||
|  |             $input_lotw_qsl_sent = mb_strimwidth($record['lotw_qsl_sent'], 0, 1); | ||||||
|  |         } else if ($markLotw != NULL) { | ||||||
|  |             $input_lotw_qsl_sent = "Y"; | ||||||
|  |         } else { | ||||||
|  |             $input_lotw_qsl_sent = NULL; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|         if (isset($record['lotw_qslsdate'])){ |         if (isset($record['lotw_qslsdate'])){ | ||||||
|             if(validateADIFDate($record['lotw_qslsdate']) == true){ |             if(validateADIFDate($record['lotw_qslsdate']) == true){ | ||||||
|               $input_lotw_qslsdate = $record['lotw_qslsdate']; |               $input_lotw_qslsdate = $record['lotw_qslsdate']; | ||||||
|  | @ -3163,8 +3183,8 @@ class Logbook_model extends CI_Model { | ||||||
|                 'COL_CALL' => (!empty($record['call'])) ? strtoupper($record['call']) : '', |                 'COL_CALL' => (!empty($record['call'])) ? strtoupper($record['call']) : '', | ||||||
|                 'COL_CHECK' => (!empty($record['check'])) ? $record['check'] : '', |                 'COL_CHECK' => (!empty($record['check'])) ? $record['check'] : '', | ||||||
|                 'COL_CLASS' => (!empty($record['class'])) ? $record['class'] : '', |                 'COL_CLASS' => (!empty($record['class'])) ? $record['class'] : '', | ||||||
|                 'COL_CLUBLOG_QSO_UPLOAD_DATE' => (!empty($record['clublog_qso_upload_date'])) ? $record['clublog_qso_upload_date'] : null, |                 'COL_CLUBLOG_QSO_UPLOAD_DATE' => $input_clublog_qslsdate, | ||||||
|                 'COL_CLUBLOG_QSO_UPLOAD_STATUS' => (!empty($record['clublog_qso_upload_status'])) ? $record['clublog_qso_upload_status'] : null, |                 'COL_CLUBLOG_QSO_UPLOAD_STATUS' => $input_clublog_qsl_sent, | ||||||
|                 'COL_CNTY' => (!empty($record['cnty'])) ? $record['cnty'] : '', |                 'COL_CNTY' => (!empty($record['cnty'])) ? $record['cnty'] : '', | ||||||
|                 'COL_COMMENT' => (!empty($record['comment'])) ? $record['comment'] : '', |                 'COL_COMMENT' => (!empty($record['comment'])) ? $record['comment'] : '', | ||||||
|                 'COL_COMMENT_INTL' => (!empty($record['comment_intl'])) ? $record['comment_intl'] : '', |                 'COL_COMMENT_INTL' => (!empty($record['comment_intl'])) ? $record['comment_intl'] : '', | ||||||
|  |  | ||||||
|  | @ -79,6 +79,16 @@ | ||||||
|                         </div> |                         </div> | ||||||
|                     </div> |                     </div> | ||||||
| 
 | 
 | ||||||
|  |                     <div class="form-group row"> | ||||||
|  |                         <div class="col-md-10"> | ||||||
|  |                             <div class="form-check-inline"> | ||||||
|  |                                 <input class="form-check-input" type="checkbox" name="markClublog" value="1" id="markClublogImport"> | ||||||
|  |                                 <label class="form-check-label" for="markClublogImport">Mark imported QSOs as uploaded to Clublog Logbook</label> | ||||||
|  |                             </div> | ||||||
|  |                             <div class="small form-text text-muted">Select if ADIF being imported does not contain this information.</div> | ||||||
|  |                         </div> | ||||||
|  |                     </div> | ||||||
|  | 
 | ||||||
|                     <div class="form-group row"> |                     <div class="form-group row"> | ||||||
|                         <div class="col-md-10"> |                         <div class="col-md-10"> | ||||||
|                             <div class="form-check-inline"> |                             <div class="form-check-inline"> | ||||||
|  |  | ||||||
		正在加载…
	
		在新工单中引用