Merge branch 'refs/heads/develop'

This commit is contained in:
snipe
2013-11-19 18:28:46 -05:00
19 changed files with 836 additions and 93 deletions
+55 -4
View File
@@ -7,6 +7,7 @@ use Asset;
use User;
use Redirect;
use DB;
use Actionlog;
use Model;
use Depreciation;
use Sentry;
@@ -29,6 +30,12 @@ class AssetsController extends AdminController {
return View::make('backend/assets/index', compact('assets'));
}
public function getReports()
{
// Grab all the assets
$assets = Asset::orderBy('created_at', 'DESC')->get();
return View::make('backend/reports/index', compact('assets'));
}
/**
* Asset create.
@@ -91,7 +98,6 @@ class AssetsController extends AdminController {
return Redirect::back()->withInput()->withErrors($errors);
}
// Redirect to the asset create page with an error
return Redirect::to('assets/create')->with('error', Lang::get('admin/assets/message.create.error'));
@@ -238,7 +244,6 @@ class AssetsController extends AdminController {
$assigned_to = e(Input::get('assigned_to'));
// Declare the rules for the form validation
$rules = array(
'assigned_to' => 'required|min:1'
@@ -265,10 +270,18 @@ class AssetsController extends AdminController {
// Update the asset data
$asset->assigned_to = e(Input::get('assigned_to'));
// Was the asset updated?
if($asset->save())
{
$logaction = new Actionlog();
$logaction->asset_id = $asset->id;
$logaction->checkedout_to = $asset->assigned_to;
$logaction->location_id = $assigned_to->location_id;
$logaction->user_id = Sentry::getUser()->id;
$log = $logaction->logaction('checkout');
// Redirect to the new asset page
return Redirect::to("admin")->with('success', Lang::get('admin/assets/message.checkout.success'));
}
@@ -279,6 +292,9 @@ class AssetsController extends AdminController {
/**
* Check in the item so that it can be checked out again to someone else
*
* @param int $assetId
* @return View
**/
public function postCheckin($assetId)
{
@@ -289,12 +305,26 @@ class AssetsController extends AdminController {
return Redirect::to('admin')->with('error', Lang::get('admin/assets/message.not_found'));
}
// Update the asset data
if (!is_null($asset->assigned_to)) {
$user = User::find($asset->assigned_to);
}
$logaction = new Actionlog();
$logaction->checkedout_to = $asset->assigned_to;
// Update the asset data to null, since it's being checked in
$asset->assigned_to = '';
// Was the asset updated?
if($asset->save())
{
$logaction->asset_id = $asset->id;
$logaction->location_id = NULL;
$logaction->user_id = Sentry::getUser()->id;
$log = $logaction->logaction('checkin from');
// Redirect to the new asset page
return Redirect::to("admin")->with('success', Lang::get('admin/assets/message.checkin.success'));
}
@@ -304,7 +334,28 @@ class AssetsController extends AdminController {
}
/**
* Get the asset information to present to the asset view page
*
* @param int $assetId
* @return View
**/
public function getView($assetId = null)
{
$asset = Asset::find($assetId);
if (isset($asset->id)) {
return View::make('backend/assets/view', compact('asset'));
} else {
// Prepare the error message
$error = Lang::get('admin/assets/message.does_not_exist', compact('id' ));
// Redirect to the user management page
return Redirect::route('assets')->with('error', $error);
}
}
+42 -2
View File
@@ -6,6 +6,7 @@ use Lang;
use License;
use Asset;
use User;
use Actionlog;
use DB;
use Redirect;
use Sentry;
@@ -261,6 +262,13 @@ class LicensesController extends AdminController {
// Was the asset updated?
if($license->save())
{
$logaction = new Actionlog();
$logaction->asset_id = $license->id;
$logaction->checkedout_to = $license->assigned_to;
$logaction->location_id = $assigned_to->location_id;
$logaction->user_id = Sentry::getUser()->id;
$log = $logaction->logaction('checkout');
// Redirect to the new asset page
return Redirect::to("admin/licenses")->with('success', Lang::get('admin/licenses/message.checkout.success'));
}
@@ -281,18 +289,50 @@ class LicensesController extends AdminController {
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/assets/message.not_found'));
}
$logaction = new Actionlog();
$logaction->checkedout_to = $license->assigned_to;
// Update the asset data
$license->assigned_to = '';
// Was the asset updated?
if($license->save())
{
$logaction->asset_id = $license->id;
$logaction->location_id = NULL;
$logaction->user_id = Sentry::getUser()->id;
$log = $logaction->logaction('checkin from');
// Redirect to the new asset page
return Redirect::to("admin/licenses")->with('success', Lang::get('admin/assets/message.checkout.success'));
return Redirect::to("admin/licenses")->with('success', Lang::get('admin/licenses/message.checkout.success'));
}
// Redirect to the asset management page with error
return Redirect::to("admin/licenses")->with('error', Lang::get('admin/assets/message.checkout.error'));
return Redirect::to("admin/licenses")->with('error', Lang::get('admin/licenses/message.checkout.error'));
}
/**
* Get the asset information to present to the asset view page
*
* @param int $assetId
* @return View
**/
public function getView($licenseId = null)
{
$license = Asset::find($licenseId);
if (isset($license->id)) {
return View::make('backend/licenses/view', compact('license'));
} else {
// Prepare the error message
$error = Lang::get('admin/licenses/message.does_not_exist', compact('id' ));
// Redirect to the user management page
return Redirect::route('licenses')->with('error', $error);
}
}
+20 -7
View File
@@ -11,6 +11,7 @@ use Input;
use User;
use Asset;
use Lang;
use Actionlog;
use Location;
use Redirect;
use Sentry;
@@ -410,15 +411,27 @@ class UsersController extends AdminController {
}
/**
* Get user info for user view
*
* @param int $userId
* @return View
*/
public function getView($userId = null)
{
$user = User::find($userId);
// Show the page
return View::make('backend/users/view', compact('user'));
$user = Sentry::getUserProvider()->createModel()->withTrashed()->find($userId);
if (isset($user->id)) {
return View::make('backend/users/view', compact('user'));
} else {
// Prepare the error message
$error = Lang::get('admin/users/message.user_not_found', compact('id' ));
// Redirect to the user management page
return Redirect::route('users')->with('error', $error);
}
}
}
@@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
class CreateAssetLogsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('asset_logs', function($table)
{
$table->increments('id');
$table->integer('user_id');
$table->string('action_type');
$table->integer('asset_id');
$table->integer('checkedout_to')->nullable;
$table->integer('location_id')->nullable;
$table->timestamp('added_on');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('asset_logs');
}
}
@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
class EditAddedOnAssetLogsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
DB::statement('ALTER TABLE asset_logs MODIFY added_on timestamp null');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
@@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
class EditLocationIdAssetLogsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
DB::statement('ALTER TABLE asset_logs MODIFY location_id int(11) null');
DB::statement('ALTER TABLE asset_logs MODIFY added_on timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
+40
View File
@@ -0,0 +1,40 @@
<?php
class ActionLog extends Eloquent {
protected $table = 'asset_logs';
public $timestamps = false;
public function assetlog() {
return $this->belongsTo('Asset','asset_id');
}
public function adminlog() {
return $this->belongsTo('User','user_id');
}
public function userlog() {
return $this->belongsTo('User','checkedout_to');
}
/**
* Get the parent category name
*/
public function logaction($actiontype)
{
$this->action_type = $actiontype;
if($this->save())
{
return true;
} else {
return false;
}
}
}
+23 -3
View File
@@ -49,10 +49,30 @@ class Asset extends Elegant {
return $this->belongsTo('User', 'assigned_to');
}
public function assetloc($locationId)
/**
* Get the asset's location based on the assigned user
**/
public function assetloc()
{
return Location::find($locationId);
return $this->assigneduser->hasOne('Location');
}
/**
* Get action logs for this asset
*/
public function assetlog()
{
return $this->hasMany('Actionlog','asset_id')->orderBy('added_on', 'desc');
}
/**
* Get action logs for this asset
*/
public function adminuser()
{
return $this->belongsTo('User','id');
}
}
+23
View File
@@ -21,6 +21,29 @@ class License extends Elegant {
return $this->belongsTo('User', 'assigned_to');
}
/**
* Get the asset's location based on the assigned user
**/
public function assetloc()
{
return $this->assigneduser->hasOne('Location');
}
/**
* Get action logs for this asset
*/
public function assetlog()
{
return $this->hasMany('Actionlog','asset_id')->orderBy('added_on', 'desc');
}
/**
* Get action logs for this asset
*/
public function adminuser()
{
return $this->belongsTo('User','id');
}
}
+16 -1
View File
@@ -39,9 +39,24 @@ class User extends SentryUserModel {
public function assets()
{
return $this->hasMany('Asset', 'assigned_to');
}
/**
* Get action logs for this user
*/
public function userlog()
{
return $this->hasMany('Actionlog','checkedout_to');
}
/**
* Get the asset's location based on the assigned user
**/
public function userloc()
{
return $this->hasOne('Location','id');
}
}
+14 -28
View File
@@ -14,20 +14,6 @@
Route::group(array('prefix' => 'assets'), function()
{
Route::get('/', array('as' => 'assets', 'uses' => 'Controllers\Admin\AssetsController@getIndex'));
Route::get('assets', array('as' => 'assets', 'uses' => 'Controllers\Admin\AssetsController@getIndex'));
Route::get('create', array('as' => 'create/asset', 'uses' => 'Controllers\Admin\AssetsController@getCreate'));
Route::post('create', 'Controllers\Admin\AssetsController@postCreate');
Route::get('{assetId}/edit', array('as' => 'update/asset', 'uses' => 'Controllers\Admin\AssetsController@getEdit'));
Route::post('{assetId}/edit', 'Controllers\Admin\AssetsController@postEdit');
Route::get('{assetId}/delete', array('as' => 'delete/asset', 'uses' => 'Controllers\Admin\AssetsController@getDelete'));
Route::get('{assetId}/checkout', array('as' => 'checkout/asset', 'uses' => 'Controllers\Admin\AssetsController@getCheckout'));
Route::post('{assetId}/checkout', 'Controllers\Admin\AssetsController@postCheckout');
Route::get('{assetId}/checkin', array('as' => 'checkin/asset', 'uses' => 'Controllers\Admin\AssetsController@postCheckin'));
# Asset Model Management
Route::group(array('prefix' => 'models'), function()
{
@@ -39,6 +25,17 @@ Route::group(array('prefix' => 'assets'), function()
Route::get('{modelId}/delete', array('as' => 'delete/model', 'uses' => 'Controllers\Admin\ModelsController@getDelete'));
});
Route::get('/', array('as' => 'assets', 'uses' => 'Controllers\Admin\AssetsController@getIndex'));
Route::get('create', array('as' => 'create/asset', 'uses' => 'Controllers\Admin\AssetsController@getCreate'));
Route::post('create', 'Controllers\Admin\AssetsController@postCreate');
Route::get('{assetId}/edit', array('as' => 'update/asset', 'uses' => 'Controllers\Admin\AssetsController@getEdit'));
Route::post('{assetId}/edit', 'Controllers\Admin\AssetsController@postEdit');
Route::get('{assetId}/delete', array('as' => 'delete/asset', 'uses' => 'Controllers\Admin\AssetsController@getDelete'));
Route::get('{assetId}/checkout', array('as' => 'checkout/asset', 'uses' => 'Controllers\Admin\AssetsController@getCheckout'));
Route::post('{assetId}/checkout', 'Controllers\Admin\AssetsController@postCheckout');
Route::get('{assetId}/checkin', array('as' => 'checkin/asset', 'uses' => 'Controllers\Admin\AssetsController@postCheckin'));
Route::get('{assetId}/view', array('as' => 'view/asset', 'uses' => 'Controllers\Admin\AssetsController@getView'));
@@ -57,20 +54,6 @@ Route::group(array('prefix' => 'assets'), function()
Route::group(array('prefix' => 'admin'), function()
{
# Blog Management
Route::group(array('prefix' => 'blogs'), function()
{
Route::get('/', array('as' => 'blogs', 'uses' => 'Controllers\Admin\BlogsController@getIndex'));
Route::get('create', array('as' => 'create/blog', 'uses' => 'Controllers\Admin\BlogsController@getCreate'));
Route::post('create', 'Controllers\Admin\BlogsController@postCreate');
Route::get('{blogId}/edit', array('as' => 'update/blog', 'uses' => 'Controllers\Admin\BlogsController@getEdit'));
Route::post('{blogId}/edit', 'Controllers\Admin\BlogsController@postEdit');
Route::get('{blogId}/delete', array('as' => 'delete/blog', 'uses' => 'Controllers\Admin\BlogsController@getDelete'));
Route::get('{blogId}/restore', array('as' => 'restore/blog', 'uses' => 'Controllers\Admin\BlogsController@getRestore'));
});
# Licenses
Route::group(array('prefix' => 'licenses'), function()
{
@@ -83,6 +66,7 @@ Route::group(array('prefix' => 'admin'), function()
Route::get('{licenseId}/checkout', array('as' => 'checkout/license', 'uses' => 'Controllers\Admin\LicensesController@getCheckout'));
Route::post('{licenseId}/checkout', 'Controllers\Admin\LicensesController@postCheckout');
Route::get('{licenseId}/checkin', array('as' => 'checkin/license', 'uses' => 'Controllers\Admin\LicensesController@postCheckin'));
Route::get('{licenseId}/view', array('as' => 'view/license', 'uses' => 'Controllers\Admin\LicensesController@getView'));
});
@@ -248,3 +232,5 @@ Route::group(array('prefix' => 'account'), function()
*/
Route::get('/', array('as' => 'home', 'uses' => 'Controllers\Admin\AssetsController@getIndex'));
Route::get('reports', array('as' => 'reports', 'uses' => 'Controllers\Admin\AssetsController@getReports'));
+10 -7
View File
@@ -8,6 +8,8 @@ Assets ::
{{-- Page content --}}
@section('content')
<div class="page-header">
<h3>
Assets
@@ -28,12 +30,12 @@ Assets ::
<th class="span2">@lang('admin/assets/table.asset_tag')</th>
<th class="span2"><span class="line"></span>@lang('admin/assets/table.title')</th>
<th class="span2"><span class="line"></span>@lang('admin/assets/table.serial')</th>
<th class="span2"><span class="line"></span>@lang('admin/assets/table.checkoutto')</th>
<th class="span3"><span class="line"></span>@lang('admin/assets/table.checkoutto')</th>
<th class="span2"><span class="line"></span>@lang('admin/assets/table.location')</th>
<th class="span1"><span class="line"></span>@lang('admin/assets/table.change')</th>
<th class="span2"><span class="line"></span>@lang('admin/assets/table.purchase_date')</th>
<th class="span2"><span class="line"></span>@lang('admin/assets/table.purchase_cost')</th>
<th class="span2"><span class="line"></span>@lang('admin/assets/table.book_value')</th>
<!-- <th class="span2"><span class="line"></span>@lang('admin/assets/table.purchase_cost')</th> -->
<!-- <th class="span2"><span class="line"></span>@lang('admin/assets/table.book_value')</th> -->
<th class="span2"><span class="line"></span>@lang('table.actions')</th>
</tr>
</thead>
@@ -41,8 +43,8 @@ Assets ::
@foreach ($assets as $asset)
<tr>
<td>{{ $asset->asset_tag }}</td>
<td>{{ $asset->name }}</td>
<td><a href="{{ route('view/asset', $asset->id) }}">{{ $asset->asset_tag }}</a></td>
<td><a href="{{ route('view/asset', $asset->id) }}">{{ $asset->name }}</a></td>
<td>{{ $asset->serial }}</td>
<td>
@if ($asset->assigned_to != 0)
@@ -64,9 +66,10 @@ Assets ::
@endif
</td>
<td>{{ $asset->purchase_date }}</td>
<td>${{ number_format($asset->purchase_cost) }}</td>
<td>${{ number_format($asset->depreciation()) }}</td>
<!-- <td>${{ number_format($asset->purchase_cost) }}</td> -->
<!-- <td>${{ number_format($asset->depreciation()) }}</td> -->
<td nowrap="nowrap">
<a href="{{ route('update/asset', $asset->id) }}" class="btn-flat white">@lang('button.edit')</a>
<a href="{{ route('delete/asset', $asset->id) }}" class="btn-flat danger">@lang('button.delete')</a>
+154
View File
@@ -0,0 +1,154 @@
@extends('backend/layouts/default')
{{-- Page title --}}
@section('title')
View Asset {{ $asset->asset_tag }} ::
@parent
@stop
{{-- Page content --}}
@section('content')
<div id="pad-wrapper" class="user-profile">
<!-- header -->
<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->assigned_to != 0)
<li><a href="{{ route('checkin/asset', $asset->id) }}" class="btn-flat info">Checkin</a></li>
@else
<li><a href="{{ route('checkout/asset', $asset->id) }}" class="btn-flat success">Checkout</a></li>
@endif
<li><a href="{{ route('update/asset', $asset->id) }}">Edit Asset</a></li>
<li><a href="#">Out for Disagnostics</a></li>
<li><a href="#">Out for Repair</a></li>
<li><a href="#">Mark as Lost/Stolen</a></li>
</ul>
</div>
</h3>
<div class="row-fluid profile">
<!-- bio, new note & orders column -->
<div class="span9 bio">
<div class="profile-box">
<br>
<!-- checked out assets table -->
<table class="table table-hover">
<thead>
<tr>
<th class="span1"></th>
<th class="span3"><span class="line"></span>Date</th>
<th class="span3"><span class="line"></span>Admin</th>
<th class="span3"><span class="line"></span>Action</th>
<th class="span3"><span class="line"></span>User</th>
</tr>
</thead>
<tbody>
@if (count($asset->assetlog) > 0)
@foreach ($asset->assetlog as $log)
<tr>
<td>
@if ((isset($log->checkedout_to)) && ($log->checkedout_to == $asset->assigned_to))
<i class="icon-star"></i>
@endif
</td>
<td>{{ $log->added_on }}</td>
<td>
@if (isset($log->user_id))
{{ $log->adminlog->fullName() }}
@endif
</td>
<td>{{ $log->action_type }}</td>
<td>
@if (isset($log->checkedout_to))
<a href="{{ route('view/user', $log->checkedout_to) }}">
{{ $log->userlog->fullName() }}
</a>
@endif
</td>
</tr>
@endforeach
@endif
<tr>
<td></td>
<td>{{ $asset->created_at }}</td>
<td>
@if (isset($asset->adminuser->id))
{{ $asset->adminuser->fullName() }}
@else
Unknown Admin
@endif
</td>
<td>created asset</td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- side address column -->
<div class="span3 address pull-right">
@if ((isset($asset->assigned_to ) && ($asset->assigned_to > 0)))
<h6><br>Checked Out To:</h6>
<ul>
<li><img src="{{ $asset->assigneduser->gravatar() }}" class="img-circle" style="width: 100px; margin-right: 20px;" /><br /><br /></li>
<li><a href="{{ route('view/user', $asset->assigned_to) }}">{{ $asset->assigneduser->fullName() }}</a></li>
@if (isset($asset->assetloc->address))
<li>{{ $asset->assetloc->address }}
@if (isset($asset->assetloc->address2))
{{ $asset->assetloc->address2 }}
@endif
</li>
@if (isset($asset->assetloc->city))
<li>{{ $asset->assetloc->city }}, {{ $asset->assetloc->state }} {{ $asset->assetloc->zip }}</li>
@endif
@endif
@if (isset($asset->assigneduser->email))
<li><br /><i class="icon-envelope-alt"></i> <a href="mailto:{{ $asset->assigneduser->email }}">{{ $asset->assigneduser->email }}</a></li>
@endif
@if (isset($asset->assigneduser->phone))
<li><i class="icon-phone"></i> {{ $asset->assigneduser->phone }}</li>
@endif
<li><br /><a href="{{ route('checkin/asset', $asset->id) }}" class="btn-flat large info ">Checkin Asset</a></li>
</ul>
@else
<ul>
<li><br><br />This asset is not currently assigned to anyone. You may check it into inventory
using the button below, or mark it as lost/stolen using the menu above.</li>
<li><br><br /><a href="{{ route('checkout/asset', $asset->id) }}" class="btn-flat large success">Checkout Asset</a></li>
</ul>
@endif
</div>
@stop
+49 -10
View File
@@ -67,7 +67,7 @@
<!-- navbar -->
<div class="navbar navbar-inverse">
<div class="navbar-inner navbar-fixed-top navbar-inverse">
<div class="navbar-inner navbar-inverse">
<button type="button" class="btn btn-navbar visible-phone" id="menu-toggler">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
@@ -166,21 +166,20 @@
<span>Models</span>
</a>
</li>
<li{{ (Request::is('admin/licenses*') ? ' class="active"><div class="pointer"><div class="arrow"></div><div class="arrow_border"></div></div>' : '>') }}
<a href="{{ URL::to('admin/licenses') }}">
<i class="icon-certificate"></i>
<span>Licenses</span>
</a>
</li>
<li{{ (Request::is('admin/users*') ? ' class="active"><div class="pointer"><div class="arrow"></div><div class="arrow_border"></div></div>' : '>') }}
<a href="{{ URL::to('admin/users') }}">
<i class="icon-group"></i>
<span>People</span>
</a>
</li>
<li{{ (Request::is('admin/licenses*') ? ' class="active"><div class="pointer"><div class="arrow"></div><div class="arrow_border"></div></div>' : '>') }}
<a href="{{ URL::to('admin/licenses') }}">
<i class="icon-certificate icon-white"></i>
<span>Licenses</span>
</a>
</li>
<li>
<a href="#">
<li{{ (Request::is('reports*') ? ' class="active"><div class="pointer"><div class="arrow"></div><div class="arrow_border"></div></div>' : '>') }}
<a href="{{ URL::to('reports') }}">
<i class="icon-signal"></i>
<span>Reports</span>
</a>
@@ -196,6 +195,46 @@
<div class="container-fluid">
@if ((Sentry::check()) && (Sentry::getUser()->hasAccess('admin')))
<!-- upper main stats -->
<div id="main-stats">
<div class="row-fluid stats-row">
<div class="span3 stat">
<div class="data">
<span class="number">2,457</span>
assets
</div>
<span class="date">(placeholder)</span>
</div>
<div class="span3 stat">
<div class="data">
<span class="number">240</span>
licenses
</div>
<span class="date">(placeholder)</span>
</div>
<div class="span3 stat">
<div class="data">
<span class="number">36</span>
assets available
</div>
<span class="date">(placeholder)</span>
</div>
<div class="span3 stat last">
<div class="data">
<span class="number">89</span>
people
</div>
<span class="date">(placeholder)</span>
</div>
</div>
</div>
<!-- end upper main stats -->
@endif
<div id="pad-wrapper">
@@ -65,8 +65,8 @@
<!-- Form actions -->
<div class="control-group">
<div class="controls">
<a class="btn btn-link" href="{{ route('assets') }}">@lang('general.cancel')</a>
<button type="submit" class="btn btn-success">@lang('general.checkout')</button>
<a class="btn btn-link" href="{{ route('licenses') }}">@lang('general.cancel')</a>
<button type="submit" class="btn-flat success">@lang('general.checkout')</button>
</div>
</div>
</form>
+2 -2
View File
@@ -35,8 +35,8 @@ Licenses ::
<tbody>
@foreach ($licenses as $license)
<tr>
<td>{{ $license->name }}</td>
<td>{{ $license->serial }}</td>
<td><a href="{{ route('view/license', $license->id) }}">{{ $license->name }}</a></td>
<td><a href="{{ route('view/license', $license->id) }}">{{ $license->serial }}</a></td>
<td>{{ $license->license_name }}</td>
<td>{{ $license->license_email }}</td>
+152
View File
@@ -0,0 +1,152 @@
@extends('backend/layouts/default')
{{-- Page title --}}
@section('title')
View License {{ $license->name }} ::
@parent
@stop
{{-- Page content --}}
@section('content')
<div id="pad-wrapper" class="user-profile">
<!-- header -->
<h3 class="name">History for ({{ $license->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 ($license->assigned_to != 0)
<li><a href="{{ route('checkin/license', $license->id) }}" class="btn-flat info">Checkin</a></li>
@else
<li><a href="{{ route('checkout/license', $license->id) }}" class="btn-flat success">Checkout</a></li>
@endif
<li><a href="{{ route('update/license', $license->id) }}">Edit License</a></li>
<li><a href="#">Mark as Lost/Stolen</a></li>
</ul>
</div>
</h3>
<div class="row-fluid profile">
<!-- bio, new note & orders column -->
<div class="span9 bio">
<div class="profile-box">
<br>
<!-- checked out assets table -->
<table class="table table-hover">
<thead>
<tr>
<th class="span1"></th>
<th class="span3"><span class="line"></span>Date</th>
<th class="span3"><span class="line"></span>Admin</th>
<th class="span3"><span class="line"></span>Action</th>
<th class="span3"><span class="line"></span>User</th>
</tr>
</thead>
<tbody>
@if (count($license->assetlog) > 0)
@foreach ($license->assetlog as $log)
<tr>
<td>
@if ((isset($log->checkedout_to)) && ($log->checkedout_to == $license->assigned_to))
<i class="icon-star"></i>
@endif
</td>
<td>{{ $log->added_on }}</td>
<td>
@if (isset($log->user_id))
{{ $log->adminlog->fullName() }}
@endif
</td>
<td>{{ $log->action_type }}</td>
<td>
@if (isset($log->checkedout_to->id))
<a href="{{ route('view/user', $log->checkedout_to) }}">
{{ $log->userlog->fullName() }}
</a>
@endif
</td>
</tr>
@endforeach
@endif
<tr>
<td></td>
<td>{{ $license->created_at }}</td>
<td>
@if (isset($license->adminuser->id))
{{ $license->adminuser->fullName() }}
@else
Unknown Admin
@endif
</td>
<td>created asset</td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- side address column -->
<div class="span3 address pull-right">
@if ((isset($license->assigned_to ) && ($license->assigned_to > 0)))
<h6><br>Checked Out To:</h6>
<ul>
<li><img src="{{ $license->assigneduser->gravatar() }}" class="img-circle" style="width: 100px; margin-right: 20px;" /><br /><br /></li>
<li><a href="{{ route('view/user', $license->assigned_to) }}">{{ $license->assigneduser->fullName() }}</a></li>
@if (isset($license->assetloc->address))
<li>{{ $license->assetloc->address }}
@if (isset($license->assetloc->address2))
{{ $license->assetloc->address2 }}
@endif
</li>
@if (isset($license->assetloc->city))
<li>{{ $license->assetloc->city }}, {{ $license->assetloc->state }} {{ $license->assetloc->zip }}</li>
@endif
@endif
@if (isset($license->assigneduser->email))
<li><br /><i class="icon-envelope-alt"></i> <a href="mailto:{{ $license->assigneduser->email }}">{{ $license->assigneduser->email }}</a></li>
@endif
@if (isset($license->assigneduser->phone))
<li><i class="icon-phone"></i> {{ $license->assigneduser->phone }}</li>
@endif
<li><br /><a href="{{ route('checkin/license', $license->id) }}" class="btn-flat large info ">Checkin Asset</a></li>
</ul>
@else
<ul>
<li><br><br />This asset is not currently assigned to anyone. You may check it into inventory
using the button below, or mark it as lost/stolen using the menu above.</li>
<li><br><br /><a href="{{ route('checkout/license', $license->id) }}" class="btn-flat large success">Checkout Asset</a></li>
</ul>
@endif
</div>
@stop
+82
View File
@@ -0,0 +1,82 @@
@extends('backend/layouts/default')
{{-- Page title --}}
@section('title')
Depreciation Report
@parent
@stop
{{-- Page content --}}
@section('content')
<div class="page-header">
<h3>
Depreciation Report
<div class="pull-right">
<div class="btn-group settings">
<button class="btn glow"><i class="icon-download-alt"></i></button>
<button class="btn glow dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="#">Download as CSV</a></li>
<li><a href="#">Download as PDF</a></li>
</ul>
</div>
</div>
</h3>
</div>
<div class="row-fluid table">
<table class="table table-hover">
<thead>
<tr>
<th class="span2">@lang('admin/assets/table.asset_tag')</th>
<th class="span2"><span class="line"></span>@lang('admin/assets/table.title')</th>
<th class="span2"><span class="line"></span>@lang('admin/assets/table.serial')</th>
<th class="span3"><span class="line"></span>@lang('admin/assets/table.checkoutto')</th>
<th class="span2"><span class="line"></span>@lang('admin/assets/table.location')</th>
<th class="span2"><span class="line"></span>@lang('admin/assets/table.purchase_date')</th>
<th class="span1"><span class="line"></span>@lang('admin/assets/table.purchase_cost')</th>
<th class="span1"><span class="line"></span>@lang('admin/assets/table.book_value')</th>
<th class="span1"><span class="line"></span>Diff</th>
</tr>
</thead>
<tbody>
@foreach ($assets as $asset)
<tr>
<td>{{ $asset->asset_tag }}</td>
<td>{{ $asset->name }}</td>
<td>{{ $asset->serial }}</td>
<td>
@if ($asset->assigned_to != 0)
<a href="{{ route('view/user', $asset->assigned_to) }}">
{{ $asset->assigneduser->fullName() }}
</a>
@endif
</td>
<td>
@if (($asset->assigned_to > 0) && ($asset->assigneduser->location_id > 0))
{{ Location::find($asset->assigneduser->location_id)->city }}
,
{{ Location::find($asset->assigneduser->location_id)->state }}
@endif
</td>
<td>{{ $asset->purchase_date }}</td>
<td class="align-right">${{ number_format($asset->purchase_cost) }}</td>
<td class="align-right">${{ number_format($asset->depreciation()) }}</td>
<td class="align-right">-${{ number_format(($asset->purchase_cost - $asset->depreciation())) }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@stop
+58 -27
View File
@@ -38,9 +38,8 @@ View User {{ $user->fullName() }} ::
<tr>
<th class="span3">Asset Type</th>
<th class="span3"><span class="line"></span>Asset Tag</th>
<th class="span4"><span class="line"></span>Name</th>
<th class="span2"><span class="line"></span>Date</th>
<th class="span2"><span class="line"></span>Actions</th>
<th class="span3"><span class="line"></span>Name</th>
<th class="span3"><span class="line"></span>Actions</th>
</tr>
</thead>
<tbody>
@@ -53,9 +52,9 @@ View User {{ $user->fullName() }} ::
Software
@endif
</td>
<td>{{ $asset->asset_tag }}</td>
<td>{{ $asset->name }}</td>
<td></td>
<td><a href="{{ route('view/asset', $asset->id) }}">{{ $asset->asset_tag }}</a></td>
<td><a href="{{ route('view/asset', $asset->id) }}">{{ $asset->name }}</a></td>
<td> <a href="{{ route('checkin/asset', $asset->id) }}" class="btn-flat info">Checkin</a></td>
</tr>
@endforeach
@@ -65,38 +64,70 @@ View User {{ $user->fullName() }} ::
<div class="col-md-6">
<div class="alert alert-warning alert-block">
<i class="icon-warning-sign"></i>
@lang('admin/users/table.noresults')
</div>
</div>
@endif
<h6>History for {{ $user->first_name }}</h6>
<br>
<!-- checked out assets table -->
@if (count($user->userlog) > 0)
<table class="table table-hover">
<thead>
<tr>
<th class="span3">Date</th>
<th class="span3"><span class="line"></span>Action</th>
<th class="span3"><span class="line"></span>Asset</th>
<th class="span3"><span class="line"></span>By</th>
</tr>
</thead>
<tbody>
@foreach ($user->userlog as $log)
<tr>
<td>{{ $log->added_on }}</td>
<td>{{ $log->action_type }}</td>
<td><a href="{{ route('view/asset', $log->asset_id) }}">{{ $log->assetlog->name }}</a></td>
<td>{{ $log->adminlog->fullName() }}</td>
</tr>
@endforeach
</tbody>
</table>
@else
<div class="col-md-6">
<div class="alert alert-warning alert-block">
<i class="icon-warning-sign"></i>
@lang('admin/users/table.noresults')
</div>
</div>
@endif
</div>
</div>
<!-- side address column -->
<div class="span3 address pull-right">
@if ($user->last_login!='')
<ul>
<li><strong>Last Login:</strong></li>
<li>{{ $user->last_login->diffForHumans() }}</li>
</ul>
<h6>Contact {{ $user->first_name }}</h6>
@if (isset($user->location_id))
<iframe width="300" height="133" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?&amp;q={{ $user->userloc->address }},{{ $user->userloc->city }},{{ $user->userloc->state }},{{ $user->userloc->country }}&amp;output=embed"></iframe>
@endif
<ul>
<li>{{ $user->userloc->address }} {{ $user->userloc->address2 }}</li>
<li>{{ $user->userloc->city }}, {{ $user->userloc->state }} {{ $user->userloc->zip }}<br /><br /></li>
@if (isset($user->phone))
<li><i class="icon-phone"></i>{{ $user->phone }}</li>
@endif
<h6>Address</h6>
<iframe width="300" height="133" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com.mx/?ie=UTF8&amp;t=m&amp;ll=19.715081,-155.071421&amp;spn=0.010746,0.025749&amp;z=14&amp;output=embed"></iframe>
<ul>
<li>2301 East Lamar Blvd. Suite 140. </li>
<li>City, Arlington. United States,</li>
<li>Zip Code, TX 76006.</li>
<li class="ico-li">
<i class="icon-phone"></i>
{{ $user->phone }}
</li>
<li class="ico-li">
<i class="icon-envelope-alt"></i>
<a href="mailto:{{ $user->email }}">{{ $user->email }}</a>
</li>
<li><i class="icon-envelope-alt"></i><a href="mailto:{{ $user->email }}">{{ $user->email }}</a></li>
</ul>
@if ($user->last_login!='')
<br /><h6>Last Login: {{ $user->last_login->diffForHumans() }}</h6>
@endif
</div>
@stop