mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-03 18:07:41 -08:00
requested changes
This commit is contained in:
parent
6fef127cd1
commit
17706f150e
|
@ -118,7 +118,7 @@ class AssetCheckinController extends Controller
|
|||
|
||||
$settings = \App\Models\Setting::getSettings();
|
||||
|
||||
if($settings->require_checkinout_notes=="1" && (is_null($request->note))) {
|
||||
if($settings->require_checkinout_notes && (is_null($request->note))) {
|
||||
return redirect()->to("hardware/$assetId/checkin")->with('error', trans('admin/hardware/message.update.no_note'));
|
||||
}
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ class AssetCheckoutController extends Controller
|
|||
|
||||
$settings = \App\Models\Setting::getSettings();
|
||||
|
||||
if($settings->require_checkinout_notes=="1" && (is_null($request->note))) {
|
||||
if($settings->require_checkinout_notes= && (is_null($request->note))) {
|
||||
return redirect()->to("hardware/$assetId/checkout")->with('error', trans('admin/hardware/message.update.no_note'));
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,21 @@ class AssetCheckinRequest extends Request
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
$rules = [];
|
||||
|
||||
if($this->settings->require_checkinout_notes) {
|
||||
$rules['notes'] = 'required|string';
|
||||
}
|
||||
return $rules;
|
||||
}
|
||||
|
||||
public function response(array $errors)
|
||||
{
|
||||
return $this->redirector->back()->withInput()->withErrors($errors, $this->errorBag);
|
||||
|
|
|
@ -99,6 +99,7 @@ class Setting extends Model
|
|||
|
||||
protected $casts = [
|
||||
'label2_asset_logo' => 'boolean',
|
||||
'require_checkinout_notes' => 'boolean',
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue