Skip to content

Commit

Permalink
Merge pull request #14499 from Godmartinz/remove_encrpyt_from_labels
Browse files Browse the repository at this point in the history
Removed encrypted fields from label options
  • Loading branch information
snipe committed Apr 23, 2024
2 parents e2d1e6b + 96b3af7 commit 685f1cb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions app/Http/Controllers/LabelsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,17 @@
use App\Models\Supplier;
use App\Models\User;
use App\View\Label as LabelView;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Storage;

class LabelsController extends Controller
{
/**
* Returns the Label view with test data
*
* @author Grant Le Roux <grant.leroux+snipe-it@gmail.com>
* @param string $labelName
* @param string $labelName
* @return \Illuminate\Contracts\View\View
* @author Grant Le Roux <grant.leroux+snipe-it@gmail.com>
*/
public function show(string $labelName)
{
Expand Down Expand Up @@ -66,7 +67,7 @@ public function show(string $labelName)
$exampleAsset->model->category->id = 999999;
$exampleAsset->model->category->name = trans('admin/labels/table.example_category');

$customFieldColumns = CustomField::all()->pluck('db_column');
$customFieldColumns = CustomField::where('field_encrypted', '=', 0)->pluck('db_column');

collect(explode(';', Setting::getSettings()->label2_fields))
->filter()
Expand Down
7 changes: 3 additions & 4 deletions app/Http/Controllers/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -804,10 +804,9 @@ public function getPhpInfo()
*/
public function getLabels()
{
return view('settings.labels', [
'setting' => Setting::getSettings(),
'customFields' => CustomField::all(),
]);
return view('settings.labels')
->with('setting', Setting::getSettings())
->with('customFields', CustomField::where('field_encrypted', '=', 0)->get());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@
</optgroup>
<optgroup label="Custom Fields">
@foreach($customFields as $customField)

<option value="{{ $customField->db_column }}">{{ $customField->name }}</option>
@endforeach
</optgroup>
Expand Down

0 comments on commit 685f1cb

Please sign in to comment.