Disabled "use for print" if no paper given, catching error if those label was active
这个提交包含在:
父节点
85a2299322
当前提交
2824f31ac6
共有 2 个文件被更改,包括 31 次插入 和 17 次删除
|
|
@ -162,22 +162,32 @@ class Labels extends CI_Controller {
|
||||||
try {
|
try {
|
||||||
if ($label) {
|
if ($label) {
|
||||||
$ptype=$this->labels_model->getPaperType($label->paper_type_id); // fetch papersize out of paper-table
|
$ptype=$this->labels_model->getPaperType($label->paper_type_id); // fetch papersize out of paper-table
|
||||||
// var_dump($ptype);
|
if (($ptype->paper_id ?? '') != '') {
|
||||||
$pdf = new PDF_Label(array(
|
$pdf = new PDF_Label(array(
|
||||||
'paper-size' => 'custom', // $label->paper_type, // The only Type left is "custom" because A4 and so on are also defined at paper_types
|
'paper-size' => 'custom', // $label->paper_type, // The only Type left is "custom" because A4 and so on are also defined at paper_types
|
||||||
'metric' => $label->metric,
|
'metric' => $label->metric,
|
||||||
'marginLeft' => $label->marginleft,
|
'marginLeft' => $label->marginleft,
|
||||||
'marginTop' => $label->margintop,
|
'marginTop' => $label->margintop,
|
||||||
'NX' => $label->nx,
|
'NX' => $label->nx,
|
||||||
'NY' => $label->ny,
|
'NY' => $label->ny,
|
||||||
'SpaceX' => $label->spacex,
|
'SpaceX' => $label->spacex,
|
||||||
'SpaceY' => $label->spacey,
|
'SpaceY' => $label->spacey,
|
||||||
'width' => $label->width,
|
'width' => $label->width,
|
||||||
'height' => $label->height,
|
'height' => $label->height,
|
||||||
'font-size' => $label->font_size,
|
'font-size' => $label->font_size,
|
||||||
'pgX' => $ptype->width,
|
'pgX' => $ptype->width,
|
||||||
'pgY' => $ptype->height
|
'pgY' => $ptype->height
|
||||||
));
|
));
|
||||||
|
} else {
|
||||||
|
if ($jscall) {
|
||||||
|
header('Content-Type: application/json');
|
||||||
|
echo json_encode(array('message' => 'You need to assign a paperType to the label before printing'));
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
$this->session->set_flashdata('error', 'You need to assign a paperType to the label before printing');
|
||||||
|
redirect('labels');
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($jscall) {
|
if ($jscall) {
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
|
|
@ -204,7 +214,7 @@ class Labels extends CI_Controller {
|
||||||
|
|
||||||
if ($label->font == 'DejaVuSans') { // leave this here, for future Use
|
if ($label->font == 'DejaVuSans') { // leave this here, for future Use
|
||||||
$pdf->AddFont($label->font,'','DejaVuSansMono.ttf',true);
|
$pdf->AddFont($label->font,'','DejaVuSansMono.ttf',true);
|
||||||
$pdf->SetFont($label->font);
|
$pdf->SetFont($label->font,'');
|
||||||
} else {
|
} else {
|
||||||
$pdf->AddFont($label->font);
|
$pdf->AddFont($label->font);
|
||||||
$pdf->SetFont($label->font);
|
$pdf->SetFont($label->font);
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,11 @@
|
||||||
<td><?php echo $label->font_size; ?></td>
|
<td><?php echo $label->font_size; ?></td>
|
||||||
<td><?php echo $label->qsos; ?></td>
|
<td><?php echo $label->qsos; ?></td>
|
||||||
<td><?php echo $label->last_modified; ?></td>
|
<td><?php echo $label->last_modified; ?></td>
|
||||||
|
<?php if (($label->paper_name ?? '') == '') { ?>
|
||||||
|
<td></td>
|
||||||
|
<?php } else { ?>
|
||||||
<td><input type="checkbox" <?php if ($label->useforprint == 1) {echo 'checked';}?>></td>
|
<td><input type="checkbox" <?php if ($label->useforprint == 1) {echo 'checked';}?>></td>
|
||||||
|
<?php } ?>
|
||||||
<td><a href="<?php echo site_url('labels/edit/' . $label->id); ?>" class="btn btn-outline-primary btn-sm"><i class="fas fa-edit"></i></a></td>
|
<td><a href="<?php echo site_url('labels/edit/' . $label->id); ?>" class="btn btn-outline-primary btn-sm"><i class="fas fa-edit"></i></a></td>
|
||||||
<td><a href="<?php echo site_url('labels/delete/' . $label->id); ?>" class="btn btn-outline-danger btn-sm"><i class="fas fa-trash-alt"></i></a></td>
|
<td><a href="<?php echo site_url('labels/delete/' . $label->id); ?>" class="btn btn-outline-danger btn-sm"><i class="fas fa-trash-alt"></i></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用