mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
note box is now missing when unchecking setting
This commit is contained in:
parent
06e3bb7fd1
commit
e00a1aec02
|
@ -118,7 +118,7 @@ class AssetCheckinController extends Controller
|
||||||
|
|
||||||
$settings = \App\Models\Setting::getSettings();
|
$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'));
|
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();
|
$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'));
|
return redirect()->to("hardware/$assetId/checkout")->with('error', trans('admin/hardware/message.update.no_note'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,11 +21,12 @@ class AssetCheckinRequest extends Request
|
||||||
*/
|
*/
|
||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
$setting =
|
$settings = \App\Models\Setting::getSettings();
|
||||||
|
|
||||||
$rules = [];
|
$rules = [];
|
||||||
|
|
||||||
if($setting->require_checkinout_notes == '1') {
|
if($settings->require_checkinout_notes) {
|
||||||
|
// dd($settings->require_checkinout_notes);
|
||||||
$rules['notes'] = 'required|string|nullable';
|
$rules['notes'] = 'required|string|nullable';
|
||||||
}
|
}
|
||||||
return $rules;
|
return $rules;
|
||||||
|
|
|
@ -21,6 +21,8 @@ class AssetCheckoutRequest extends Request
|
||||||
*/
|
*/
|
||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
|
$settings = \App\Models\Setting::getSettings();
|
||||||
|
|
||||||
$rules = [
|
$rules = [
|
||||||
'assigned_user' => 'required_without_all:assigned_asset,assigned_location',
|
'assigned_user' => 'required_without_all:assigned_asset,assigned_location',
|
||||||
'assigned_asset' => 'required_without_all:assigned_user,assigned_location',
|
'assigned_asset' => 'required_without_all:assigned_user,assigned_location',
|
||||||
|
@ -35,6 +37,11 @@ class AssetCheckoutRequest extends Request
|
||||||
'nullable',
|
'nullable',
|
||||||
'date'
|
'date'
|
||||||
],
|
],
|
||||||
|
|
||||||
|
if($settings->require_checkinout_notes) {
|
||||||
|
// dd($settings->require_checkinout_notes);
|
||||||
|
$rules['notes'] = 'required|string|nullable';
|
||||||
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
return $rules;
|
return $rules;
|
||||||
|
|
Loading…
Reference in a new issue