mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-24 04:03:34 -08:00
Save correct id in action log if the bulk-checkin is of type license
This commit is contained in:
parent
482a7b2a3a
commit
0d4e9c183b
|
@ -231,8 +231,14 @@ class BulkUsersController extends Controller
|
||||||
protected function logItemCheckinAndDelete($items, $itemType)
|
protected function logItemCheckinAndDelete($items, $itemType)
|
||||||
{
|
{
|
||||||
foreach ($items as $item) {
|
foreach ($items as $item) {
|
||||||
|
$item_id = $item->id;
|
||||||
$logAction = new Actionlog();
|
$logAction = new Actionlog();
|
||||||
$logAction->item_id = $item->id;
|
|
||||||
|
if($itemType == License::class){
|
||||||
|
$item_id = $item->license_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
$logAction->item_id = $item_id;
|
||||||
// We can't rely on get_class here because the licenses/accessories fetched above are not eloquent models, but simply arrays.
|
// We can't rely on get_class here because the licenses/accessories fetched above are not eloquent models, but simply arrays.
|
||||||
$logAction->item_type = $itemType;
|
$logAction->item_type = $itemType;
|
||||||
$logAction->target_id = $item->assigned_to;
|
$logAction->target_id = $item->assigned_to;
|
||||||
|
|
Loading…
Reference in a new issue