Skip to content

Commit

Permalink
Fixes #367 - added model number to dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
snipe committed Nov 21, 2014
1 parent 1b41c97 commit 89a2b87
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion app/controllers/admin/AssetsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,14 @@ public function getCreate()
{

// Grab the dropdown list of models
$model_list = array('' => '') + Model::orderBy('name', 'asc')->lists('name', 'id');
//$model_list = array('' => 'Select a Model') + Model::orderBy('name', 'asc')->lists('name'.' '. 'modelno', 'id');

$model_list = array('' => 'Select a Model') + DB::table('models')
->select(DB::raw('concat(name," / ",modelno) as name, id'))->orderBy('name', 'asc')
->orderBy('modelno', 'asc')
->lists('name', 'id');


$supplier_list = array('' => '') + Supplier::orderBy('name', 'asc')->lists('name', 'id');
$assigned_to = array('' => 'Select a User') + DB::table('users')->select(DB::raw('concat (first_name," ",last_name) as full_name, id'))->whereNull('deleted_at')->lists('full_name', 'id');
$location_list = array('' => '') + Location::orderBy('name', 'asc')->lists('name', 'id');
Expand Down
2 changes: 1 addition & 1 deletion app/views/backend/hardware/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
<i class='icon-asterisk'></i></label>
</label>
<div class="col-md-7">
{{ Form::select('model_id', $model_list , Input::old('model_id', $asset->model_id), array('class'=>'select2', 'style'=>'min-width:350px')) }}
{{ Form::select('model_id', $model_list , Input::old('model_id', $asset->model_id), array('class'=>'select2', 'style'=>'min-width:400px')) }}
{{ $errors->first('model_id', '<span class="alert-msg"><i class="icon-remove-sign"></i> :message</span>') }}
</div>
</div>
Expand Down

0 comments on commit 89a2b87

Please sign in to comment.