Merge branch 'develop'

This commit is contained in:
snipe 2017-10-07 07:44:30 -07:00
commit 0b3d3de30f
5 changed files with 79 additions and 1353 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,75 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Models\Setting;
use App\Models\User;
class ResetDemoSettings extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'snipeit:demo-settings';
/**
* The console command description.
*
* @var string
*/
protected $description = 'This will reset the Snipe-IT demo settings back to default. ';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$this->info('Resetting the demo settings.');
$settings = Setting::first();
$settings->per_page = 20;
$settings->site_name = 'Snipe-IT Asset Management Demo';
$settings->auto_increment_assets = 1;
$settings->logo = 'logo.png';
$settings->alert_email = 'service@snipe-it.io';
$settings->header_color = null;
$settings->barcode_type = 'QRCODE';
$settings->default_currency = 'USD';
$settings->brand = 3;
$settings->ldap_enabled = 0;
$settings->full_multiple_companies_support = 1;
$settings->alt_barcode = 'C128';
$settings->email_domain = 'snipeitapp.com';
$settings->email_format = 'filastname';
$settings->username_format = 'filastname';
$settings->date_display_format = 'D M d, Y';
$settings->time_display_format = 'g:iA';
$settings->thumbnail_max_h = '30';
$settings->locale = 'en';
$settings->save();
if ($user = User::where('username', '=', 'admin')->first()) {
$user->locale = 'en';
$user->save();
}
}
}

View file

@ -26,7 +26,7 @@ class Kernel extends ConsoleKernel
Commands\LdapSync::class,
Commands\FixDoubleEscape::class,
Commands\RecryptFromMcrypt::class,
Commands\DemoData::class
Commands\ResetDemoSettings::class
];
/**

View file

@ -12,6 +12,8 @@
$factory->define(App\Models\Accessory::class, function (Faker\Generator $faker) {
return [
'user_id' => 1,
'model_number' => $faker->numberBetween(1000000, 50000000),
'location_id' => rand(1,5),
];
});

View file

@ -66,7 +66,7 @@
<a href="{{ route('settings.localization.index') }}" class="btn btn-lg btn-white"><i class="fa fa-globe fa-3x"></i></a>
<br>
Localization
<p class="help-block">Language, time zones</p>
<p class="help-block">Language, date display</p>
</div>
</div>