diff --git a/app/controllers/AuthController.php b/app/controllers/AuthController.php index 018640ea90f7..d3c309b075e4 100755 --- a/app/controllers/AuthController.php +++ b/app/controllers/AuthController.php @@ -338,7 +338,7 @@ public function getLogout() Sentry::logout(); // Redirect to the users page - return Redirect::route('assets')->with('success', 'You have successfully logged out!'); + return Redirect::route('home')->with('success', 'You have successfully logged out!'); } } diff --git a/app/controllers/admin/LicensesController.php b/app/controllers/admin/LicensesController.php index 8e1bdfb76f2c..da033bb89fe9 100644 --- a/app/controllers/admin/LicensesController.php +++ b/app/controllers/admin/LicensesController.php @@ -344,6 +344,7 @@ public function postCheckin($seatId) // Declare the rules for the form validation $rules = array( 'note' => 'alpha_space', + 'notes' => 'alpha_space', ); // Create a new validator instance from our validation rules diff --git a/app/controllers/admin/UsersController.php b/app/controllers/admin/UsersController.php index f57f8086a978..90023c4a9109 100755 --- a/app/controllers/admin/UsersController.php +++ b/app/controllers/admin/UsersController.php @@ -27,11 +27,11 @@ class UsersController extends AdminController { * @var array */ protected $validationRules = array( - 'first_name' => 'required|alpha_space|min:3', - 'last_name' => 'required|alpha_space|min:3', + 'first_name' => 'required|alpha_space|min:2', + 'last_name' => 'required|alpha_space|min:2', 'email' => 'required|email|unique:users,email', - 'password' => 'required|between:3,32', - 'password_confirm' => 'required|between:3,32|same:password', + 'password' => 'required|between:10,32', + 'password_confirm' => 'required|between:10,32|same:password', ); /** diff --git a/app/models/Asset.php b/app/models/Asset.php index 64dd2fe5f650..9ffe50744b19 100644 --- a/app/models/Asset.php +++ b/app/models/Asset.php @@ -58,7 +58,7 @@ public function assigneduser() **/ public function assetloc() { - return $this->assigneduser->hasOne('Location'); + return $this->assigneduser->userloc(); } /** diff --git a/app/models/License.php b/app/models/License.php index 8a6e7a1aef46..577a16662e72 100644 --- a/app/models/License.php +++ b/app/models/License.php @@ -17,6 +17,7 @@ class License extends Elegant { 'seats' => 'required|min:1|integer', 'license_email' => 'email', 'note' => 'alpha_space', + 'notes' => 'alpha_space', ); public function assignedusers() @@ -25,13 +26,6 @@ public function assignedusers() } - /** - * Get the asset's location based on the assigned user - **/ - public function assetloc() - { - return $this->assignedusers->hasOne('Location'); - } /** * Get asset logs for this asset diff --git a/app/models/User.php b/app/models/User.php index 5a3311c266a3..d1e4fae82bae 100755 --- a/app/models/User.php +++ b/app/models/User.php @@ -44,7 +44,7 @@ public function assets() public function licenses() { - return $this->belongsToMany('License', 'license_seats', 'assigned_to', 'license_id')->withTrashed(); + return $this->belongsToMany('License', 'license_seats', 'assigned_to', 'license_id')->withTrashed()->withPivot('id'); } @@ -62,7 +62,7 @@ public function userlog() **/ public function userloc() { - return $this->hasOne('Location','id')->withTrashed(); + return $this->belongsTo('Location','location_id')->withTrashed(); } } diff --git a/app/routes.php b/app/routes.php index 59db888558d7..71cebb330795 100755 --- a/app/routes.php +++ b/app/routes.php @@ -18,6 +18,7 @@ { Route::get('/', array('as' => '', 'uses' => 'Controllers\Admin\AssetsController@getIndex')); + Route::get('/', array('as' => 'hardware', 'uses' => 'Controllers\Admin\AssetsController@getIndex')); Route::get('create', array('as' => 'create/hardware', 'uses' => 'Controllers\Admin\AssetsController@getCreate')); Route::post('create', 'Controllers\Admin\AssetsController@postCreate'); Route::get('{assetId}/edit', array('as' => 'update/hardware', 'uses' => 'Controllers\Admin\AssetsController@getEdit')); diff --git a/app/validators.php b/app/validators.php index e8aef4ec601b..db1ff768cd7f 100644 --- a/app/validators.php +++ b/app/validators.php @@ -2,5 +2,5 @@ Validator::extend('alpha_space', function($attribute,$value,$parameters) { - return preg_match("/^[-+:?()_,!. a-zA-Z0-9]+$/",$value); + return preg_match("/^[-+:?'()_,!. a-zA-Z0-9]+$/",$value); }); diff --git a/app/views/backend/hardware/checkin.blade.php b/app/views/backend/hardware/checkin.blade.php index 3eee74af63c7..0985b49ca62d 100644 --- a/app/views/backend/hardware/checkin.blade.php +++ b/app/views/backend/hardware/checkin.blade.php @@ -13,13 +13,10 @@ {{-- Page content --}} @section('content')
diff --git a/app/views/backend/hardware/checkout.blade.php b/app/views/backend/hardware/checkout.blade.php index d8e4e5ff4e2e..bd7b64bbe01b 100644 --- a/app/views/backend/hardware/checkout.blade.php +++ b/app/views/backend/hardware/checkout.blade.php @@ -13,16 +13,17 @@ {{-- Page content --}} @section('content') diff --git a/app/views/backend/hardware/clone.blade.php b/app/views/backend/hardware/clone.blade.php index e56eef5bf4d6..ca51051fe353 100644 --- a/app/views/backend/hardware/clone.blade.php +++ b/app/views/backend/hardware/clone.blade.php @@ -9,13 +9,12 @@ {{-- Page content --}} @section('content') diff --git a/app/views/backend/hardware/edit.blade.php b/app/views/backend/hardware/edit.blade.php index 0c08bf063dfc..a7bfa51b3324 100755 --- a/app/views/backend/hardware/edit.blade.php +++ b/app/views/backend/hardware/edit.blade.php @@ -13,21 +13,23 @@ {{-- Page content --}} @section('content') diff --git a/app/views/backend/hardware/index.blade.php b/app/views/backend/hardware/index.blade.php index bfbf0a4ce6b3..be6551636f2c 100755 --- a/app/views/backend/hardware/index.blade.php +++ b/app/views/backend/hardware/index.blade.php @@ -23,7 +23,11 @@ {{-- Page content --}} @section('content') diff --git a/app/views/backend/hardware/view.blade.php b/app/views/backend/hardware/view.blade.php index 9e21b09c65e0..4d0835086a21 100644 --- a/app/views/backend/hardware/view.blade.php +++ b/app/views/backend/hardware/view.blade.php @@ -10,26 +10,29 @@ @section('content')
+ +
+ + + +
+

History for {{ $asset->asset_tag }} ({{ $asset->name }}) -
- - - -

diff --git a/app/views/backend/licenses/checkin.blade.php b/app/views/backend/licenses/checkin.blade.php index c60b2d60fab1..d6781b9af121 100644 --- a/app/views/backend/licenses/checkin.blade.php +++ b/app/views/backend/licenses/checkin.blade.php @@ -9,12 +9,12 @@ {{-- Page content --}} @section('content') diff --git a/app/views/backend/licenses/checkout.blade.php b/app/views/backend/licenses/checkout.blade.php index 4422b57633a2..880baffbe430 100644 --- a/app/views/backend/licenses/checkout.blade.php +++ b/app/views/backend/licenses/checkout.blade.php @@ -9,12 +9,13 @@ {{-- Page content --}} @section('content') diff --git a/app/views/backend/licenses/edit.blade.php b/app/views/backend/licenses/edit.blade.php index e9f6568d6b6e..17c6c569d202 100755 --- a/app/views/backend/licenses/edit.blade.php +++ b/app/views/backend/licenses/edit.blade.php @@ -13,6 +13,15 @@ {{-- Page content --}} @section('content') diff --git a/app/views/backend/licenses/index.blade.php b/app/views/backend/licenses/index.blade.php index e7cd60e56239..1c4a09536218 100755 --- a/app/views/backend/licenses/index.blade.php +++ b/app/views/backend/licenses/index.blade.php @@ -8,13 +8,11 @@ {{-- Page content --}} @section('content') diff --git a/app/views/backend/licenses/view.blade.php b/app/views/backend/licenses/view.blade.php index 4ee6abf83e31..7010483c59e2 100644 --- a/app/views/backend/licenses/view.blade.php +++ b/app/views/backend/licenses/view.blade.php @@ -10,25 +10,24 @@ @section('content') diff --git a/app/views/backend/locations/edit.blade.php b/app/views/backend/locations/edit.blade.php index d7f1c39c8fdc..f43a0923a6c7 100755 --- a/app/views/backend/locations/edit.blade.php +++ b/app/views/backend/locations/edit.blade.php @@ -15,6 +15,11 @@ {{-- Page content --}} @section('content') diff --git a/app/views/backend/locations/index.blade.php b/app/views/backend/locations/index.blade.php index 3032c9420760..9afaf8c75bfe 100755 --- a/app/views/backend/locations/index.blade.php +++ b/app/views/backend/locations/index.blade.php @@ -9,13 +9,12 @@ {{-- Page content --}} @section('content')
diff --git a/app/views/backend/manufacturers/edit.blade.php b/app/views/backend/manufacturers/edit.blade.php index 5753efc84b66..5a1f29cc69a0 100755 --- a/app/views/backend/manufacturers/edit.blade.php +++ b/app/views/backend/manufacturers/edit.blade.php @@ -13,6 +13,11 @@ {{-- Page content --}} @section('content') diff --git a/app/views/backend/manufacturers/index.blade.php b/app/views/backend/manufacturers/index.blade.php index 80b76d169bca..45ad2d4e45ef 100755 --- a/app/views/backend/manufacturers/index.blade.php +++ b/app/views/backend/manufacturers/index.blade.php @@ -9,13 +9,12 @@ {{-- Page content --}} @section('content') diff --git a/app/views/backend/models/edit.blade.php b/app/views/backend/models/edit.blade.php index e5456361de39..d679f63e227f 100755 --- a/app/views/backend/models/edit.blade.php +++ b/app/views/backend/models/edit.blade.php @@ -13,16 +13,16 @@ {{-- Page content --}} @section('content') diff --git a/app/views/backend/models/index.blade.php b/app/views/backend/models/index.blade.php index 2c4e7164d280..1efaef40c227 100755 --- a/app/views/backend/models/index.blade.php +++ b/app/views/backend/models/index.blade.php @@ -9,13 +9,12 @@ {{-- Page content --}} @section('content')
Seat {{ $count }} @if ($licensedto->assigned_to) - + {{ $licensedto->user->fullName() }} @endif @@ -109,10 +108,9 @@ {{ $log->action_type }} - @if (isset($log->checkedout_to)) + @if (($log->checkedout_to) && ($log->checkedout_to > 0 )) - {{ $log->userlog->fullName() }} - + {{ $log->userlog->fullName() }} @endif
diff --git a/app/views/backend/models/view.blade.php b/app/views/backend/models/view.blade.php index a3e03abf11c9..8492fd7359d3 100644 --- a/app/views/backend/models/view.blade.php +++ b/app/views/backend/models/view.blade.php @@ -10,17 +10,17 @@ @section('content') - - + @endforeach @@ -137,8 +134,7 @@ @elseif ((isset($log->assetlog->name)) && ($log->assetlog->deleted_at!='')) {{ $log->assetlog->name }} (deleted) @else - missing asset - ({{ $log->assetlog->name }}) ({{ $log->assetlog->deleted_at }}) + missing asset ({{ $log->assetlog->name }}) ({{ $log->assetlog->deleted_at }}) @endif @@ -165,12 +161,14 @@
Contact {{ $user->first_name }}
- @if (isset($user->location_id)) + @if ($user->location_id) @endif
    -
  • {{ $user->userloc->address }} {{ $user->userloc->address2 }}
  • -
  • {{ $user->userloc->city }}, {{ $user->userloc->state }} {{ $user->userloc->zip }}

  • + @if ($user->location_id) +
  • {{ $user->userloc->address }} {{ $user->userloc->address2 }}
  • +
  • {{ $user->userloc->city }}, {{ $user->userloc->state }} {{ $user->userloc->zip }}

  • + @endif @if ($user->phone)
  • {{ $user->phone }}
  • @endif
{{ $license->serial }} {{ $license->name }} Checkin Checkin +
{{ $log->adminlog->fullName() }}