Merge branch 'refs/heads/develop'

This commit is contained in:
snipe
2013-11-25 05:37:02 -05:00
8 changed files with 103 additions and 20 deletions
@@ -117,6 +117,7 @@ class AssetsController extends AdminController {
$asset->notes = e(Input::get('notes'));
$asset->asset_tag = e(Input::get('asset_tag'));
$asset->status_id = e(Input::get('status_id'));
$asset->warrantee_months = e(Input::get('warrantee_months'));
$asset->user_id = Sentry::getId();
$asset->physical = '1';
@@ -191,6 +192,7 @@ class AssetsController extends AdminController {
'asset_tag' => 'required|min:3',
'model_id' => 'required',
'serial' => 'required|min:3',
'warrantee_months' => 'integer|min:1',
);
// Create a new validator instance from our validation rules
@@ -213,6 +215,7 @@ class AssetsController extends AdminController {
$asset->order_number = e(Input::get('order_number'));
$asset->asset_tag = e(Input::get('asset_tag'));
$asset->status_id = e(Input::get('status_id'));
$asset->warrantee_months = e(Input::get('warrantee_months'));
$asset->notes = e(Input::get('notes'));
$asset->physical = '1';
@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
class AddWarranteeToAssetsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//
Schema::table('assets', function($table)
{
$table->integer('warrantee_months')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
Schema::table('assets', function($table)
{
$table->dropColumn('warrantee_months');
});
}
}
+12
View File
@@ -9,6 +9,7 @@ class Asset extends Elegant {
'asset_tag' => 'required|min:3|unique:assets',
'model_id' => 'required',
'serial' => 'required|min:3',
'warrantee_months' => 'integer|min:1',
);
@@ -104,4 +105,15 @@ class Asset extends Elegant {
}
public function warrantee_expires()
{
$date = date_create($this->purchase_date);
date_add($date, date_interval_create_from_date_string($this->warrantee_months.' months'));
return date_format($date, 'Y-m-d');
}
}
+9
View File
@@ -105,6 +105,15 @@
</div>
</div>
<!-- Warrantee -->
<div class="control-group {{ $errors->has('warrantee_months') ? 'error' : '' }}">
<label class="control-label" for="serial">Warrantee</label>
<div class="controls">
<input class="span1" type="text" name="warrantee_months" id="warrantee_months" value="{{ Input::old('warrantee_months', $asset->warrantee_months) }}" /> months
{{ $errors->first('warrantee_months', '<span class="help-inline">:message</span>') }}
</div>
</div>
<!-- Depreciation -->
<div class="control-group {{ $errors->has('depreciation_id') ? 'error' : '' }}">
<label class="control-label" for="parent">Depreciation</label>
+19
View File
@@ -98,6 +98,25 @@ View Asset {{ $asset->asset_tag }} ::
<!-- side address column -->
<div class="span3 address pull-right">
<h6><br>More Info:</h6>
<ul>
@if ($asset->purchase_date)
<li>Purchase Date: {{ $asset->purchase_date }} </li>
@endif
@if ($asset->purchase_cost)
<li>Purchase Cost: ${{ number_format($asset->purchase_cost) }} </li>
@endif
@if ($asset->order_number)
<li>Order #: {{ $asset->order_number }} </li>
@endif
@if ($asset->warrantee_months)
<li>Warrantee: {{ $asset->warrantee_months }} months</li>
<li>Expires: {{ $asset->warrantee_expires() }}</li>
@endif
</ul>
@if ((isset($asset->assigned_to ) && ($asset->assigned_to > 0)))
<h6><br>Checked Out To:</h6>
<ul>
+15 -19
View File
@@ -26,10 +26,7 @@ Licenses ::
<th class="span1">@lang('admin/licenses/table.seats')</th>
<th class="span2"><span class="line"></span>@lang('admin/licenses/table.title')</th>
<th class="span2"><span class="line"></span>@lang('admin/licenses/table.serial')</th>
<th class="span2"><span class="line"></span>@lang('admin/licenses/table.license_name')</th>
<th class="span2"><span class="line"></span>@lang('admin/licenses/table.license_email')</th>
<th class="span2"><span class="line"></span>@lang('admin/licenses/table.assigned_to')</th>
<th class="span2"><span class="line"></span>@lang('admin/licenses/table.checkout')</th>
<th class="span2"><span class="line"></span>@lang('table.actions')</th>
</tr>
</thead>
@@ -42,9 +39,8 @@ Licenses ::
<td>{{ $license->seats }}</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>
<td></td>
<td></td>
<td>
@@ -61,19 +57,6 @@ Licenses ::
<tr>
<td></td>
<td></td>
<td><i class="icon-chevron-right"></i> {{ $license->serial }}</td>
<td>{{ $license->license_name }}</td>
<td>{{ $license->license_email }} </td>
<td>
@if ($licensedto->assigned_to)
<a href="{{ route('view/user', $licensedto->id) }}">
{{ $licensedto->user->fullName() }}
</a>
@endif
</td>
<td>
@if ($licensedto->assigned_to)
<a href="{{ route('checkin/license', $licensedto->id) }}" class="btn-flat info"> Checkin </a>
@@ -81,8 +64,21 @@ Licenses ::
<a href="{{ route('checkout/license', $licensedto->id) }}" class="btn-flat success">Checkout</a>
@endif
</td>
<td><i class="icon-arrow-right"></i> {{ $license->serial }}</td>
<td>
@if ($licensedto->assigned_to)
<a href="{{ route('view/user', $licensedto->id) }}">
{{ $licensedto->user->fullName() }}
</a>
@endif
</td>
<td></td>
</tr>
@endforeach
@endif
@@ -154,6 +154,15 @@ View License {{ $license->name }} ::
@if ($license->purchase_date)
<li>Purchase Date: {{ $license->purchase_date }} </li>
@endif
@if ($license->purchase_cost)
<li>Purchase Cost: ${{ number_format($license->purchase_cost) }} </li>
@endif
@if ($license->order_number)
<li>Order #: {{ $license->order_number }} </li>
@endif
@if ($license->seats)
<li>Seats: {{ $license->seats }} </li>
@endif
</ul>
</div>
+1 -1
View File
@@ -93,7 +93,7 @@
.btn-flat {
display: inline-block;
margin: 0;
line-height: 15px;
line-height: 11px;
vertical-align: middle;
font-size: 12px;
text-shadow: none;