Skip to content

Commit

Permalink
Fixes for #766 - add activity report
Browse files Browse the repository at this point in the history
  • Loading branch information
snipe committed Apr 29, 2015
1 parent 6a7fcd5 commit d61506f
Show file tree
Hide file tree
Showing 7 changed files with 101 additions and 11 deletions.
4 changes: 2 additions & 2 deletions app/config/version.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
return array (
'app_version' => 'v1.2.6.1-216',
'hash_version' => 'v1.2.6.1-216-ge6d0d83',
'app_version' => 'v1.2.6.1-217',
'hash_version' => 'v1.2.6.1-217-gb4b273f',
);
21 changes: 21 additions & 0 deletions app/controllers/admin/ReportsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Location;
use Redirect;
use Response;
use Actionlog;

class ReportsController extends AdminController
{
Expand Down Expand Up @@ -212,6 +213,26 @@ public function exportDeprecationReport()
return $response;
}

/**
* Show Report for Activity
*
* @return View
*/

public function getActivityReport()
{
$log_actions = Actionlog::orderBy('created_at', 'DESC')
->with('adminlog')
->with('accessorylog')
->with('assetlog')
->with('licenselog')
->with('userlog')
->orderBy('created_at','DESC')
->get();
return View::make('backend/reports/activity', compact('log_actions'));
}


/**
* Show Report for Licenses
*
Expand Down
1 change: 1 addition & 0 deletions app/lang/en/general.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

'accessories' => 'Accessories',
'accessory' => 'Accessory',
'activity_report' => 'Activity Report',
'address' => 'Address',
'admin' => 'Admin',
'all_assets' => 'All Assets',
Expand Down
2 changes: 2 additions & 0 deletions app/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,8 @@

Route::get('reports/custom', array('as' => 'reports/custom', 'uses' => 'ReportsController@getCustomReport'));
Route::post('reports/custom', 'ReportsController@postCustom');

Route::get('reports/activity', array('as' => 'reports/activity', 'uses' => 'ReportsController@getActivityReport'));
});


Expand Down
2 changes: 2 additions & 0 deletions app/views/backend/layouts/default.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,8 @@
</a>

<ul class="submenu{{ (Request::is('reports*') ? ' active' : '') }}">
<li><a href="{{ URL::to('reports/activity') }}" {{{ (Request::is('reports/activity') ? ' class="active"' : '') }}} >@lang('general.activity_report')</a></li>

<li><a href="{{ URL::to('reports/depreciation') }}" {{{ (Request::is('reports/depreciation') ? ' class="active"' : '') }}} >@lang('general.depreciation_report')</a></li>
<li><a href="{{ URL::to('reports/licenses') }}" {{{ (Request::is('reports/licenses') ? ' class="active"' : '') }}} >@lang('general.license_report')</a></li>
<li><a href="{{ URL::to('reports/assets') }}" {{{ (Request::is('reports/assets') ? ' class="active"' : '') }}} >@lang('general.asset_report')</a></li>
Expand Down
73 changes: 73 additions & 0 deletions app/views/backend/reports/activity.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
@extends('backend/layouts/default')

{{-- Page title --}}
@section('title')
@lang('general.license_report') ::
@parent
@stop

{{-- Page content --}}
@section('content')


<div class="page-header">

<h3>@lang('general.activity_report')</h3>
</div>

<div class="row">

<div class="table-responsive">
<table id="example">
<thead>
<tr role="row">
<th class="col-sm-1">Admin</th>
<th class="col-sm-1">@lang('table.action')</th>
<th class="col-sm-1"></th>
<th class="col-sm-1">Type</th>
<th class="col-sm-1">Item</th>
<th class="col-sm-1">Date</th
</tr>
</thead>
<tbody>

@foreach ($log_actions as $log_action)
<tr>
<td><a href="../admin/users/{{ $log_action->adminlog->id }}/view">{{ $log_action->adminlog->fullName() }}</a></td>
<td>{{{ $log_action->action_type }}}</td>
<td>
@if ($log_action->userlog)
<a href="../admin/users/{{ $log_action->userlog->id }}/view">{{ $log_action->userlog->fullName() }}</a>
@endif
</td>
<td>
@if ($log_action->assetlog)
Asset
@elseif ($log_action->licenselog)
License
@elseif ($log_action->accessorylog)
Accessory
@endif

</td>
<td>

@if ($log_action->assetlog)
{{ $log_action->assetlog->name }}
@elseif ($log_action->licenselog)
{{ $log_action->licenselog->name }}
@elseif ($log_action->accessorylog)
{{ $log_action->accessorylog->name }}
@endif


</td>
<td>{{{ $log_action->created_at }}}</td>
</tr>
@endforeach
</tbody>
</table>

</div>

@stop
9 changes: 0 additions & 9 deletions app/views/backend/settings/edit.blade.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
@extends('backend/layouts/default')

<?php
use DebugBar\StandardDebugBar;
$debugbar = new StandardDebugBar();
$debugbarRenderer = $debugbar->getJavascriptRenderer();
$debugbar["messages"]->addMessage("hello world!");
?>

{{-- Page title --}}
@section('title')
@lang('admin/settings/general.update') ::
Expand Down

0 comments on commit d61506f

Please sign in to comment.