Skip to content

Commit

Permalink
Merge branch 'refs/heads/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
snipe committed Nov 29, 2013
2 parents 0382183 + 839d01a commit ddabdac
Show file tree
Hide file tree
Showing 35 changed files with 194 additions and 184 deletions.
2 changes: 1 addition & 1 deletion app/controllers/AuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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!');
}

}
1 change: 1 addition & 0 deletions app/controllers/admin/LicensesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions app/controllers/admin/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
);

/**
Expand Down
2 changes: 1 addition & 1 deletion app/models/Asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function assigneduser()
**/
public function assetloc()
{
return $this->assigneduser->hasOne('Location');
return $this->assigneduser->userloc();
}

/**
Expand Down
8 changes: 1 addition & 7 deletions app/models/License.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions app/models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}


Expand All @@ -62,7 +62,7 @@ public function userlog()
**/
public function userloc()
{
return $this->hasOne('Location','id')->withTrashed();
return $this->belongsTo('Location','location_id')->withTrashed();
}

}
1 change: 1 addition & 0 deletions app/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down
2 changes: 1 addition & 1 deletion app/validators.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
5 changes: 1 addition & 4 deletions app/views/backend/hardware/checkin.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,10 @@
{{-- Page content --}}
@section('content')
<div class="page-header">
<h3>
Checkin Asset

<div class="pull-right">
<a href="{{ route('hardware') }}" class="btn-flat gray"><i class="icon-circle-arrow-left icon-white"></i> Back</a>
</div>
</h3>
<h3> Checkin Asset </h3>
</div>

<form class="form-horizontal" method="post" action="" autocomplete="off">
Expand Down
13 changes: 7 additions & 6 deletions app/views/backend/hardware/checkout.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@
{{-- Page content --}}
@section('content')
<div class="page-header">

<div class="pull-right">
<a href="{{ route('hardware') }}" class="btn-flat gray"><i class="icon-circle-arrow-left icon-white"></i> Back</a>
</div>

<h3>
@if ($asset->id)
Checkout Asset to User
Checkout Asset to User
@else
Create Asset
Create Asset
@endif

<div class="pull-right">
<a href="{{ route('hardware') }}" class="btn-flat gray"><i class="icon-circle-arrow-left icon-white"></i> Back</a>
</div>
</h3>
</div>

Expand Down
5 changes: 2 additions & 3 deletions app/views/backend/hardware/clone.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@
{{-- Page content --}}
@section('content')
<div class="page-header">
<h3>
Clone Asset

<div class="pull-right">
<a href="{{ route('hardware') }}" class="btn-flat gray"><i class="icon-circle-arrow-left icon-white"></i> Back</a>
</div>
</h3>

<h3>Clone Asset</h3>
</div>


Expand Down
20 changes: 11 additions & 9 deletions app/views/backend/hardware/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,23 @@
{{-- Page content --}}
@section('content')
<div class="page-header">

<div class="pull-right">
@if ($asset->id)
<a href="{{ route('view/hardware',$asset->id) }}" class="btn-flat gray"><i class="icon-circle-arrow-left icon-white"></i> Back</a>
@else
<a href="{{ route('hardware') }}" class="btn-flat gray"><i class="icon-circle-arrow-left icon-white"></i> Back</a>
@endif
</div>

<h3>
@if ($asset->id)
Asset Update
Asset Update
@else
Create Asset
Create Asset
@endif

<div class="pull-right">
@if ($asset->id)
<a href="{{ route('view/hardware',$asset->id) }}" class="btn-flat gray"><i class="icon-circle-arrow-left icon-white"></i> Back</a>
@else
<a href="{{ route('hardware') }}" class="btn-flat gray"><i class="icon-circle-arrow-left icon-white"></i> Back</a>
@endif

</div>
</h3>
</div>

Expand Down
14 changes: 6 additions & 8 deletions app/views/backend/hardware/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
{{-- Page content --}}
@section('content')
<div class="page-header">
<h3>
<div class="pull-right">
<a href="{{ route('create/hardware') }}" class="btn-flat success"><i class="icon-plus-sign icon-white"></i> Create New</a>
</div>

<h3>
@if (Input::get('Pending') || Input::get('Undeployable') || Input::get('RTD') || Input::get('Deployed'))
@if (Input::get('Pending'))
Pending
Expand All @@ -37,14 +41,8 @@
@else
All
@endif

Assets

<div class="pull-right">
<a href="{{ route('create/hardware') }}" class="btn-flat success"><i class="icon-plus-sign icon-white"></i> Create New</a>

</div>
</h3>
</h3>

</div>

Expand Down
37 changes: 20 additions & 17 deletions app/views/backend/hardware/view.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,29 @@
@section('content')
<div id="pad-wrapper" class="user-profile">
<!-- header -->

<div class="btn-group pull-right">
<button class="btn glow">Actions</button>
<button class="btn glow dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu">

@if ($asset->status_id == 1)
@if ($asset->assigned_to != 0)
<li><a href="{{ route('checkin/hardware', $asset->id) }}" class="btn-flat info">Checkin</a></li>
@endif
@elseif ($asset->status_id == 0)
<li><a href="{{ route('checkout/hardware', $asset->id) }}" class="btn-flat success">Checkout</a></li>
@endif
<li><a href="{{ route('update/hardware', $asset->id) }}">Edit Asset</a></li>
<li><a href="{{ route('clone/hardware', $asset->id) }}">Clone Asset</a></li>
</ul>
</div>

<h3 class="name">History for {{ $asset->asset_tag }} ({{ $asset->name }})

<div class="btn-group pull-right">
<button class="btn glow">Actions</button>
<button class="btn glow dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu">

@if ($asset->status_id == 1)
@if ($asset->assigned_to != 0)
<li><a href="{{ route('checkin/hardware', $asset->id) }}" class="btn-flat info">Checkin</a></li>
@endif
@elseif ($asset->status_id == 0)
<li><a href="{{ route('checkout/hardware', $asset->id) }}" class="btn-flat success">Checkout</a></li>
@endif
<li><a href="{{ route('update/hardware', $asset->id) }}">Edit Asset</a></li>
<li><a href="{{ route('clone/hardware', $asset->id) }}">Clone Asset</a></li>
</ul>
</div>
</h3>
<div class="row-fluid profile">
<!-- bio, new note & orders column -->
Expand Down
10 changes: 5 additions & 5 deletions app/views/backend/licenses/checkin.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
{{-- Page content --}}
@section('content')
<div class="page-header">
<h3>Checkin License</h3>

<div class="pull-right">
<a href="{{ route('assets') }}" class="btn-flat gray"><i class="icon-circle-arrow-left icon-white"></i> Back</a>
</div>
</h3>
<div class="pull-right">
<a href="{{ route('licenses') }}" class="btn-flat gray"><i class="icon-circle-arrow-left icon-white"></i> Back</a>
</div>

<h3>Checkin License</h3>
</div>


Expand Down
9 changes: 5 additions & 4 deletions app/views/backend/licenses/checkout.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
{{-- Page content --}}
@section('content')
<div class="page-header">

<div class="pull-right">
<a href="{{ route('licenses') }}" class="btn-flat gray"><i class="icon-circle-arrow-left icon-white"></i> Back</a>
</div>

<h3>Checkout License to User</h3>

<div class="pull-right">
<a href="{{ route('assets') }}" class="btn-flat gray"><i class="icon-circle-arrow-left icon-white"></i> Back</a>
</div>
</h3>
</div>

<form class="form-horizontal" method="post" action="" autocomplete="off">
Expand Down
17 changes: 10 additions & 7 deletions app/views/backend/licenses/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,23 @@
{{-- Page content --}}
@section('content')
<div class="page-header">

<div class="pull-right">
@if ($license->id)
<a href="{{ route('view/license',$license->id) }}" class="btn-flat gray"><i class="icon-circle-arrow-left icon-white"></i> Back</a>
@else
<a href="{{ route('licenses') }}" class="btn-flat gray"><i class="icon-circle-arrow-left icon-white"></i> Back</a>
@endif
</div>

<h3>
@if ($license->id)
Update License
@else
Create License
@endif

<div class="pull-right">
@if ($license->id)
<a href="{{ route('view/license',$license->id) }}" class="btn-flat gray"><i class="icon-circle-arrow-left icon-white"></i> Back</a>
@else
<a href="{{ route('licenses') }}" class="btn-flat gray"><i class="icon-circle-arrow-left icon-white"></i> Back</a>
@endif
</div>

</h3>
</div>

Expand Down
10 changes: 4 additions & 6 deletions app/views/backend/licenses/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@
{{-- Page content --}}
@section('content')
<div class="page-header">
<h3>
Software Licenses
<div class="pull-right">
<a href="{{ route('create/licenses') }}" class="btn-flat success"><i class="icon-plus-sign icon-white"></i> Create New</a>
</div>

<div class="pull-right">
<a href="{{ route('create/licenses') }}" class="btn-flat success"><i class="icon-plus-sign icon-white"></i> Create New</a>
</div>
</h3>
<h3>Software Licenses</h3>
</div>

<table id="example">
Expand Down
Loading

0 comments on commit ddabdac

Please sign in to comment.