Skip to content

Commit

Permalink
Final fixups to make this fix Production-ready for [sc-24364]
Browse files Browse the repository at this point in the history
  • Loading branch information
uberbrady committed Feb 19, 2024
1 parent 76ebab4 commit dafbabf
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
2 changes: 0 additions & 2 deletions app/Models/Labels/Sheets/Avery/L7162_A.php
Expand Up @@ -75,8 +75,6 @@ public function write($pdf, $record) {
$currentY += self::TITLE_SIZE + self::TITLE_MARGIN;
}

// FONT FAMILY WORK:
// >>>>> WORKED'cid0cs', // 'unifont15104' // TOTAL DISASTER, // 'cid0cs', /* ALL FOUR!*/ // 'cid0ct', (3/4) // 'cid0cs'/* ALL FOUR!!!!! */,//'cid0jp' (3/4!), // 'cid0jp' (3/4!), //'cid0kr' (almost!), //'droidsansfallback', // 'couriernew', //'notosansmonocjkscvf', //'notosansmono', //'msungstdlight', // 'freeserif', // 'unifont15104', // 'robotomono', // $fontFamily,
foreach ($record->get('fields') as $field) {
static::writeText(
$pdf, $field['label'],
Expand Down
5 changes: 1 addition & 4 deletions app/View/Label.php
Expand Up @@ -102,7 +102,6 @@ public function render(callable $callback = null)
$title = str_replace('{COMPANY}', $asset->company->name, $settings->label2_title);
$settings->qr_text;
$assetData->put('title', $title);
\Log::error("THE TITLE YOU ARE TRYING TO PUT IS: $title");
}
}

Expand Down Expand Up @@ -174,13 +173,11 @@ public function render(callable $callback = null)
if ($template instanceof Sheet) {
$template->setLabelIndexOffset($offset ?? 0);
}
//\Log::error("DUMPING all of the 'data' - ".print_r($data,true));
$template->writeAll($pdf, $data);

$filename = $assets->count() > 1 ? 'assets.pdf' : $assets->first()->asset_tag.'.pdf';
set_time_limit(0); // ignore php timeout

$pdf->Output($filename, 'I'); // KERPLOW - splodey splode.
$pdf->Output($filename, 'I');
}

/**
Expand Down
Expand Up @@ -29,7 +29,7 @@ public function down()
{
Schema::table('settings', function (Blueprint $table) {
//
$table->dropColumn(['label2_variable_font','label2_fixed_font']);
$table->dropColumn(['label2_variable_font','label2_mono_font']);
});
}
}
4 changes: 4 additions & 0 deletions resources/lang/en-US/admin/settings/general.php
Expand Up @@ -349,6 +349,10 @@
'label2_2d_target_help' => 'The URL the 2D barcode points to when scanned',
'label2_fields' => 'Field Definitions',
'label2_fields_help' => 'Fields can be added, removed, and reordered in the left column. For each field, multiple options for Label and DataSource can be added, removed, and reordered in the right column.',
'label2_variable_width_font' => 'Variable-width font',
'label2_variable_width_font_hint' => '"FreeSans" is the default',
'label2_fixed_width_font' => 'Fixed-width font',
'label2_fixed_width_font_hint' => '"FreeMono" is the default',
'help_asterisk_bold' => 'Text entered as <code>**text**</code> will be displayed as bold',
'help_blank_to_use' => 'Leave blank to use the value from <code>:setting_name</code>',
'help_default_will_use' => '<code>:default</code> will use the value from <code>:setting_name</code>. <br>Note that the value of the barcodes must comply with the respective barcode spec in order to be successfully generated. Please see <a href="https://snipe-it.readme.io/docs/barcodes">the documentation <i class="fa fa-external-link"></i></a> for more details. ',
Expand Down
10 changes: 5 additions & 5 deletions resources/views/settings/labels.blade.php
Expand Up @@ -125,27 +125,27 @@ class="table table-striped snipe-table"
<!-- fonts, variable -->
<div class="form-group">
<div class="col-md-3 text-right">
{{ Form::label('label2_variable_font','Variable-width font', ['class' => 'control-label']) }}
{{ Form::label('label2_variable_font',trans('admin/settings/general.label2_variable_width_font'), ['class' => 'control-label']) }}
</div>
<div class="col-md-9">
{{ Form::select('label2_variable_font', $fonts, old('label2_variable_font', $setting->label2_variable_font), [ 'class'=>'select2 col-md-3', 'aria-label'=>'label2_variable_font' ]) }}
"FreeSans" is the default
{{ trans('admin/settings/general.label2_variable_width_font_hint') }}
</div>
</div>

<!-- fonts, fixed -->
<div class="form-group">
<div class="col-md-3 text-right">
{{ Form::label('label2_mono_font','Fixed-width font', ['class' => 'control-label']) }}
{{ Form::label('label2_mono_font',trans('admin/settings/general.label2_fixed_width_font'), ['class' => 'control-label']) }}
</div>
<div class="col-md-9">
{{ Form::select('label2_mono_font', $fonts, old('label2_mono_font', $setting->label2_mono_font), [ 'class'=>'select2 col-md-3', 'aria-label'=>'label2_mono_font' ]) }}
"FreeMono" is the default
{{ trans('admin/settings/general.label2_fixed_width_font_hint') }}
</div>
</div>


<!-- Use Asset Logo -->
<!-- Use Asset Logo -->
<div class="form-group" {{ $errors->has('label2_asset_logo') ? 'error' : '' }}">
<div class="col-md-7 col-md-offset-3">
Expand Down

0 comments on commit dafbabf

Please sign in to comment.