mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Merge remote-tracking branch 'origin/develop'
This commit is contained in:
commit
5be993df8d
|
@ -103,19 +103,19 @@ class ItemImporter extends Importer
|
||||||
/**
|
/**
|
||||||
* Parse row to determine what (if anything) we should checkout to.
|
* Parse row to determine what (if anything) we should checkout to.
|
||||||
* @param array $row CSV Row being parsed
|
* @param array $row CSV Row being parsed
|
||||||
* @return SnipeModel Model to be checked out to
|
* @return ?SnipeModel Model to be checked out to
|
||||||
*/
|
*/
|
||||||
protected function determineCheckout($row)
|
protected function determineCheckout($row)
|
||||||
{
|
{
|
||||||
|
if (get_class($this) == LocationImporter::class) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// We only support checkout-to-location for asset, so short circuit otherwise.
|
// We only support checkout-to-location for asset, so short circuit otherwise.
|
||||||
if (get_class($this) != AssetImporter::class) {
|
if (get_class($this) != AssetImporter::class) {
|
||||||
return $this->createOrFetchUser($row);
|
return $this->createOrFetchUser($row);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (get_class($this) != LocationImporter::class) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (strtolower($this->item['checkout_class']) === 'location' && $this->findCsvMatch($row, 'checkout_location') != null ) {
|
if (strtolower($this->item['checkout_class']) === 'location' && $this->findCsvMatch($row, 'checkout_location') != null ) {
|
||||||
return Location::findOrFail($this->createOrFetchLocation($this->findCsvMatch($row, 'checkout_location')));
|
return Location::findOrFail($this->createOrFetchLocation($this->findCsvMatch($row, 'checkout_location')));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue