Skip to content

Commit 2517359

Browse files
committed
Merge remote-tracking branch 'origin/develop'
2 parents 21e6f2c + c782f29 commit 2517359

File tree

10 files changed

+301
-108
lines changed

10 files changed

+301
-108
lines changed

CHANGELOG.md

Lines changed: 109 additions & 92 deletions
Large diffs are not rendered by default.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php namespace Controllers\Account;
2+
3+
use AuthorizedController;
4+
use Input;
5+
use Redirect;
6+
use Sentry;
7+
use Validator;
8+
use Location;
9+
use View;
10+
11+
class ViewAssetsController extends AuthorizedController
12+
{
13+
/**
14+
* Redirect to the profile page.
15+
*
16+
* @return Redirect
17+
*/
18+
public function getIndex()
19+
{
20+
$user = Sentry::getUser();
21+
22+
23+
if (isset($user->id)) {
24+
return View::make('frontend/account/view-assets', compact('user'));
25+
} else {
26+
// Prepare the error message
27+
$error = Lang::get('admin/users/message.user_not_found', compact('id' ));
28+
29+
// Redirect to the user management page
30+
return Redirect::route('users')->with('error', $error);
31+
}
32+
33+
}
34+
35+
36+
}

app/lang/en/general.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
'cancel' => 'Cancel',
1515
'categories' => 'Categories',
1616
'category' => 'Category',
17+
'changeemail' => 'Update Email',
18+
'changepassword' => 'Update Password',
1719
'checkin' => 'Checkin',
1820
'checkout' => 'Checkout',
1921
'city' => 'City',
@@ -29,6 +31,7 @@
2931
'deployed' => 'Deployed',
3032
'depreciation_report' => 'Depreciation Report',
3133
'depreciation' => 'Depreciation',
34+
'editprofile' => 'Edit Profile',
3235
'eol' => 'EOL',
3336
'first_name' => 'First Name',
3437
'groups' => 'Groups',
@@ -41,14 +44,14 @@
4144
'list_all' => 'List All',
4245
'locations' => 'Locations',
4346
'logout' => 'Logout',
44-
'manufacturers' => 'Manufacturers',
4547
'manufacturer' => 'Manufacturer',
48+
'manufacturers' => 'Manufacturers',
4649
'model_no' => 'Model No.',
4750
'months' => 'months',
4851
'moreinfo' => 'More Info',
4952
'name' => 'Name',
50-
'no_results' => 'No Results.',
5153
'no_depreciation' => 'No Derepciation',
54+
'no_results' => 'No Results.',
5255
'no' => 'No',
5356
'pending' => 'Pending',
5457
'people' => 'People',
@@ -69,6 +72,7 @@
6972
'undeployable' => 'Un-deployable',
7073
'unknown_admin' => 'Unknown Admin',
7174
'user' => 'User',
75+
'viewassets' => 'View Assets',
7276
'welcome' => 'Welcome, :name',
7377
'years' => 'years',
7478
'yes' => 'Yes',

app/routes.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,9 @@
234234
Route::get('change-password', array('as' => 'change-password', 'uses' => 'Controllers\Account\ChangePasswordController@getIndex'));
235235
Route::post('change-password', 'Controllers\Account\ChangePasswordController@postIndex');
236236

237+
# View Assets
238+
Route::get('view-assets', array('as' => 'view-assets', 'uses' => 'Controllers\Account\ViewAssetsController@getIndex'));
239+
237240
# Change Email
238241
Route::get('change-email', array('as' => 'change-email', 'uses' => 'Controllers\Account\ChangeEmailController@getIndex'));
239242
Route::post('change-email', 'Controllers\Account\ChangeEmailController@postIndex');

app/views/backend/layouts/default.blade.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,17 @@
117117
</a>
118118
<ul class="dropdown-menu">
119119
<li{{{ (Request::is('account/profile') ? ' class="active"' : '') }}}>
120-
<a href="{{ route('profile') }}">
121-
<i class="icon-user"></i> @lang('general.profile')
120+
<a href="{{ route('view-assets') }}">
121+
<i class="icon-check"></i> @lang('general.viewassets')
122+
</a>
123+
<a href="{{ route('profile') }}">
124+
<i class="icon-user"></i> @lang('general.editprofile')
125+
</a>
126+
<a href="{{ route('change-password') }}">
127+
<i class="icon-lock"></i> @lang('general.changepassword')
128+
</a>
129+
<a href="{{ route('change-email') }}">
130+
<i class="icon-envelope"></i> @lang('general.changeemail')
122131
</a>
123132
</li>
124133
<li class="divider"></li>

app/views/frontend/account/change-email.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<div class="row header">
1111

1212
<div class="col-md-12">
13-
<h3>Change Your Email</h3>
13+
<h3>@lang('general.changeemail')</h3>
1414
</div>
1515
</div>
1616

app/views/frontend/account/change-password.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<div class="row header">
1111

1212
<div class="col-md-12">
13-
<h3>Change Your Password</h3>
13+
<h3>@lang('general.changepassword')</h3>
1414
</div>
1515
</div>
1616

app/views/frontend/account/profile.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<div class="row header">
1111

1212
<div class="col-md-12">
13-
<h3>Update Profile</h3>
13+
<h3>@lang('general.editprofile')</h3>
1414
</div>
1515
</div>
1616

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
@extends('frontend/layouts/account')
2+
3+
{{-- Page title --}}
4+
@section('title')
5+
View Assets for {{{ $user->fullName() }}} ::
6+
@parent
7+
@stop
8+
9+
{{-- Account page content --}}
10+
@section('account-content')
11+
12+
<div class="row profile">
13+
<!-- header -->
14+
<div class="row header">
15+
<div class="col-md-9">
16+
<img src="{{{ $user->gravatar() }}}" class="avatar img-circle">
17+
<h3 class="name">{{{ $user->fullName() }}}</h3>
18+
<span class="area">{{{ $user->jobtitle }}}</span>
19+
</div>
20+
</div>
21+
22+
<div class="row profile">
23+
24+
<!-- bio, new note & orders column -->
25+
<div class="col-md-10 bio">
26+
<div class="profile-box">
27+
28+
@if ($user->deleted_at != NULL)
29+
30+
<div class="col-md-12">
31+
<div class="alert alert-danger">
32+
<i class="icon-exclamation-sign"></i>
33+
<strong>Warning: </strong>
34+
This user has been deleted. You will have to restore this user to edit them or assign them new assets.
35+
</div>
36+
</div>
37+
38+
@endif
39+
40+
41+
<!-- checked out assets table -->
42+
@if (count($user->assets) > 0)
43+
<h4>Assets Checked Out to You</h4>
44+
<br>
45+
<table class="table table-hover">
46+
<thead>
47+
<tr>
48+
<th class="col-md-3">Asset Type</th>
49+
<th class="col-md-2"><span class="line"></span>Asset Tag</th>
50+
<th class="col-md-2"><span class="line"></span>Name</th>
51+
</tr>
52+
</thead>
53+
<tbody>
54+
@foreach ($user->assets as $asset)
55+
<tr>
56+
<td>
57+
@if ($asset->physical=='1') {{{ $asset->model->name }}}
58+
@endif
59+
</td>
60+
<td>{{{ $asset->asset_tag }}}</td>
61+
<td>{{{ $asset->name }}}</td>
62+
</tr>
63+
@endforeach
64+
</tbody>
65+
</table>
66+
@endif
67+
68+
69+
<!-- checked out assets table -->
70+
@if (count($user->licenses) > 0)
71+
<h4>Software Checked Out to You</h4>
72+
<br>
73+
<table class="table table-hover">
74+
<thead>
75+
<tr>
76+
<th class="col-md-4"><span class="line"></span>Name</th>
77+
<th class="col-md-4"><span class="line"></span>Serial</th>
78+
79+
</tr>
80+
</thead>
81+
<tbody>
82+
@foreach ($user->licenses as $license)
83+
<tr>
84+
<td>{{{ $license->name }}}</td>
85+
<td>{{{ $license->serial }}}</td>
86+
</td>
87+
</tr>
88+
@endforeach
89+
</tbody>
90+
</table>
91+
@endif
92+
93+
94+
95+
96+
<!-- checked out assets table -->
97+
<h4>History </h4>
98+
<br>
99+
@if (count($user->userlog) > 0)
100+
<table class="table table-hover">
101+
<thead>
102+
<tr>
103+
<th class="col-md-3">Date</th>
104+
<th class="col-md-3"><span class="line"></span>Action</th>
105+
<th class="col-md-3"><span class="line"></span>Asset</th>
106+
<th class="col-md-3"><span class="line"></span>By</th>
107+
</tr>
108+
</thead>
109+
<tbody>
110+
@foreach ($user->userlog as $log)
111+
<tr>
112+
<td>{{{ $log->added_on }}}</td>
113+
<td>{{{ $log->action_type }}}</td>
114+
<td>
115+
@if ((isset($log->assetlog->name)) && ($log->assetlog->deleted_at==''))
116+
{{{ $log->assetlog->asset_tag }}}
117+
@elseif ((isset($log->assetlog->name)) && ($log->assetlog->deleted_at!=''))
118+
<del>{{{ $log->assetlog->name }}}</del> (deleted)
119+
@endif
120+
</td>
121+
<td>{{{ $log->adminlog->fullName() }}}</td>
122+
</tr>
123+
@endforeach
124+
</tbody>
125+
</table>
126+
@endif
127+
128+
</div>
129+
</div>
130+
131+
@stop
132+

app/views/frontend/layouts/account.blade.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,7 @@
33
{{-- Page content --}}
44
@section('content')
55
<div class="row">
6-
<div class="col-md-3">
7-
<ul class="nav nav-list">
8-
<li{{ Request::is('account/profile') ? ' class="active"' : '' }}><a href="{{ URL::route('profile') }}">Profile</a></li>
9-
<li{{ Request::is('account/change-password') ? ' class="active"' : '' }}><a href="{{ URL::route('change-password') }}">Change Password</a></li>
10-
<li{{ Request::is('account/change-email') ? ' class="active"' : '' }}><a href="{{ URL::route('change-email') }}">Change Email</a></li>
11-
12-
</ul>
13-
</div>
14-
<div class="col-md-9">
6+
<div class="col-md-12">
157
@yield('account-content')
168
</div>
179
</div>

0 commit comments

Comments
 (0)