当前提交
cb5969a090
共有 19 个文件被更改,包括 48 次插入 和 14 次删除
|
|
@ -134,28 +134,30 @@ class Labels extends CI_Controller {
|
|||
$ids = xss_clean(json_decode($this->input->post('id')));
|
||||
$offset = xss_clean($this->input->post('startat'));
|
||||
$grid = $this->input->post('grid') === "true" ? 1 : 0;
|
||||
$via = $this->input->post('via') === "true" ? 1 : 0;
|
||||
$this->load->model('labels_model');
|
||||
$result = $this->labels_model->export_printrequestedids($ids);
|
||||
|
||||
$this->prepareLabel($result, true, $offset, $grid);
|
||||
$this->prepareLabel($result, true, $offset, $grid, $via);
|
||||
}
|
||||
|
||||
public function print($station_id) {
|
||||
$clean_id = xss_clean($station_id);
|
||||
$offset = xss_clean($this->input->post('startat'));
|
||||
$grid = xss_clean($this->input->post('grid') ?? 0);
|
||||
$via = xss_clean($this->input->post('via') ?? 0);
|
||||
$this->load->model('stations');
|
||||
if ($this->stations->check_station_is_accessible($station_id)) {
|
||||
$this->load->model('labels_model');
|
||||
$result = $this->labels_model->export_printrequested($clean_id);
|
||||
|
||||
$this->prepareLabel($result, false, $offset, $grid);
|
||||
$this->prepareLabel($result, false, $offset, $grid, $via);
|
||||
} else {
|
||||
redirect('labels');
|
||||
}
|
||||
}
|
||||
|
||||
function prepareLabel($qsos, $jscall = false, $offset = 1, $grid = false) {
|
||||
function prepareLabel($qsos, $jscall = false, $offset = 1, $grid = false, $via = false) {
|
||||
$this->load->model('labels_model');
|
||||
$label = $this->labels_model->getDefaultLabel();
|
||||
|
||||
|
|
@ -231,9 +233,9 @@ class Labels extends CI_Controller {
|
|||
|
||||
if ($qsos->num_rows() > 0) {
|
||||
if ($label->qsos == 1) {
|
||||
$this->makeMultiQsoLabel($qsos->result(), $pdf, 1, $offset, $ptype->orientation, $grid);
|
||||
$this->makeMultiQsoLabel($qsos->result(), $pdf, 1, $offset, $ptype->orientation, $grid, $via);
|
||||
} else {
|
||||
$this->makeMultiQsoLabel($qsos->result(), $pdf, $label->qsos, $offset, $ptype->orientation, $grid);
|
||||
$this->makeMultiQsoLabel($qsos->result(), $pdf, $label->qsos, $offset, $ptype->orientation, $grid, $via);
|
||||
}
|
||||
} else {
|
||||
$this->session->set_flashdata('message', '0 QSOs found for print!');
|
||||
|
|
@ -242,7 +244,7 @@ class Labels extends CI_Controller {
|
|||
$pdf->Output();
|
||||
}
|
||||
|
||||
function makeMultiQsoLabel($qsos, $pdf, $numberofqsos, $offset, $orientation, $grid) {
|
||||
function makeMultiQsoLabel($qsos, $pdf, $numberofqsos, $offset, $orientation, $grid, $via) {
|
||||
$text = '';
|
||||
$current_callsign = '';
|
||||
$current_sat = '';
|
||||
|
|
@ -259,7 +261,7 @@ class Labels extends CI_Controller {
|
|||
( ($qso->COL_BAND_RX !== $current_sat_bandrx) && ($this->pretty_sat_mode($qso->COL_SAT_MODE) !== '')) ) {
|
||||
// ((($qso->COL_SAT_NAME ?? '' !== $current_sat) || ($qso->COL_CALL !== $current_callsign)) && ($qso->COL_SAT_NAME ?? '' !== '') && ($col->COL_BAND_RX ?? '' !== $current_sat_bandrx))) {
|
||||
if (!empty($qso_data)) {
|
||||
$this->finalizeData($pdf, $current_callsign, $qso_data, $numberofqsos, $orientation, $grid);
|
||||
$this->finalizeData($pdf, $current_callsign, $qso_data, $numberofqsos, $orientation, $grid, $via);
|
||||
$qso_data = [];
|
||||
}
|
||||
$current_callsign = $qso->COL_CALL;
|
||||
|
|
@ -274,6 +276,7 @@ class Labels extends CI_Controller {
|
|||
'mode' => $qso->COL_MODE,
|
||||
'rst' => $qso->COL_RST_SENT,
|
||||
'mygrid' => $qso->station_gridsquare,
|
||||
'via' => $qso->COL_QSL_VIA,
|
||||
'sat' => $qso->COL_SAT_NAME,
|
||||
'sat_mode' => $this->pretty_sat_mode($qso->COL_SAT_MODE ?? ''),
|
||||
'sat_band_rx' => ($qso->COL_BAND_RX ?? ''),
|
||||
|
|
@ -282,7 +285,7 @@ class Labels extends CI_Controller {
|
|||
];
|
||||
}
|
||||
if (!empty($qso_data)) {
|
||||
$this->finalizeData($pdf, $current_callsign, $qso_data, $numberofqsos, $orientation, $grid);
|
||||
$this->finalizeData($pdf, $current_callsign, $qso_data, $numberofqsos, $orientation, $grid, $via);
|
||||
}
|
||||
}
|
||||
// New begin
|
||||
|
|
@ -290,7 +293,7 @@ class Labels extends CI_Controller {
|
|||
return(strlen($sat_mode ?? '') == 2 ? (strtoupper($sat_mode[0]).'/'.strtoupper($sat_mode[1])) : strtoupper($sat_mode ?? ''));
|
||||
}
|
||||
|
||||
function finalizeData($pdf, $current_callsign, &$preliminaryData, $qso_per_label,$orientation, $grid) {
|
||||
function finalizeData($pdf, $current_callsign, &$preliminaryData, $qso_per_label,$orientation, $grid, $via) {
|
||||
|
||||
$tableData = [];
|
||||
$count_qso = 0;
|
||||
|
|
@ -310,7 +313,7 @@ class Labels extends CI_Controller {
|
|||
|
||||
|
||||
if($count_qso == $qso_per_label){
|
||||
$this->generateLabel($pdf, $current_callsign, $tableData,$count_qso,$qso,$orientation, $grid);
|
||||
$this->generateLabel($pdf, $current_callsign, $tableData,$count_qso,$qso,$orientation, $grid, $via);
|
||||
$tableData = []; // reset the data
|
||||
$count_qso = 0; // reset the counter
|
||||
}
|
||||
|
|
@ -318,16 +321,20 @@ class Labels extends CI_Controller {
|
|||
}
|
||||
// generate label for remaining QSOs
|
||||
if($count_qso > 0){
|
||||
$this->generateLabel($pdf, $current_callsign, $tableData,$count_qso,$qso,$orientation, $grid);
|
||||
$this->generateLabel($pdf, $current_callsign, $tableData,$count_qso,$qso,$orientation, $grid, $via);
|
||||
$preliminaryData = []; // reset the data
|
||||
}
|
||||
}
|
||||
|
||||
function generateLabel($pdf, $current_callsign, $tableData,$numofqsos,$qso,$orientation,$grid=true){
|
||||
function generateLabel($pdf, $current_callsign, $tableData,$numofqsos,$qso,$orientation,$grid=true, $via=false){
|
||||
$builder = new \AsciiTable\Builder();
|
||||
$builder->addRows($tableData);
|
||||
$text = "Confirming QSO".($numofqsos>1 ? 's' : '')." with ";
|
||||
$text .= $current_callsign."\n";
|
||||
$text .= $current_callsign;
|
||||
if (($via) && ($qso['via'] ?? '' != '')) {
|
||||
$text.=' via '.substr($qso['via'],0,8);
|
||||
}
|
||||
$text .= "\n";
|
||||
$text .= $builder->renderTable();
|
||||
if($qso['sat'] != "") {
|
||||
if (($qso['sat_mode'] == '') && ($qso['sat_band_rx'] !== '')) {
|
||||
|
|
|
|||
|
|
@ -115,6 +115,7 @@ $lang['filter_actions_recv_electronic'] = 'Received (Electronic)';
|
|||
$lang['filter_actions_create_adif'] = 'Create ADIF';
|
||||
$lang['filter_actions_print_label'] = 'Print Label';
|
||||
$lang['filter_actions_start_print_title'] = 'Print Labels';
|
||||
$lang['filter_actions_print_include_via'] = "Include Via";
|
||||
$lang['filter_actions_print_include_grid'] = 'Include Grid?';
|
||||
$lang['filter_actions_start_print'] = 'Start printing at?';
|
||||
$lang['filter_actions_print'] = 'Print';
|
||||
|
|
|
|||
|
|
@ -115,6 +115,7 @@ $lang['filter_actions_recv_electronic'] = 'Received (Electronic)';
|
|||
$lang['filter_actions_create_adif'] = 'Create ADIF';
|
||||
$lang['filter_actions_print_label'] = 'Print Label';
|
||||
$lang['filter_actions_start_print_title'] = 'Print Labels';
|
||||
$lang['filter_actions_print_include_via'] = "Include Via";
|
||||
$lang['filter_actions_print_include_grid'] = 'Include Grid?';
|
||||
$lang['filter_actions_start_print'] = 'Start printing at?';
|
||||
$lang['filter_actions_print'] = 'Print';
|
||||
|
|
|
|||
|
|
@ -115,6 +115,7 @@ $lang['filter_actions_recv_electronic'] = 'Received (Electronic)';
|
|||
$lang['filter_actions_create_adif'] = 'Create ADIF';
|
||||
$lang['filter_actions_print_label'] = 'Print Label';
|
||||
$lang['filter_actions_start_print_title'] = 'Print Labels';
|
||||
$lang['filter_actions_print_include_via'] = "Include Via";
|
||||
$lang['filter_actions_print_include_grid'] = 'Include Grid?';
|
||||
$lang['filter_actions_start_print'] = 'Start printing at?';
|
||||
$lang['filter_actions_print'] = 'Print';
|
||||
|
|
|
|||
|
|
@ -115,6 +115,7 @@ $lang['filter_actions_recv_electronic'] = 'Received (Electronic)';
|
|||
$lang['filter_actions_create_adif'] = 'Create ADIF';
|
||||
$lang['filter_actions_print_label'] = 'Print Label';
|
||||
$lang['filter_actions_start_print_title'] = 'Print Labels';
|
||||
$lang['filter_actions_print_include_via'] = "Include Via";
|
||||
$lang['filter_actions_print_include_grid'] = 'Include Grid?';
|
||||
$lang['filter_actions_start_print'] = 'Start printing at?';
|
||||
$lang['filter_actions_print'] = 'Print';
|
||||
|
|
|
|||
|
|
@ -115,6 +115,7 @@ $lang['filter_actions_recv_electronic'] = 'Received (Electronic)';
|
|||
$lang['filter_actions_create_adif'] = 'Create ADIF';
|
||||
$lang['filter_actions_print_label'] = 'Print Label';
|
||||
$lang['filter_actions_start_print_title'] = 'Print Labels';
|
||||
$lang['filter_actions_print_include_via'] = "Include Via";
|
||||
$lang['filter_actions_print_include_grid'] = 'Include Grid?';
|
||||
$lang['filter_actions_start_print'] = 'Start printing at?';
|
||||
$lang['filter_actions_print'] = 'Print';
|
||||
|
|
|
|||
|
|
@ -115,6 +115,7 @@ $lang['filter_actions_recv_electronic'] = 'Received (Electronic)';
|
|||
$lang['filter_actions_create_adif'] = 'Create ADIF';
|
||||
$lang['filter_actions_print_label'] = 'Print Label';
|
||||
$lang['filter_actions_start_print_title'] = 'Print Labels';
|
||||
$lang['filter_actions_print_include_via'] = "Include Via";
|
||||
$lang['filter_actions_print_include_grid'] = 'Include Grid?';
|
||||
$lang['filter_actions_start_print'] = 'Start printing at?';
|
||||
$lang['filter_actions_print'] = 'Print';
|
||||
|
|
|
|||
|
|
@ -115,6 +115,7 @@ $lang['filter_actions_recv_electronic'] = 'Received (Electronic)';
|
|||
$lang['filter_actions_create_adif'] = 'Create ADIF';
|
||||
$lang['filter_actions_print_label'] = 'Print Label';
|
||||
$lang['filter_actions_start_print_title'] = 'Print Labels';
|
||||
$lang['filter_actions_print_include_via'] = "Include Via";
|
||||
$lang['filter_actions_print_include_grid'] = 'Include Grid?';
|
||||
$lang['filter_actions_start_print'] = 'Start printing at?';
|
||||
$lang['filter_actions_print'] = 'Print';
|
||||
|
|
|
|||
|
|
@ -115,6 +115,7 @@ $lang['filter_actions_recv_electronic'] = 'Erhalten (Elektronisch)';
|
|||
$lang['filter_actions_create_adif'] = 'Erstelle ADIF';
|
||||
$lang['filter_actions_print_label'] = 'Label drucken';
|
||||
$lang['filter_actions_start_print_title'] = 'Label Drucken';
|
||||
$lang['filter_actions_print_include_via'] = "Include Via";
|
||||
$lang['filter_actions_print_include_grid'] = 'Mit Planquadrat?';
|
||||
$lang['filter_actions_start_print'] = 'Druck starten bei?';
|
||||
$lang['filter_actions_print'] = 'Drucken';
|
||||
|
|
|
|||
|
|
@ -115,6 +115,7 @@ $lang['filter_actions_recv_electronic'] = 'Received (Electronic)';
|
|||
$lang['filter_actions_create_adif'] = 'Create ADIF';
|
||||
$lang['filter_actions_print_label'] = 'Print Label';
|
||||
$lang['filter_actions_start_print_title'] = 'Print Labels';
|
||||
$lang['filter_actions_print_include_via'] = "Include Via";
|
||||
$lang['filter_actions_print_include_grid'] = 'Include Grid?';
|
||||
$lang['filter_actions_start_print'] = 'Start printing at?';
|
||||
$lang['filter_actions_print'] = 'Print';
|
||||
|
|
|
|||
|
|
@ -115,6 +115,7 @@ $lang['filter_actions_recv_electronic'] = 'Received (Electronic)';
|
|||
$lang['filter_actions_create_adif'] = 'Create ADIF';
|
||||
$lang['filter_actions_print_label'] = 'Print Label';
|
||||
$lang['filter_actions_start_print_title'] = 'Print Labels';
|
||||
$lang['filter_actions_print_include_via'] = "Include Via";
|
||||
$lang['filter_actions_print_include_grid'] = 'Include Grid?';
|
||||
$lang['filter_actions_start_print'] = 'Start printing at?';
|
||||
$lang['filter_actions_print'] = 'Print';
|
||||
|
|
|
|||
|
|
@ -115,6 +115,7 @@ $lang['filter_actions_recv_electronic'] = 'Received (Electronic)';
|
|||
$lang['filter_actions_create_adif'] = 'Create ADIF';
|
||||
$lang['filter_actions_print_label'] = 'Print Label';
|
||||
$lang['filter_actions_start_print_title'] = 'Print Labels';
|
||||
$lang['filter_actions_print_include_via'] = "Include Via";
|
||||
$lang['filter_actions_print_include_grid'] = 'Include Grid?';
|
||||
$lang['filter_actions_start_print'] = 'Start printing at?';
|
||||
$lang['filter_actions_print'] = 'Print';
|
||||
|
|
|
|||
|
|
@ -115,6 +115,7 @@ $lang['filter_actions_recv_electronic'] = 'Received (Electronic)';
|
|||
$lang['filter_actions_create_adif'] = 'Create ADIF';
|
||||
$lang['filter_actions_print_label'] = 'Print Label';
|
||||
$lang['filter_actions_start_print_title'] = 'Print Labels';
|
||||
$lang['filter_actions_print_include_via'] = "Include Via";
|
||||
$lang['filter_actions_print_include_grid'] = 'Include Grid?';
|
||||
$lang['filter_actions_start_print'] = 'Start printing at?';
|
||||
$lang['filter_actions_print'] = 'Print';
|
||||
|
|
|
|||
|
|
@ -115,6 +115,7 @@ $lang['filter_actions_recv_electronic'] = 'Received (Electronic)';
|
|||
$lang['filter_actions_create_adif'] = 'Create ADIF';
|
||||
$lang['filter_actions_print_label'] = 'Print Label';
|
||||
$lang['filter_actions_start_print_title'] = 'Print Labels';
|
||||
$lang['filter_actions_print_include_via'] = "Include Via";
|
||||
$lang['filter_actions_print_include_grid'] = 'Include Grid?';
|
||||
$lang['filter_actions_start_print'] = 'Start printing at?';
|
||||
$lang['filter_actions_print'] = 'Print';
|
||||
|
|
|
|||
|
|
@ -115,6 +115,7 @@ $lang['filter_actions_recv_electronic'] = 'Received (Electronic)';
|
|||
$lang['filter_actions_create_adif'] = 'Create ADIF';
|
||||
$lang['filter_actions_print_label'] = 'Print Label';
|
||||
$lang['filter_actions_start_print_title'] = 'Print Labels';
|
||||
$lang['filter_actions_print_include_via'] = "Include Via";
|
||||
$lang['filter_actions_print_include_grid'] = 'Include Grid?';
|
||||
$lang['filter_actions_start_print'] = 'Start printing at?';
|
||||
$lang['filter_actions_print'] = 'Print';
|
||||
|
|
|
|||
|
|
@ -115,6 +115,7 @@ $lang['filter_actions_recv_electronic'] = 'Received (Electronic)';
|
|||
$lang['filter_actions_create_adif'] = 'Create ADIF';
|
||||
$lang['filter_actions_print_label'] = 'Print Label';
|
||||
$lang['filter_actions_start_print_title'] = 'Print Labels';
|
||||
$lang['filter_actions_print_include_via'] = "Include Via";
|
||||
$lang['filter_actions_print_include_grid'] = 'Include Grid?';
|
||||
$lang['filter_actions_start_print'] = 'Start printing at?';
|
||||
$lang['filter_actions_print'] = 'Print';
|
||||
|
|
|
|||
|
|
@ -5,6 +5,12 @@
|
|||
<input class="form-check-input" type="checkbox" name="grid" id="grid">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="my-1 mr-2 col-md-4" for="via">Include Via (if filled)?</label>
|
||||
<div class="form-check-inline">
|
||||
<input class="form-check-input" type="checkbox" name="via" id="via">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="my-1 mr-2 col-md-4" for="startat">Start printing at?</label>
|
||||
<div class="form-inline">
|
||||
|
|
|
|||
|
|
@ -5,6 +5,12 @@
|
|||
<input class="form-check-input" type="checkbox" name="gridlabel" id="gridlabel">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="my-1 mr-2 col-md-4" for="via"><?php echo lang('filter_actions_print_include_via'); ?></label>
|
||||
<div class="form-check-inline">
|
||||
<input class="form-check-input" type="checkbox" name="via" id="via">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="my-1 mr-2 col-md-4" for="startat"><?php echo lang('filter_actions_start_print'); ?></label>
|
||||
<div class="form-inline">
|
||||
|
|
|
|||
|
|
@ -774,7 +774,7 @@ function printlabel() {
|
|||
data: {'id': JSON.stringify(id_list, null, 2),
|
||||
'startat': $('#startat').val(),
|
||||
'grid': $('#gridlabel')[0].checked,
|
||||
|
||||
'via': $('#via')[0].checked,
|
||||
},
|
||||
xhr:function(){
|
||||
var xhr = new XMLHttpRequest();
|
||||
|
|
|
|||
正在加载…
在新工单中引用