Merge branch 'develop'

# Conflicts:
#	upgrade.php
This commit is contained in:
snipe 2017-11-09 10:52:46 -08:00
commit c61887da21
13 changed files with 89 additions and 47 deletions

View file

@ -182,7 +182,6 @@ class AssetModelsController extends Controller
*/ */
public function selectlist(Request $request) public function selectlist(Request $request)
{ {
$this->authorize('view', AssetModel::class);
$assetmodels = AssetModel::select([ $assetmodels = AssetModel::select([
'models.id', 'models.id',

View file

@ -153,7 +153,6 @@ class CompaniesController extends Controller
*/ */
public function selectlist(Request $request) public function selectlist(Request $request)
{ {
$this->authorize('view', Company::class);
$companies = Company::select([ $companies = Company::select([
'companies.id', 'companies.id',

View file

@ -122,7 +122,6 @@ class DepartmentsController extends Controller
*/ */
public function selectlist(Request $request) public function selectlist(Request $request)
{ {
$this->authorize('view', Department::class);
$departments = Department::select([ $departments = Department::select([
'id', 'id',

View file

@ -132,7 +132,6 @@ class ManufacturersController extends Controller
*/ */
public function selectlist(Request $request) public function selectlist(Request $request)
{ {
$this->authorize('view', Manufacturers::class);
$manufacturers = Manufacturer::select([ $manufacturers = Manufacturer::select([
'id', 'id',

View file

@ -146,7 +146,6 @@ class SuppliersController extends Controller
*/ */
public function selectlist(Request $request) public function selectlist(Request $request)
{ {
$this->authorize('view', Supplier::class);
$suppliers = Supplier::select([ $suppliers = Supplier::select([
'id', 'id',

View file

@ -748,6 +748,7 @@ class SettingsController extends Controller
$setting->labels_fontsize = $request->input('labels_fontsize'); $setting->labels_fontsize = $request->input('labels_fontsize');
$setting->labels_pagewidth = $request->input('labels_pagewidth'); $setting->labels_pagewidth = $request->input('labels_pagewidth');
$setting->labels_pageheight = $request->input('labels_pageheight'); $setting->labels_pageheight = $request->input('labels_pageheight');
$setting->labels_display_company_name = $request->input('labels_display_company_name', '0');

View file

@ -42,6 +42,7 @@ class Asset extends Depreciable
*/ */
protected $injectUniqueIdentifier = true; protected $injectUniqueIdentifier = true;
// We set these as protected dates so that they will be easily accessible via Carbon
protected $dates = [ protected $dates = [
'created_at', 'created_at',
'updated_at', 'updated_at',
@ -138,7 +139,7 @@ class Asset extends Depreciable
* @param User $user * @param User $user
* @param User $admin * @param User $admin
* @param Carbon $checkout_at * @param Carbon $checkout_at
* @param null $expected_checkin * @param Carbon $expected_checkin
* @param string $note * @param string $note
* @param null $name * @param null $name
* @return bool * @return bool
@ -710,7 +711,7 @@ class Asset extends Depreciable
*/ */
public function scopeInModelList($query, array $modelIdListing) public function scopeInModelList($query, array $modelIdListing)
{ {
return $query->whereIn('model_id', $modelIdListing); return $query->whereIn('assets.model_id', $modelIdListing);
} }
/** /**

View file

@ -93,7 +93,7 @@ class CheckoutNotification extends Notification
'first_name' => $target->present()->fullName(), 'first_name' => $target->present()->fullName(),
'item_name' => $item->present()->name(), 'item_name' => $item->present()->name(),
'checkout_date' => $item->last_checkout, 'checkout_date' => $item->last_checkout,
'expected_checkin' => $item->expected_checkin, 'expected_checkin' => $item->expected_checkin->format('Y-m-d'),
'item_tag' => $item->asset_tag, 'item_tag' => $item->asset_tag,
'note' => $this->params['note'], 'note' => $this->params['note'],
'item_serial' => $item->serial, 'item_serial' => $item->serial,

View file

@ -0,0 +1,34 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class LabelsDisplayCompanyName extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('settings', function (Blueprint $table) {
$table->boolean('labels_display_company_name')->default(0);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('settings', function ($table) {
$table->dropColumn(
'labels_display_company_name'
);
});
}
}

View file

@ -112,28 +112,32 @@
@endif @endif
<div class="qr_text"> <div class="qr_text">
<div class="pull-left">
@if ($settings->qr_text!='') @if ($settings->qr_text!='')
<div class="pull-left">
<strong>{{ $settings->qr_text }}</strong> <strong>{{ $settings->qr_text }}</strong>
<br> <br>
@endif
</div> </div>
@endif
@if (($settings->labels_display_company_name=='1') && ($asset->company))
<div class="pull-left"> <div class="pull-left">
C: {{ $asset->company->name }}
</div>
@endif
@if (($settings->labels_display_name=='1') && ($asset->name!='')) @if (($settings->labels_display_name=='1') && ($asset->name!=''))
<div class="pull-left">
N: {{ $asset->name }} N: {{ $asset->name }}
@endif
</div> </div>
<div class="pull-left"> @endif
@if (($settings->labels_display_tag=='1') && ($asset->asset_tag!='')) @if (($settings->labels_display_tag=='1') && ($asset->asset_tag!=''))
T: {{ $asset->asset_tag }}
@endif
</div>
<div class="pull-left"> <div class="pull-left">
@if (($settings->labels_display_serial=='1') && ($asset->serial!='')) T: {{ $asset->asset_tag }}
S: {{ $asset->serial }} </div>
@endif
@if (($settings->labels_display_serial=='1') && ($asset->serial!=''))
<div class="pull-left">
S: {{ $asset->serial }}
</div>
@endif @endif
</div>
</div> </div>
@if ((($settings->alt_barcode_enabled=='1') && $settings->alt_barcode!='')) @if ((($settings->alt_barcode_enabled=='1') && $settings->alt_barcode!=''))

View file

@ -1,17 +1,20 @@
<!-- Purchase Cost --> <!-- Purchase Cost -->
<div class="form-group {{ $errors->has('purchase_cost') ? ' has-error' : '' }}"> <div class="form-group {{ $errors->has('purchase_cost') ? ' has-error' : '' }}">
<label for="purchase_cost" class="col-md-3 control-label">{{ trans('general.purchase_cost') }} </label> <label for="purchase_cost" class="col-md-3 control-label">{{ trans('general.purchase_cost') }}</label>
<div class="col-md-2"> <div class="col-md-9">
<div class="input-group"> <div class="input-group col-md-3" style="padding-left: 0px;">
<span class="input-group-addon"> <input class="form-control" type="text" name="purchase_cost" id="purchase_cost" value="{{ Input::old('purchase_cost', \App\Helpers\Helper::formatCurrencyOutput($item->purchase_cost)) }}" />
<span class="input-group-addon">
@if (isset($currency_type)) @if (isset($currency_type))
{{ $currency_type }} {{ $currency_type }}
@else @else
{{ $snipeSettings->default_currency }} {{ $snipeSettings->default_currency }}
@endif @endif
</span> </span>
<input class="col-md-2 form-control" type="text" name="purchase_cost" id="purchase_cost" value="{{ Input::old('purchase_cost', \App\Helpers\Helper::formatCurrencyOutput($item->purchase_cost)) }}" /> </div>
{!! $errors->first('purchase_cost', '<span class="alert-msg"><i class="fa fa-times"></i> :message</span>') !!} <div class="col-md-9" style="padding-left: 0px;">
</div> {!! $errors->first('purchase_cost', '<span class="alert-msg"><i class="fa fa-times"></i> :message</span>') !!}
</div> </div>
</div>
</div> </div>

View file

@ -3,7 +3,7 @@
<label for="purchase_date" class="col-md-3 control-label">{{ trans('general.purchase_date') }}</label> <label for="purchase_date" class="col-md-3 control-label">{{ trans('general.purchase_date') }}</label>
<div class="input-group col-md-3"> <div class="input-group col-md-3">
<div class="input-group date" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-autoclose="true"> <div class="input-group date" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-autoclose="true">
<input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="purchase_date" id="purchase_date" value="{{ Input::old('purchase_date', $item->purchase_date) }}"> <input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="purchase_date" id="purchase_date" value="{{ Input::old('purchase_date', $item->purchase_date->format('Y-m-d')) }}">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div> </div>
{!! $errors->first('purchase_date', '<span class="alert-msg"><i class="fa fa-times"></i> :message</span>') !!} {!! $errors->first('purchase_date', '<span class="alert-msg"><i class="fa fa-times"></i> :message</span>') !!}

View file

@ -45,7 +45,7 @@
{{ Form::label('labels_per_page', trans('admin/settings/general.labels_per_page')) }} {{ Form::label('labels_per_page', trans('admin/settings/general.labels_per_page')) }}
</div> </div>
<div class="col-md-9"> <div class="col-md-9">
{{ Form::text('labels_per_page', Input::old('labels_per_page', $setting->labels_per_page), array('class' => 'form-control','style' => 'width: 100px;')) }} {{ Form::text('labels_per_page', Input::old('labels_per_page', $setting->labels_per_page), ['class' => 'form-control','style' => 'width: 100px;']) }}
{!! $errors->first('labels_per_page', '<span class="alert-msg">:message</span>') !!} {!! $errors->first('labels_per_page', '<span class="alert-msg">:message</span>') !!}
</div> </div>
</div> </div>
@ -56,7 +56,7 @@
</div> </div>
<div class="col-md-2 form-group"> <div class="col-md-2 form-group">
<div class="input-group"> <div class="input-group">
{{ Form::text('labels_fontsize', Input::old('labels_fontsize', $setting->labels_fontsize), array('class' => 'form-control')) }} {{ Form::text('labels_fontsize', Input::old('labels_fontsize', $setting->labels_fontsize), ['class' => 'form-control']) }}
<div class="input-group-addon">{{ trans('admin/settings/general.text_pt') }}</div> <div class="input-group-addon">{{ trans('admin/settings/general.text_pt') }}</div>
</div> </div>
</div> </div>
@ -71,13 +71,13 @@
</div> </div>
<div class="col-md-3 form-group"> <div class="col-md-3 form-group">
<div class="input-group"> <div class="input-group">
{{ Form::text('labels_width', Input::old('labels_width', $setting->labels_width), array('class' => 'form-control')) }} {{ Form::text('labels_width', Input::old('labels_width', $setting->labels_width), ['class' => 'form-control']) }}
<div class="input-group-addon">{{ trans('admin/settings/general.width_w') }}</div> <div class="input-group-addon">{{ trans('admin/settings/general.width_w') }}</div>
</div> </div>
</div> </div>
<div class="col-md-3 form-group" style="margin-left: 10px"> <div class="col-md-3 form-group" style="margin-left: 10px">
<div class="input-group"> <div class="input-group">
{{ Form::text('labels_height', Input::old('labels_height', $setting->labels_height), array('class' => 'form-control')) }} {{ Form::text('labels_height', Input::old('labels_height', $setting->labels_height), ['class' => 'form-control']) }}
<div class="input-group-addon">{{ trans('admin/settings/general.height_h') }}</div> <div class="input-group-addon">{{ trans('admin/settings/general.height_h') }}</div>
</div> </div>
</div> </div>
@ -93,13 +93,13 @@
</div> </div>
<div class="col-md-3 form-group"> <div class="col-md-3 form-group">
<div class="input-group"> <div class="input-group">
{{ Form::text('labels_display_sgutter', Input::old('labels_display_sgutter', $setting->labels_display_sgutter), array('class' => 'form-control')) }} {{ Form::text('labels_display_sgutter', Input::old('labels_display_sgutter', $setting->labels_display_sgutter), ['class' => 'form-control']) }}
<div class="input-group-addon">{{ trans('admin/settings/general.horizontal') }}</div> <div class="input-group-addon">{{ trans('admin/settings/general.horizontal') }}</div>
</div> </div>
</div> </div>
<div class="col-md-3 form-group" style="margin-left: 10px"> <div class="col-md-3 form-group" style="margin-left: 10px">
<div class="input-group"> <div class="input-group">
{{ Form::text('labels_display_bgutter', Input::old('labels_display_bgutter', $setting->labels_display_bgutter), array('class' => 'form-control')) }} {{ Form::text('labels_display_bgutter', Input::old('labels_display_bgutter', $setting->labels_display_bgutter), ['class' => 'form-control']) }}
<div class="input-group-addon">{{ trans('admin/settings/general.vertical') }}</div> <div class="input-group-addon">{{ trans('admin/settings/general.vertical') }}</div>
</div> </div>
</div> </div>
@ -115,21 +115,21 @@
</div> </div>
<div class="col-md-3 form-group"> <div class="col-md-3 form-group">
<div class="input-group" style="margin-bottom: 15px;"> <div class="input-group" style="margin-bottom: 15px;">
{{ Form::text('labels_pmargin_top', Input::old('labels_pmargin_top', $setting->labels_pmargin_top), array('class' => 'form-control')) }} {{ Form::text('labels_pmargin_top', Input::old('labels_pmargin_top', $setting->labels_pmargin_top), ['class' => 'form-control']) }}
<div class="input-group-addon">{{ trans('admin/settings/general.top') }}</div> <div class="input-group-addon">{{ trans('admin/settings/general.top') }}</div>
</div> </div>
<div class="input-group"> <div class="input-group">
{{ Form::text('labels_pmargin_right', Input::old('labels_pmargin_right', $setting->labels_pmargin_right), array('class' => 'form-control')) }} {{ Form::text('labels_pmargin_right', Input::old('labels_pmargin_right', $setting->labels_pmargin_right), ['class' => 'form-control']) }}
<div class="input-group-addon">{{ trans('admin/settings/general.right') }}</div> <div class="input-group-addon">{{ trans('admin/settings/general.right') }}</div>
</div> </div>
</div> </div>
<div class="col-md-3 form-group" style="margin-left: 10px; "> <div class="col-md-3 form-group" style="margin-left: 10px; ">
<div class="input-group" style="margin-bottom: 15px;"> <div class="input-group" style="margin-bottom: 15px;">
{{ Form::text('labels_pmargin_bottom', Input::old('labels_pmargin_bottom', $setting->labels_pmargin_bottom), array('class' => 'form-control')) }} {{ Form::text('labels_pmargin_bottom', Input::old('labels_pmargin_bottom', $setting->labels_pmargin_bottom), ['class' => 'form-control']) }}
<div class="input-group-addon">{{ trans('admin/settings/general.bottom') }}</div> <div class="input-group-addon">{{ trans('admin/settings/general.bottom') }}</div>
</div> </div>
<div class="input-group"> <div class="input-group">
{{ Form::text('labels_pmargin_left', Input::old('labels_pmargin_left', $setting->labels_pmargin_left), array('class' => 'form-control')) }} {{ Form::text('labels_pmargin_left', Input::old('labels_pmargin_left', $setting->labels_pmargin_left), ['class' => 'form-control']) }}
<div class="input-group-addon">{{ trans('admin/settings/general.left') }}</div> <div class="input-group-addon">{{ trans('admin/settings/general.left') }}</div>
</div> </div>
</div> </div>
@ -145,13 +145,13 @@
</div> </div>
<div class="col-md-3 form-group"> <div class="col-md-3 form-group">
<div class="input-group"> <div class="input-group">
{{ Form::text('labels_pagewidth', Input::old('labels_pagewidth', $setting->labels_pagewidth), array('class' => 'form-control')) }} {{ Form::text('labels_pagewidth', Input::old('labels_pagewidth', $setting->labels_pagewidth), ['class' => 'form-control']) }}
<div class="input-group-addon">{{ trans('admin/settings/general.width_w') }}</div> <div class="input-group-addon">{{ trans('admin/settings/general.width_w') }}</div>
</div> </div>
</div> </div>
<div class="col-md-3 form-group" style="margin-left: 10px"> <div class="col-md-3 form-group" style="margin-left: 10px">
<div class="input-group"> <div class="input-group">
{{ Form::text('labels_pageheight', Input::old('labels_pageheight', $setting->labels_pageheight), array('class' => 'form-control')) }} {{ Form::text('labels_pageheight', Input::old('labels_pageheight', $setting->labels_pageheight), ['class' => 'form-control']) }}
<div class="input-group-addon">{{ trans('admin/settings/general.height_h') }}</div> <div class="input-group-addon">{{ trans('admin/settings/general.height_h') }}</div>
</div> </div>
</div> </div>
@ -168,17 +168,21 @@
<div class="col-md-9"> <div class="col-md-9">
<div class="checkbox"> <div class="checkbox">
<label> <label>
{{ Form::checkbox('labels_display_name', '1', Input::old('labels_display_name', $setting->labels_display_name),array('class' => 'minimal')) }} {{ Form::checkbox('labels_display_name', '1', Input::old('labels_display_name', $setting->labels_display_name),['class' => 'minimal']) }}
{{ trans('admin/hardware/form.name') }} {{ trans('admin/hardware/form.name') }}
</label> </label>
<label> <label>
{{ Form::checkbox('labels_display_serial', '1', Input::old('labels_display_serial', $setting->labels_display_serial),array('class' => 'minimal')) }} {{ Form::checkbox('labels_display_serial', '1', Input::old('labels_display_serial', $setting->labels_display_serial),['class' => 'minimal']) }}
{{ trans('admin/hardware/form.serial') }} {{ trans('admin/hardware/form.serial') }}
</label> </label>
<label> <label>
{{ Form::checkbox('labels_display_tag', '1', Input::old('labels_display_tag', $setting->labels_display_tag),array('class' => 'minimal')) }} {{ Form::checkbox('labels_display_tag', '1', Input::old('labels_display_tag', $setting->labels_display_tag),['class' => 'minimal']) }}
{{ trans('admin/hardware/form.tag') }} {{ trans('admin/hardware/form.tag') }}
</label> </label>
<label>
{{ Form::checkbox('labels_display_company_name', '1', Input::old('labels_display_company_name', $setting->labels_display_company_name),['class' => 'minimal']) }}
{{ trans('admin/companies/table.name') }}
</label>
</div> <!--/.CHECKBOX--> </div> <!--/.CHECKBOX-->
</div> <!--/.col-md-9--> </div> <!--/.col-md-9-->
</div> <!--/.form-group--> </div> <!--/.form-group-->