diff --git a/app/Console/Commands/ObjectImportCommand.php b/app/Console/Commands/ObjectImportCommand.php index 1dcc141a67..eff28c8f76 100644 --- a/app/Console/Commands/ObjectImportCommand.php +++ b/app/Console/Commands/ObjectImportCommand.php @@ -341,7 +341,7 @@ class ObjectImportCommand extends Command $this->log('Asset Model ' . $asset_model_name . ' with model number ' . $asset_modelno . ' was created'); return $asset_model; } else { - $this->jsonError('Asset Model ' . $asset_model_name, $asset_model->getErrors()); + $this->jsonError('Asset Model "' . $asset_model_name . '"', $asset_model->getErrors()); return $asset_model; } } else { @@ -388,7 +388,7 @@ class ObjectImportCommand extends Command $this->log('Category ' . $asset_category . ' was created'); return $category; } else { - $this->jsonError('Category '. $asset_category, $category->getErrors()); + $this->jsonError('Category "'. $asset_category. '"', $category->getErrors()); return $category; } } else { @@ -463,7 +463,7 @@ class ObjectImportCommand extends Command $this->log('Status ' . $asset_statuslabel_name . ' was created'); return $status; } else { - $this->jsonError('Status '. $asset_statuslabel_name, $status->getErrors()); + $this->jsonError('Status "'. $asset_statuslabel_name . '"', $status->getErrors()); return $status; } } else { @@ -512,7 +512,7 @@ class ObjectImportCommand extends Command $this->log('Manufacturer ' . $manufacturer->name . ' was created'); return $manufacturer; } else { - $this->jsonError('Manufacturer '. $manufacturer->name, $manufacturer->getErrors()); + $this->jsonError('Manufacturer "'. $manufacturer->name . '"', $manufacturer->getErrors()); return $manufacturer; } @@ -696,7 +696,7 @@ class ObjectImportCommand extends Command if ($user->save()) { $this->log('User '.$first_name.' created'); } else { - $this->jsonError('User', $user->getErrors()); + $this->jsonError('User "' . $first_name . '"', $user->getErrors()); } } else { diff --git a/resources/views/hardware/import.blade.php b/resources/views/hardware/import.blade.php index 9beab7c995..cb8ff0f714 100644 --- a/resources/views/hardware/import.blade.php +++ b/resources/views/hardware/import.blade.php @@ -137,13 +137,13 @@ // We use this instead of the fail option, since our API // returns a 200 OK status which always shows as "success" - if (data && data.jqXHR.responseJSON.error && data.jqXHR.responseJSON && data.jqXHR.responseJSON.error) { + if (data && data.jqXHR.responseJSON && data.jqXHR.responseJSON.error) { $('#progress-bar-text').html(data.jqXHR.responseJSON.error); $('.progress-bar').removeClass('progress-bar-warning').addClass('progress-bar-danger').css('width','100%'); $('.progress-checkmark').fadeIn('fast').html(''); //console.log(data.jqXHR.responseJSON.error); } else { - $('.progress-bar').removeClass('progress-bar-warning').addClass('progress-bar-success').css('width','100%'); + $('.progress-bar').removeClass('progress-bar-warning').removeClass('progress-bar-danger').addClass('progress-bar-success').css('width','100%'); $('.progress-checkmark').fadeIn('fast'); $('#progress-container').delay(950).css('visibility', 'visible'); $('.progress-bar-text').html('Finished!');