mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-01 08:57:27 -08:00
Merge remote-tracking branch 'origin/develop'
This commit is contained in:
commit
8b70a7f216
|
@ -137,7 +137,7 @@ class AssetImporter extends ItemImporter
|
||||||
//-- user_id is a property of the abstract class Importer, which this class inherits from and it's setted by
|
//-- user_id is a property of the abstract class Importer, which this class inherits from and it's setted by
|
||||||
//-- the class that needs to use it (command importer or GUI importer inside the project).
|
//-- the class that needs to use it (command importer or GUI importer inside the project).
|
||||||
if (isset($target)) {
|
if (isset($target)) {
|
||||||
$asset->fresh()->checkOut($target, $this->user_id, date('Y-m-d H:i:s'));
|
$asset->fresh()->checkOut($target, $this->user_id, date('Y-m-d H:i:s'), null, $asset->notes, $asset->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -547,6 +547,28 @@ class Asset extends Depreciable
|
||||||
return strtolower(class_basename($this->assigned_type));
|
return strtolower(class_basename($this->assigned_type));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is annoying, but because we don't say "assets" in our route names, we have to make an exception here
|
||||||
|
* @todo - normalize the route names - API endpoint URLS can stay the same
|
||||||
|
*
|
||||||
|
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||||
|
* @since [v6.1.0]
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function targetShowRoute()
|
||||||
|
{
|
||||||
|
$route = str_plural($this->assignedType());
|
||||||
|
if ($route=='assets') {
|
||||||
|
return 'hardware';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $route;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the asset's location based on default RTD location
|
* Get the asset's location based on default RTD location
|
||||||
*
|
*
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
@php
|
@php
|
||||||
$checkin = Helper::getFormattedDateObject($asset->expected_checkin, 'date');
|
$checkin = Helper::getFormattedDateObject($asset->expected_checkin, 'date');
|
||||||
@endphp
|
@endphp
|
||||||
| [{{ $asset->present()->name }}]({{ route('hardware.show', ['hardware' => $asset->id]) }}) | [{{ $asset->assigned->present()->fullName }}]({{ route('users.show', ['user'=>$asset->assigned->id]) }}) | {{ $checkin['formatted'] }}
|
| [{{ $asset->present()->name }}]({{ route('hardware.show', ['hardware' => $asset->id]) }}) | [{{ $asset->assigned->present()->fullName }}]({{ route($asset->targetShowRoute().'.show', [$asset->assigned->id]) }}) | {{ $checkin['formatted'] }}
|
||||||
@endforeach
|
@endforeach
|
||||||
@endcomponent
|
@endcomponent
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue