Merge remote-tracking branch 'origin/develop'
This commit is contained in:
commit
b256bea000
5 changed files with 23 additions and 16 deletions
|
@ -84,7 +84,11 @@ Since the release of the JSON REST API, several third-party developers have been
|
||||||
|
|
||||||
### Contributing
|
### Contributing
|
||||||
|
|
||||||
Please see the documentation on [contributing and developing for Snipe-IT](https://snipe-it.readme.io/docs/contributing-overview).
|
Please refrain from submitting issues or pull requests generated by fully-automated tools. Maintainers reserve the right, at their sole discretion, to close such submissions and to block any account responsible for them.
|
||||||
|
|
||||||
|
Ideally, contributions should follow from a human-to-human discussion in the form of an issue.
|
||||||
|
|
||||||
|
Please see the complete documentation on [contributing and developing for Snipe-IT](https://snipe-it.readme.io/docs/contributing-overview).
|
||||||
|
|
||||||
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
|
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
|
||||||
|
|
||||||
|
|
|
@ -598,7 +598,6 @@ class AssetsController extends Controller
|
||||||
$asset->model()->associate(AssetModel::find((int) $request->get('model_id')));
|
$asset->model()->associate(AssetModel::find((int) $request->get('model_id')));
|
||||||
|
|
||||||
$asset->fill($request->validated());
|
$asset->fill($request->validated());
|
||||||
$asset->company_id = Company::getIdForCurrentUser($request->validated()['company_id']);
|
|
||||||
$asset->created_by = auth()->id();
|
$asset->created_by = auth()->id();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -26,18 +26,11 @@ class StoreAssetRequest extends ImageUploadRequest
|
||||||
|
|
||||||
public function prepareForValidation(): void
|
public function prepareForValidation(): void
|
||||||
{
|
{
|
||||||
// Guard against users passing in an array for company_id instead of an integer.
|
|
||||||
// If the company_id is not an integer then we simply use what was
|
|
||||||
// provided to be caught by model level validation later.
|
|
||||||
$idForCurrentUser = is_int($this->company_id)
|
|
||||||
? Company::getIdForCurrentUser($this->company_id)
|
|
||||||
: $this->company_id;
|
|
||||||
|
|
||||||
$this->parseLastAuditDate();
|
$this->parseLastAuditDate();
|
||||||
|
|
||||||
$this->merge([
|
$this->merge([
|
||||||
'asset_tag' => $this->asset_tag ?? Asset::autoincrement_asset(),
|
'asset_tag' => $this->asset_tag ?? Asset::autoincrement_asset(),
|
||||||
'company_id' => $idForCurrentUser,
|
'company_id' => Company::getIdForCurrentUser($this->company_id),
|
||||||
'assigned_to' => $assigned_to ?? null,
|
'assigned_to' => $assigned_to ?? null,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ class Location extends SnipeModel
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the model should inject it's identifier to the unique
|
* Whether the model should inject its identifier to the unique
|
||||||
* validation rules before attempting validation. If this property
|
* validation rules before attempting validation. If this property
|
||||||
* is not set in the model it will default to true.
|
* is not set in the model it will default to true.
|
||||||
*
|
*
|
||||||
|
|
|
@ -25,9 +25,15 @@
|
||||||
<label for="currency" class="col-md-3 control-label">
|
<label for="currency" class="col-md-3 control-label">
|
||||||
{{ trans('admin/locations/table.currency') }}
|
{{ trans('admin/locations/table.currency') }}
|
||||||
</label>
|
</label>
|
||||||
<div class="col-md-9">
|
<div class="col-md-7">
|
||||||
{{ Form::text('currency', old('currency', $item->currency), array('class' => 'form-control','placeholder' => 'USD', 'maxlength'=>'3', 'style'=>'width: 60px;', 'aria-label'=>'currency', 'required' => (Helper::checkIfRequired($item, 'currency')) ? true : '')) }}
|
<input class="form-control" style="width:100px" type="text" name="currency" aria-label="currency" id="currency" value="{{ old('currency', $item->currency) }}"{!! (Helper::checkIfRequired($item, 'currency')) ? ' required' : '' !!} maxlength="3" />
|
||||||
{!! $errors->first('currency', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
@error('currency')
|
||||||
|
<span class="alert-msg">
|
||||||
|
<x-icon type="x" />
|
||||||
|
{{ $message }}
|
||||||
|
</span>
|
||||||
|
@enderror
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -40,8 +46,13 @@
|
||||||
{{ trans('admin/locations/table.ldap_ou') }}
|
{{ trans('admin/locations/table.ldap_ou') }}
|
||||||
</label>
|
</label>
|
||||||
<div class="col-md-7">
|
<div class="col-md-7">
|
||||||
{{ Form::text('ldap_ou', old('ldap_ou', $item->ldap_ou), array('class' => 'form-control', 'required' => (Helper::checkIfRequired($item, 'ldap_ou')) ? true : '')) }}
|
<input class="form-control" type="text" name="ldap_ou" aria-label="ldap_ou" id="ldap_ou" value="{{ old('ldap_ou', $item->ldap_ou) }}"{!! (Helper::checkIfRequired($item, 'ldap_ou')) ? ' required' : '' !!} maxlength="191" />
|
||||||
{!! $errors->first('ldap_ou', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
@error('ldap_ou')
|
||||||
|
<span class="alert-msg">
|
||||||
|
<x-icon type="x" />
|
||||||
|
{{ $message }}
|
||||||
|
</span>
|
||||||
|
@enderror
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue