mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 06:17:28 -08:00
this works
This commit is contained in:
parent
c9101f4d97
commit
4a7df470f0
|
@ -135,11 +135,10 @@ class AssetImporter extends ItemImporter
|
|||
$asset->{$custom_field} = $val;
|
||||
}
|
||||
}
|
||||
|
||||
//this sets an attribute on the Loggable trait for the action log
|
||||
$asset->setImported(true);
|
||||
if ($asset->save()) {
|
||||
|
||||
//$asset->logCreate(trans('general.importer.import_note'));
|
||||
$asset->setImported(true);
|
||||
$this->log('Asset '.$this->item['name'].' with serial number '.$this->item['serial'].' was created');
|
||||
|
||||
// If we have a target to checkout to, lets do so.
|
||||
|
|
|
@ -8,7 +8,8 @@ use Illuminate\Support\Facades\Auth;
|
|||
|
||||
trait Loggable
|
||||
{
|
||||
public ?bool $imported = false; // Import note attribute
|
||||
// an attribute for setting whether or not the item was imported
|
||||
public ?bool $imported = false;
|
||||
|
||||
/**
|
||||
* @author Daniel Meltzer <dmeltzer.devel@gmail.com>
|
||||
|
@ -25,11 +26,6 @@ trait Loggable
|
|||
$this->imported = $bool;
|
||||
}
|
||||
|
||||
public function getImported(): bool
|
||||
{
|
||||
return $this->imported;
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Daniel Meltzer <dmeltzer.devel@gmail.com>
|
||||
* @since [v3.4]
|
||||
|
|
|
@ -109,9 +109,8 @@ class AssetObserver
|
|||
$logAction->item_id = $asset->id;
|
||||
$logAction->created_at = date('Y-m-d H:i:s');
|
||||
$logAction->user_id = Auth::id();
|
||||
$logAction->note = 'poop';
|
||||
if($asset->getImported()) {
|
||||
$logAction->note = "this asset was imported";
|
||||
if($asset->imported) {
|
||||
$logAction->note = trans('general.importer.import_note');
|
||||
}
|
||||
$logAction->logaction('create');
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue