mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-03 18:07:41 -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();
|
||||
|
||||
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'));
|
||||
}
|
||||
|
||||
|
|
|
@ -21,11 +21,12 @@ class AssetCheckinRequest extends Request
|
|||
*/
|
||||
public function rules()
|
||||
{
|
||||
$setting =
|
||||
$settings = \App\Models\Setting::getSettings();
|
||||
|
||||
$rules = [];
|
||||
|
||||
if($setting->require_checkinout_notes == '1') {
|
||||
if($settings->require_checkinout_notes) {
|
||||
// dd($settings->require_checkinout_notes);
|
||||
$rules['notes'] = 'required|string|nullable';
|
||||
}
|
||||
return $rules;
|
||||
|
|
|
@ -21,6 +21,8 @@ class AssetCheckoutRequest extends Request
|
|||
*/
|
||||
public function rules()
|
||||
{
|
||||
$settings = \App\Models\Setting::getSettings();
|
||||
|
||||
$rules = [
|
||||
'assigned_user' => 'required_without_all:assigned_asset,assigned_location',
|
||||
'assigned_asset' => 'required_without_all:assigned_user,assigned_location',
|
||||
|
@ -35,6 +37,11 @@ class AssetCheckoutRequest extends Request
|
|||
'nullable',
|
||||
'date'
|
||||
],
|
||||
|
||||
if($settings->require_checkinout_notes) {
|
||||
// dd($settings->require_checkinout_notes);
|
||||
$rules['notes'] = 'required|string|nullable';
|
||||
}
|
||||
];
|
||||
|
||||
return $rules;
|
||||
|
|
Loading…
Reference in a new issue