mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
Create log record and send EULA when creating a new asset that’s checked out
This commit is contained in:
parent
17d5e40e02
commit
1612562f41
|
@ -265,13 +265,8 @@ class AssetsController extends Controller
|
|||
if ($asset->save()) {
|
||||
|
||||
if (Input::get('assigned_to')!='') {
|
||||
$logaction = new Actionlog();
|
||||
$logaction->asset_id = $asset->id;
|
||||
$logaction->checkedout_to = $asset->assigned_to;
|
||||
$logaction->asset_type = 'hardware';
|
||||
$logaction->user_id = Auth::user()->id;
|
||||
$logaction->note = e(Input::get('note'));
|
||||
$log = $logaction->logaction('checkout');
|
||||
$user = User::find(e(Input::get('assigned_to')));
|
||||
$asset->checkOutToUser($user, Auth::user(), date('Y-m-d h:i:s'), '', 'Checked out on asset creation', e(Input::get('name')));
|
||||
}
|
||||
// Redirect to the asset listing page
|
||||
\Session::flash('success', trans('admin/hardware/message.create.success'));
|
||||
|
|
Loading…
Reference in a new issue