mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 21:24:13 -08:00
Only show importer progress if on command line. It broke error display from web.
This commit is contained in:
parent
8c00bad6d0
commit
d6dd449445
|
@ -103,8 +103,10 @@ class ObjectImportCommand extends Command {
|
||||||
$this->accessories = Accessory::All(['name']);
|
$this->accessories = Accessory::All(['name']);
|
||||||
$this->consumables = Consumable::All(['name']);
|
$this->consumables = Consumable::All(['name']);
|
||||||
$this->customfields = CustomField::All(['name']);
|
$this->customfields = CustomField::All(['name']);
|
||||||
|
$bar = NULL;
|
||||||
|
if(!$this->option('web-importer')) {
|
||||||
$bar = $this->output->createProgressBar(count($newarray));
|
$bar = $this->output->createProgressBar(count($newarray));
|
||||||
|
}
|
||||||
// Loop through the records
|
// Loop through the records
|
||||||
DB::transaction(function() use (&$newarray, $bar){
|
DB::transaction(function() use (&$newarray, $bar){
|
||||||
Model::unguard();
|
Model::unguard();
|
||||||
|
@ -180,12 +182,16 @@ class ObjectImportCommand extends Command {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!$this->option('web-importer')) {
|
||||||
$bar->advance();
|
$bar->advance();
|
||||||
|
}
|
||||||
$this->log('------------- Action Summary ----------------');
|
$this->log('------------- Action Summary ----------------');
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if(!$this->option('web-importer')) {
|
||||||
$bar->finish();
|
$bar->finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$this->log('=====================================');
|
$this->log('=====================================');
|
||||||
|
|
Loading…
Reference in a new issue