Skip to content

A free open source IT asset/license management system

Added show in nav for status label views and controller

snipead22293f4b7a
diff --git a/app/Http/Controllers/StatuslabelsController.php b/app/Http/Controllers/StatuslabelsController.php
index fb4cab69ef..f680ec5696 100755
--- a/app/Http/Controllers/StatuslabelsController.php
+++ b/app/Http/Controllers/StatuslabelsController.php
@@ -120,6 +120,7 @@ class StatuslabelsController extends Controller
$statuslabel->pending = $statustype['pending'];
$statuslabel->archived = $statustype['archived'];
$statuslabel->color = e(Input::get('color'));
+ $statuslabel->show_in_nav = e(Input::get('show_in_nav'),0);
// Was the asset created?
@@ -208,6 +209,7 @@ class StatuslabelsController extends Controller
$statuslabel->pending = $statustype['pending'];
$statuslabel->archived = $statustype['archived'];
$statuslabel->color = e(Input::get('color'));
+ $statuslabel->show_in_nav = e(Input::get('show_in_nav'),0);
// Was the asset created?
@@ -258,7 +260,7 @@ class StatuslabelsController extends Controller
public function getDatatable()
{
- $statuslabels = Statuslabel::select(array('id','name','deployable','pending','archived','color'))
+ $statuslabels = Statuslabel::select(array('id','name','deployable','pending','archived','color','show_in_nav'))
->whereNull('deleted_at');
if (Input::has('search')) {
@@ -314,6 +316,7 @@ class StatuslabelsController extends Controller
'type' => e($label_type),
'name' => e($statuslabel->name),
'color' => $color,
+ 'show_in_nav' => ($statuslabel->show_in_nav=='1') ? trans('general.yes') : trans('general.no'),
'actions' => $actions
);
}
diff --git a/resources/views/layouts/default.blade.php b/resources/views/layouts/default.blade.php
index 9b119d9374..66af2f7779 100644
--- a/resources/views/layouts/default.blade.php
+++ b/resources/views/layouts/default.blade.php
@@ -405,6 +405,16 @@
<li>
<a href="{{ URL::to('hardware') }}">@lang('general.list_all')</a>
</li>
+
+ <?php $status_navs = \App\Models\Statuslabel::where('show_in_nav','=',1)->get(); ?>
+ @if (count($status_navs) > 0)
+ <li class="divider">&nbsp;</li>
+ @foreach ($status_navs as $status_nav)
+ <li><a href="{{ URL::to('hardware?status_id='.$status_nav->id) }}"}> {{ $status_nav->name }}</a></li>
+ @endforeach
+ @endif
+
+
<li{!! (Request::query('status') == 'Deployed' ? ' class="active"' : '') !!}>
<a href="{{ URL::to('hardware?status=Deployed') }}">@lang('general.deployed')
</a>
@@ -489,8 +499,7 @@
<li><a href="{{ URL::to('reports/assets') }}" {{ (Request::is('reports/assets') ? ' class="active"' : '') }} >@lang('general.asset_report')</a></li>
<li><a href="{{ URL::to('reports/unaccepted_assets') }}" {{ (Request::is('reports/unaccepted_assets') ? ' class="active"' : '') }} >@lang('general.unaccepted_asset_report')</a></li>
<li><a href="{{ URL::to('reports/accessories') }}" {{ (Request::is('reports/accessories') ? ' class="active"' : '') }} >@lang('general.accessory_report')</a></li>
- <li><a href="{{ URL::to('reports/custom') }}" {{ (Request::is('reports/custom') ? ' class="active"' : '') }} >@lang('general.custom_report')</a></li>
-
+ <li><a href="{{ URL::to('reports/custom') }}" {{ (Request::is('reports/custom') ? ' class="active"' : '') }}>@lang('general.custom_report')</a></li>
</ul>
</li>
@endcan
diff --git a/resources/views/statuslabels/edit.blade.php b/resources/views/statuslabels/edit.blade.php
index 0cec6ac2e3..efb9e5dfb8 100755
--- a/resources/views/statuslabels/edit.blade.php
+++ b/resources/views/statuslabels/edit.blade.php
@@ -38,9 +38,8 @@
<div class="box box-default">
<div class="box-body">
<!-- Asset Title -->
- <div class="form-group {{ $errors->has('name') ? ' has-error' : '' }}">
+ <div class="form-group{{ $errors->has('name') ? ' has-error' : '' }}">
<label for="name" class="col-md-3 control-label">{{ trans('general.name') }}</label>
- </label>
<div class="col-md-7 required">
<input class="form-control" type="text" name="name" id="name" value="{{ Input::old('name', $statuslabel->name) }}" />
{!! $errors->first('name', '<span class="alert-msg"><i class="fa fa-times"></i> :message</span>') !!}
@@ -48,9 +47,8 @@
</div>
<!-- Label type -->
- <div class="form-group {{ $errors->has('statuslabel_types') ? 'has-error' : '' }}">
- <label for="statuslabel_types" class="col-md-3 control-label">{{ trans('admin/statuslabels/table.status_type') }}
- </label>
+ <div class="form-group{{ $errors->has('statuslabel_types') ? ' has-error' : '' }}">
+ <label for="statuslabel_types" class="col-md-3 control-label">{{ trans('admin/statuslabels/table.status_type') }} </label>
<div class="col-md-7 required">
{{ Form::select('statuslabel_types', $statuslabel_types, $statuslabel->getStatuslabelType(), array('class'=>'select2', 'style'=>'min-width:400px')) }}
{!! $errors->first('statuslabel_types', '<span class="alert-msg"><i class="fa fa-times"></i> :message</span>') !!}
@@ -65,14 +63,12 @@
{{ Form::text('color', Input::old('color', $statuslabel->color), array('class' => 'form-control', 'style' => 'width: 100px;', 'maxlength'=>'10')) }}
<div class="input-group-addon"><i></i></div>
</div><!-- /.input group -->
-
-
{!! $errors->first('header_color', '<span class="alert-msg">:message</span>') !!}
</div>
</div>
<!-- Note -->
- <div class="form-group {{ $errors->has('notes') ? 'has-error' : '' }}">
+ <div class="form-group{{ $errors->has('notes') ? ' has-error' : '' }}">
<label for="notes" class="col-md-3 control-label">{{ trans('admin/hardware/form.notes') }}</label>
<div class="col-md-7">
<textarea class="col-md-12 form-control" id="notes" name="notes">{{ Input::old('notes', $statuslabel->notes) }}</textarea>
@@ -80,6 +76,15 @@
</div>
</div>
+ <!-- Show in Nav -->
+ <div class="form-group{{ $errors->has('notes') ? ' has-error' : '' }}">
+
+ <label class="col-md-offset-3" style="padding-left: 15px;">
+ <input type="checkbox" value="1" name="show_in_nav" id="show_in_nav" class="minimal" {{ Input::old('show_in_nav', $statuslabel->show_in_nav) == '1' ? ' checked="checked"' : '' }}> {{ trans('admin/statuslabels/table.show_in_nav') }}
+ </label>
+ </div>
+
+
diff --git a/resources/views/statuslabels/index.blade.php b/resources/views/statuslabels/index.blade.php
index 6541bb35da..d040596b48 100755
--- a/resources/views/statuslabels/index.blade.php
+++ b/resources/views/statuslabels/index.blade.php
@@ -32,6 +32,7 @@
<th data-sortable="true" data-field="name">{{ trans('admin/statuslabels/table.name') }}</th>
<th data-sortable="false" data-field="type">{{ trans('admin/statuslabels/table.status_type') }}</th>
<th data-sortable="false" data-field="color">{{ trans('admin/statuslabels/table.color') }}</th>
+ <th data-sortable="true" data-field="show_in_nav">{{ trans('admin/statuslabels/table.show_in_nav') }}</th>
<th data-switchable="false" data-searchable="false" data-sortable="false" data-field="actions">{{ trans('table.actions') }}</th>
</tr>
</thead>