kopia lustrzana https://github.com/magicbug/Cloudlog
Added inches to papertype / extended logic for inches
rodzic
45e057c261
commit
14cff47f04
|
@ -163,6 +163,13 @@ class Labels extends CI_Controller {
|
||||||
$label->font='DejaVuSans'; // Fix font to DejaVuSans
|
$label->font='DejaVuSans'; // Fix font to DejaVuSans
|
||||||
$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
|
||||||
if (($ptype->paper_id ?? '') != '') {
|
if (($ptype->paper_id ?? '') != '') {
|
||||||
|
if ($ptype->metric == 'in') { // convert papersize to mm if given in inch
|
||||||
|
$paper_width=$ptype->width*25.4;
|
||||||
|
$paper_height=$ptype->height*25.4;
|
||||||
|
} else {
|
||||||
|
$paper_width=$ptype->width;
|
||||||
|
$paper_height=$ptype->height;
|
||||||
|
}
|
||||||
$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,
|
||||||
|
@ -175,8 +182,8 @@ class Labels extends CI_Controller {
|
||||||
'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' => $paper_width,
|
||||||
'pgY' => $ptype->height
|
'pgY' => $paper_height
|
||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
if ($jscall) {
|
if ($jscall) {
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
<div class="col-sm-4">
|
<div class="col-sm-4">
|
||||||
<select name="measurementType" class="form-control" id="measurementType">
|
<select name="measurementType" class="form-control" id="measurementType">
|
||||||
<option selected value="mm">Millimeters</option>
|
<option selected value="mm">Millimeters</option>
|
||||||
<!-- <option value="in">Inches</option> -->
|
<option value="in">Inches</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
<div class="col-sm-4">
|
<div class="col-sm-4">
|
||||||
<select name="measurementType" class="form-control" id="measurementType">
|
<select name="measurementType" class="form-control" id="measurementType">
|
||||||
<option value="mm" <?php if($paper->metric == "mm") { echo "selected=\"selected\""; } ?>>Millimeters</option>
|
<option value="mm" <?php if($paper->metric == "mm") { echo "selected=\"selected\""; } ?>>Millimeters</option>
|
||||||
<!-- <option value="in" <?php if($paper->metric == "in") { echo "selected=\"selected\""; } ?>>Inches</option> -->
|
<option value="in" <?php if($paper->metric == "in") { echo "selected=\"selected\""; } ?>>Inches</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Ładowanie…
Reference in New Issue