Remove debug dump statements

This commit removes various debug dump statements from BulkAssetsController and UpdateAssetAction. These changes clean up the code and improve readability by eliminating unnecessary debugging output. Maintaining clean code ensures better maintainability and performance.
This commit is contained in:
spencerrlongg 2024-11-22 20:49:52 -06:00
parent a4fefc2b5a
commit 5aa2f307cd
3 changed files with 0 additions and 10 deletions

View file

@ -57,7 +57,6 @@ class UpdateAssetAction
$asset->warranty_months = $warranty_months ?? $asset->warranty_months; $asset->warranty_months = $warranty_months ?? $asset->warranty_months;
$asset->purchase_cost = $purchase_cost ?? $asset->purchase_cost; $asset->purchase_cost = $purchase_cost ?? $asset->purchase_cost;
if ($request->input('null_purchase_date') === '1') { if ($request->input('null_purchase_date') === '1') {
dump('filled');
$asset->purchase_date = null; $asset->purchase_date = null;
if (!($asset->eol_explicit)) { if (!($asset->eol_explicit)) {
$asset->asset_eol_date = null; $asset->asset_eol_date = null;
@ -121,13 +120,10 @@ class UpdateAssetAction
// This is a non-deployable status label - we should check the asset back in. // This is a non-deployable status label - we should check the asset back in.
if (($status && $status->getStatuslabelType() != 'deployable') && ($target = $asset->assignedTo)) { if (($status && $status->getStatuslabelType() != 'deployable') && ($target = $asset->assignedTo)) {
dump('status logic');
$originalValues = $asset->getRawOriginal(); $originalValues = $asset->getRawOriginal();
$asset->assigned_to = null; $asset->assigned_to = null;
$asset->assigned_type = null; $asset->assigned_type = null;
$asset->accepted = null; $asset->accepted = null;
dump($asset->assigned_to);
event(new CheckoutableCheckedIn($asset, $target, auth()->user(), 'Checkin on asset update', date('Y-m-d H:i:s'), $originalValues)); event(new CheckoutableCheckedIn($asset, $target, auth()->user(), 'Checkin on asset update', date('Y-m-d H:i:s'), $originalValues));
// reset this to null so checkout logic doesn't happen below // reset this to null so checkout logic doesn't happen below
@ -174,7 +170,6 @@ class UpdateAssetAction
// the gui method // the gui method
//if (($model) && ($model->fieldset)) { //if (($model) && ($model->fieldset)) {
// dump($model->fieldset->fields);
// foreach ($model->fieldset->fields as $field) { // foreach ($model->fieldset->fields as $field) {
// //
// //
@ -210,8 +205,6 @@ class UpdateAssetAction
} }
} }
if ($field->field_encrypted == '1') { if ($field->field_encrypted == '1') {
dump(Gate::allows('assets.view.encrypted_custom_fields'));
dump(auth()->user()->can('assets.view.encrypted_custom_fields'));
if (Gate::allows('assets.view.encrypted_custom_fields')) { if (Gate::allows('assets.view.encrypted_custom_fields')) {
$field_val = Crypt::encrypt($field_val); $field_val = Crypt::encrypt($field_val);
} else { } else {
@ -243,7 +236,6 @@ class UpdateAssetAction
} }
if (isset($target)) { if (isset($target)) {
dump($target);
$asset->checkOut($target, auth()->user(), date('Y-m-d H:i:s'), '', 'Checked out on asset update', e($request->get('name')), $location); $asset->checkOut($target, auth()->user(), date('Y-m-d H:i:s'), '', 'Checked out on asset update', e($request->get('name')), $location);
} }

View file

@ -264,7 +264,6 @@ class AssetsController extends Controller
asset_tag: $asset_tag, // same as serials asset_tag: $asset_tag, // same as serials
notes: $request->validated('notes'), notes: $request->validated('notes'),
); );
dump('returned'.$asset->assigned_to);
return redirect()->to(Helper::getRedirectOption($request, $updatedAsset->id, 'Assets')) return redirect()->to(Helper::getRedirectOption($request, $updatedAsset->id, 'Assets'))
->with('success', trans('admin/hardware/message.update.success')); ->with('success', trans('admin/hardware/message.update.success'));
} catch (ValidationException $e) { } catch (ValidationException $e) {

View file

@ -253,7 +253,6 @@ class BulkAssetsController extends Controller
} }
} }
if (!empty($errors)) { if (!empty($errors)) {
//dump($errors);
return redirect($bulk_back_url)->with('bulk_asset_errors', $errors); return redirect($bulk_back_url)->with('bulk_asset_errors', $errors);
} }
if ($custom_field_problem) { if ($custom_field_problem) {