diff --git a/app/controllers/account/ProfileController.php b/app/controllers/account/ProfileController.php index eadb0ebcf0..0f2a108c44 100755 --- a/app/controllers/account/ProfileController.php +++ b/app/controllers/account/ProfileController.php @@ -5,6 +5,7 @@ use Input; use Redirect; use Sentry; use Validator; +use Location; use View; class ProfileController extends AuthorizedController { @@ -20,7 +21,11 @@ class ProfileController extends AuthorizedController { $user = Sentry::getUser(); // Show the page - return View::make('frontend/account/profile', compact('user')); + + $location_list = array('' => 'Select One') + Location::lists('name', 'id'); + + // Show the page + return View::make('frontend/account/profile', compact('user'))->with('location_list',$location_list); } /** @@ -34,6 +39,7 @@ class ProfileController extends AuthorizedController { $rules = array( 'first_name' => 'required|min:3', 'last_name' => 'required|min:3', + 'location_id' => 'required', 'website' => 'url', 'gravatar' => 'email', ); @@ -55,7 +61,7 @@ class ProfileController extends AuthorizedController { $user->first_name = Input::get('first_name'); $user->last_name = Input::get('last_name'); $user->website = Input::get('website'); - $user->country = Input::get('country'); + $user->location_id = Input::get('location_id'); $user->gravatar = Input::get('gravatar'); $user->save(); diff --git a/app/controllers/admin/ModelsController.php b/app/controllers/admin/ModelsController.php index dbc82ce7d5..3e239d7ec7 100644 --- a/app/controllers/admin/ModelsController.php +++ b/app/controllers/admin/ModelsController.php @@ -40,7 +40,7 @@ class ModelsController extends AdminController { // Show the page $depreciation_list = array('' => 'Do Not Depreciate') + Depreciation::lists('name', 'id'); $manufacturer_list = array('' => 'Select One') + Manufacturer::lists('name', 'id'); - $category_list = array('' => '') + DB::table('categories')->lists('name', 'id'); + $category_list = array('' => '') + DB::table('categories')->whereNull('deleted_at')->lists('name', 'id'); $view = View::make('backend/models/edit'); $view->with('category_list',$category_list); $view->with('depreciation_list',$depreciation_list); @@ -81,7 +81,7 @@ class ModelsController extends AdminController { if($model->save()) { // Redirect to the new model page - return Redirect::to("assets/models")->with('success', Lang::get('admin/models/message.create.success')); + return Redirect::to("hardware/models")->with('success', Lang::get('admin/models/message.create.success')); } } else @@ -92,7 +92,7 @@ class ModelsController extends AdminController { } // Redirect to the model create page - return Redirect::to('assets/models/create')->with('error', Lang::get('admin/models/message.create.error')); + return Redirect::to('hardware/models/create')->with('error', Lang::get('admin/models/message.create.error')); } diff --git a/app/models/Model.php b/app/models/Model.php index 7bf72ebd47..b9fab8c017 100644 --- a/app/models/Model.php +++ b/app/models/Model.php @@ -7,6 +7,7 @@ class Model extends Elegant { 'name' => 'required|alpha_space|min:3', 'modelno' => 'alpha_space|min:1', 'category_id' => 'required|integer', + 'manufacturer_id' => 'required|integer', ); public function assets() diff --git a/app/views/backend/hardware/edit.blade.php b/app/views/backend/hardware/edit.blade.php index 0e863ea24f..26e210ba75 100755 --- a/app/views/backend/hardware/edit.blade.php +++ b/app/views/backend/hardware/edit.blade.php @@ -119,10 +119,10 @@
- +
{{ Form::select('status_id', $statuslabel_list , Input::old('status_id', $asset->status_id), array('class'=>'select2', 'style'=>'width:350px')) }} - {{ $errors->first('depreciation_id', ' :message') }} + {{ $errors->first('status_id', ' :message') }}
diff --git a/app/views/backend/hardware/index.blade.php b/app/views/backend/hardware/index.blade.php index 3f2038f2b9..b18733d232 100755 --- a/app/views/backend/hardware/index.blade.php +++ b/app/views/backend/hardware/index.blade.php @@ -109,11 +109,13 @@ Assets :: @endif + @if ($asset->status_id < 1 ) @if ($asset->assigned_to != 0) Checkin @else Checkout @endif + @endif diff --git a/app/views/backend/models/edit.blade.php b/app/views/backend/models/edit.blade.php index c106733fb3..5fcae473c8 100755 --- a/app/views/backend/models/edit.blade.php +++ b/app/views/backend/models/edit.blade.php @@ -12,80 +12,80 @@ {{-- Page content --}} @section('content') - +
+ +
- -
- -
- -
- - {{ $errors->first('name', ':message') }} -
+ + +
+ +
+ + {{ $errors->first('name', ' :message') }} +
-
- -
- - {{ $errors->first('modelno', ':message') }} -
+ +
+ +
+ + {{ $errors->first('modelno', ' :message') }} +
- -
- -
- {{ Form::select('manufacturer_id', $manufacturer_list , Input::old('manufacturer_id', $model->manufacturer_id), array('class'=>'select2', 'style'=>'width:250px')) }} - {{ $errors->first('manufacturer_id', ':message') }} -
+
+ +
+ {{ Form::select('manufacturer_id', $manufacturer_list , Input::old('manufacturer_id', $model->manufacturer_id), array('class'=>'select2', 'style'=>'width:350px')) }} + {{ $errors->first('manufacturer_id', ' :message') }} +
-
- -
- {{ Form::select('depreciation_id', $depreciation_list , Input::old('depreciation_id', $model->depreciation_id), array('class'=>'select2', 'style'=>'width:250px')) }} - {{ $errors->first('depreciation_id', ':message') }} -
+
+ +
+ {{ Form::select('depreciation_id', $depreciation_list , Input::old('depreciation_id', $model->depreciation_id), array('class'=>'select2', 'style'=>'width:350px')) }} + {{ $errors->first('depreciation_id', ' :message') }} +
-
- -
- {{ Form::select('category_id', $category_list , Input::old('category_id', $model->category_id), array('class'=>'select2', 'style'=>'width:250px')) }} - {{ $errors->first('category_id', ':message') }} -
+
+ +
+ {{ Form::select('category_id', $category_list , Input::old('category_id', $model->category_id), array('class'=>'select2', 'style'=>'width:350px')) }} + {{ $errors->first('category_id', ' :message') }} +
- -
- - -
-
- @lang('general.cancel') - -
-
+ +
+ +
+ Cancel + +
+
+
@stop diff --git a/app/views/backend/models/index.blade.php b/app/views/backend/models/index.blade.php index 3d07be6314..e4f492518e 100755 --- a/app/views/backend/models/index.blade.php +++ b/app/views/backend/models/index.blade.php @@ -8,15 +8,15 @@ Asset Models :: {{-- Page content --}} @section('content') -