Merge pull request #335 from madd15/feature-new-license-fields

Add Fields to Licenses and Update Supplier for Licenses
This commit is contained in:
snipe
2014-11-05 18:26:57 -05:00
10 changed files with 285 additions and 123 deletions
+96 -69
View File
@@ -15,6 +15,7 @@ use Depreciation;
use Setting;
use Sentry;
use Str;
use Supplier;
use Validator;
use View;
@@ -49,10 +50,10 @@ class LicensesController extends AdminController
{
// Show the page
$license_options = array('0' => 'Top Level') + License::lists('name', 'id');
// Show the page
$depreciation_list = array('0' => Lang::get('admin/licenses/form.no_depreciation')) + Depreciation::lists('name', 'id');
return View::make('backend/licenses/edit')->with('license_options',$license_options)->with('depreciation_list',$depreciation_list)->with('license',new License);
$supplier_list = array('' => 'Select Supplier') + Supplier::orderBy('name', 'asc')->lists('name', 'id');
return View::make('backend/licenses/edit')->with('license_options',$license_options)->with('depreciation_list',$depreciation_list)->with('supplier_list',$supplier_list)->with('license',new License);
}
@@ -74,31 +75,43 @@ class LicensesController extends AdminController
// attempt validation
if ($license->validate($new)) {
if ( e(Input::get('purchase_cost')) == '') {
if ( e(Input::get('purchase_cost')) == '') {
$license->purchase_cost = NULL;
} else {
$license->purchase_cost = ParseFloat(e(Input::get('purchase_cost')));
//$license->purchase_cost = e(Input::get('purchase_cost'));
}
if ( e(Input::get('supplier_id')) == '') {
$license->supplier_id = NULL;
} else {
$license->supplier_id = e(Input::get('supplier_id'));
}
// Save the license data
$license->name = e(Input::get('name'));
$license->serial = e(Input::get('serial'));
$license->license_email = e(Input::get('license_email'));
$license->license_name = e(Input::get('license_name'));
$license->notes = e(Input::get('notes'));
$license->order_number = e(Input::get('order_number'));
$license->seats = e(Input::get('seats'));
$license->purchase_date = e(Input::get('purchase_date'));
//$license->purchase_cost = e(Input::get('purchase_cost'));
$license->depreciation_id = e(Input::get('depreciation_id'));
//$license->asset_id = e(Input::get('asset_id'));
$license->user_id = Sentry::getId();
$license->name = e(Input::get('name'));
$license->serial = e(Input::get('serial'));
$license->license_email = e(Input::get('license_email'));
$license->license_name = e(Input::get('license_name'));
$license->notes = e(Input::get('notes'));
$license->order_number = e(Input::get('order_number'));
$license->seats = e(Input::get('seats'));
$license->purchase_date = e(Input::get('purchase_date'));
$license->purchase_order = e(Input::get('purchase_order'));
//$license->purchase_cost = e(Input::get('purchase_cost'));
$license->depreciation_id = e(Input::get('depreciation_id'));
$license->expiration_date = e(Input::get('expiration_date'));
//$license->asset_id = e(Input::get('asset_id'));
$license->user_id = Sentry::getId();
if (($license->purchase_date == "") || ($license->purchase_date == "0000-00-00")) {
$license->purchase_date = NULL;
}
if (($license->expiration_date == "") || ($license->expiration_date == "0000-00-00")) {
$license->expiration_date = NULL;
}
if (($license->purchase_cost == "") || ($license->purchase_cost == "0.00")) {
$license->purchase_cost = NULL;
}
@@ -109,10 +122,10 @@ class LicensesController extends AdminController
// Save the license seat data
for ($x=0; $x<$license->seats; $x++) {
$license_seat = new LicenseSeat();
$license_seat->license_id = $insertedId;
$license_seat->user_id = Sentry::getId();
$license_seat->assigned_to = 0;
$license_seat->notes = NULL;
$license_seat->license_id = $insertedId;
$license_seat->user_id = Sentry::getId();
$license_seat->assigned_to = 0;
$license_seat->notes = NULL;
$license_seat->save();
}
@@ -156,7 +169,8 @@ class LicensesController extends AdminController
// Show the page
$license_options = array('' => 'Top Level') + DB::table('assets')->where('id', '!=', $licenseId)->lists('name', 'id');
$depreciation_list = array('0' => Lang::get('admin/licenses/form.no_depreciation')) + Depreciation::lists('name', 'id');
return View::make('backend/licenses/edit', compact('license'))->with('license_options',$license_options)->with('depreciation_list',$depreciation_list);
$supplier_list = array('' => 'Select Supplier') + Supplier::orderBy('name', 'asc')->lists('name', 'id');
return View::make('backend/licenses/edit', compact('license'))->with('license_options',$license_options)->with('depreciation_list',$depreciation_list)->with('supplier_list',$supplier_list);
}
@@ -184,14 +198,20 @@ class LicensesController extends AdminController
if ($license->validate($new)) {
// Update the license data
$license->name = e(Input::get('name'));
$license->serial = e(Input::get('serial'));
$license->license_email = e(Input::get('license_email'));
$license->license_name = e(Input::get('license_name'));
$license->notes = e(Input::get('notes'));
$license->order_number = e(Input::get('order_number'));
$license->depreciation_id = e(Input::get('depreciation_id'));
$license->name = e(Input::get('name'));
$license->serial = e(Input::get('serial'));
$license->license_email = e(Input::get('license_email'));
$license->license_name = e(Input::get('license_name'));
$license->notes = e(Input::get('notes'));
$license->order_number = e(Input::get('order_number'));
$license->depreciation_id = e(Input::get('depreciation_id'));
$license->purchase_order = e(Input::get('purchase_order'));
if ( e(Input::get('supplier_id')) == '') {
$license->supplier_id = NULL;
} else {
$license->supplier_id = e(Input::get('supplier_id'));
}
// Update the asset data
if ( e(Input::get('purchase_date')) == '') {
@@ -200,6 +220,12 @@ class LicensesController extends AdminController
$license->purchase_date = e(Input::get('purchase_date'));
}
if ( e(Input::get('expiration_date')) == '') {
$license->expiration_date = NULL;
} else {
$license->expiration_date = e(Input::get('expiration_date'));
}
if ( e(Input::get('purchase_cost')) == '') {
$license->purchase_cost = NULL;
} else {
@@ -245,10 +271,10 @@ class LicensesController extends AdminController
for ($i=1; $i <= $difference; $i++) {
//Create a seat for this license
$license_seat = new LicenseSeat();
$license_seat->license_id = $license->id;
$license_seat->user_id = Sentry::getId();
$license_seat->assigned_to = 0;
$license_seat->notes = NULL;
$license_seat->license_id = $license->id;
$license_seat->user_id = Sentry::getId();
$license_seat->assigned_to = 0;
$license_seat->notes = NULL;
$license_seat->save();
}
@@ -260,7 +286,7 @@ class LicensesController extends AdminController
$logaction->note = abs($difference)." seats";
$log = $logaction->logaction('add seats');
}
$license->seats = e(Input::get('seats'));
$license->seats = e(Input::get('seats'));
}
// Was the asset created?
@@ -328,28 +354,28 @@ class LicensesController extends AdminController
// Get the dropdown of users and then pass it to the checkout view
$users_list = array('' => 'Select a User') + DB::table('users')->select(DB::raw('concat (first_name," ",last_name) as full_name, id'))->whereNull('deleted_at')->lists('full_name', 'id');
// Left join to get a list of assets and some other helpful info
$asset = DB::table('assets')
->leftJoin('users', 'users.id', '=', 'assets.assigned_to')
->select('assets.id', 'name', 'first_name', 'last_name','asset_tag',
DB::raw('concat (first_name," ",last_name) as full_name, assets.id as id'))
->whereNull('assets.deleted_at')
->get();
// Left join to get a list of assets and some other helpful info
$asset = DB::table('assets')
->leftJoin('users', 'users.id', '=', 'assets.assigned_to')
->select('assets.id', 'name', 'first_name', 'last_name','asset_tag',
DB::raw('concat (first_name," ",last_name) as full_name, assets.id as id'))
->whereNull('assets.deleted_at')
->get();
$asset_array = json_decode(json_encode($asset), true);
$asset_element[''] = 'Please select an asset';
$asset_array = json_decode(json_encode($asset), true);
$asset_element[''] = 'Please select an asset';
// Build a list out of the data results
for ($x=0; $x<count($asset_array); $x++) {
// Build a list out of the data results
for ($x=0; $x<count($asset_array); $x++) {
if ($asset_array[$x]['full_name']!='') {
$full_name = ' ('.$asset_array[$x]['full_name'].')';
} else {
$full_name = ' (Unassigned)';
}
$asset_element[$asset_array[$x]['id']] = $asset_array[$x]['asset_tag'].' - '.$asset_array[$x]['name'].$full_name;
if ($asset_array[$x]['full_name']!='') {
$full_name = ' ('.$asset_array[$x]['full_name'].')';
} else {
$full_name = ' (Unassigned)';
}
$asset_element[$asset_array[$x]['id']] = $asset_array[$x]['asset_tag'].' - '.$asset_array[$x]['name'].$full_name;
}
}
return View::make('backend/licenses/checkout', compact('licenseseat'))->with('users_list',$users_list)->with('asset_list',$asset_element);
@@ -371,7 +397,7 @@ class LicensesController extends AdminController
$rules = array(
'note' => 'alpha_space',
'asset_id' => 'required_without:assigned_to',
'asset_id' => 'required_without:assigned_to',
);
// Create a new validator instance from our validation rules
@@ -383,25 +409,25 @@ class LicensesController extends AdminController
return Redirect::back()->withInput()->withErrors($validator);
}
if ($assigned_to!='') {
if ($assigned_to!='') {
// Check if the user exists
if (is_null($is_assigned_to = User::find($assigned_to))) {
// Redirect to the asset management page with error
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.user_does_not_exist'));
}
if (is_null($is_assigned_to = User::find($assigned_to))) {
// Redirect to the asset management page with error
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.user_does_not_exist'));
}
}
if ($asset_id!='') {
if (is_null($is_asset_id = Asset::find($asset_id))) {
// Redirect to the asset management page with error
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.asset_does_not_exist'));
}
if (is_null($is_asset_id = Asset::find($asset_id))) {
// Redirect to the asset management page with error
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.asset_does_not_exist'));
}
if (($is_asset_id->assigned_to!=$assigned_to) && ($assigned_to!='')) {
//echo 'asset assigned to: '.$is_asset_id->assigned_to.'<br>license assigned to: '.$assigned_to;
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.owner_doesnt_match_asset'));
}
if (($is_asset_id->assigned_to!=$assigned_to) && ($assigned_to!='')) {
//echo 'asset assigned to: '.$is_asset_id->assigned_to.'<br>license assigned to: '.$assigned_to;
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.owner_doesnt_match_asset'));
}
}
@@ -412,8 +438,8 @@ class LicensesController extends AdminController
// Redirect to the asset management page with error
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.not_found'));
}
if ( e(Input::get('asset_id')) == '') {
if ( e(Input::get('asset_id')) == '') {
$licenseseat->asset_id = NULL;
} else {
$licenseseat->asset_id = e(Input::get('asset_id'));
@@ -503,8 +529,8 @@ class LicensesController extends AdminController
$logaction->checkedout_to = $licenseseat->assigned_to;
// Update the asset data
$licenseseat->assigned_to = '0';
$licenseseat->asset_id = NULL;
$licenseseat->assigned_to = '0';
$licenseseat->asset_id = NULL;
// Was the asset updated?
if($licenseseat->save()) {
@@ -562,7 +588,8 @@ class LicensesController extends AdminController
// Show the page
$depreciation_list = array('0' => Lang::get('admin/licenses/form.no_depreciation')) + Depreciation::lists('name', 'id');
return View::make('backend/licenses/edit')->with('license_options',$license_options)->with('depreciation_list',$depreciation_list)->with('license',$license);
$supplier_list = array('' => 'Select Supplier') + Supplier::orderBy('name', 'asc')->lists('name', 'id');
return View::make('backend/licenses/edit')->with('license_options',$license_options)->with('depreciation_list',$depreciation_list)->with('supplier_list',$supplier_list)->with('license',$license);
}
}
@@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddFieldsToLicenses extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('licenses', function ($table) {
$table->integer('supplier_id')->nullable()->default(NULL);
$table->date('expiration_date')->nullable();
$table->string('purchase_order');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('licenses', function ($table) {
$table->dropColumn('supplier_id');
$table->dropColumn('expiration_date');
$table->dropColumn('purchase_order');
});
}
}
+22 -19
View File
@@ -2,23 +2,26 @@
return array(
'asset' => 'Asset',
'checkin' => 'Checkin',
'checkin' => 'Checkin',
'cost' => 'Purchase Cost',
'cost' => 'Purchase Cost',
'create' => 'Create License',
'date' => 'Purchase Date',
'date' => 'Purchase Date',
'depreciation' => 'Depreciation',
'name' => 'Software Name',
'no_depreciation' => 'Do Not Depreciate',
'notes' => 'Notes',
'order' => 'Order No.',
'seats' => 'Seats',
'serial' => 'Serial',
'to_email' => 'Licensed to Email',
'to_name' => 'Licensed to Name',
'update' => 'Update License',
'checkout_help' => 'You must check a license out to a hardware asset or a person. You can select both, but the owner of the asset must match the person you\'re checking the asset out to.'
'asset' => 'Asset',
'checkin' => 'Checkin',
'checkin' => 'Checkin',
'cost' => 'Purchase Cost',
'cost' => 'Purchase Cost',
'create' => 'Create License',
'date' => 'Purchase Date',
'date' => 'Purchase Date',
'depreciation' => 'Depreciation',
'expiration' => 'Expiration Date',
'name' => 'Software Name',
'no_depreciation' => 'Do Not Depreciate',
'notes' => 'Notes',
'order' => 'Order Number',
'purchase_order' => 'Purchase Order Number',
'seats' => 'Seats',
'serial' => 'Serial',
'supplier' => 'Supplier',
'to_email' => 'Licensed to Email',
'to_name' => 'Licensed to Name',
'update' => 'Update License',
'checkout_help' => 'You must check a license out to a hardware asset or a person. You can select both, but the owner of the asset must match the person you\'re checking the asset out to.'
);
+20 -19
View File
@@ -1,24 +1,25 @@
<?php
return array(
'address' => 'Supplier Address',
'assets' => 'Assets',
'city' => 'City',
'contact' => 'Contact Name',
'country' => 'Country',
'create' => 'Create Supplier',
'email' => 'Email',
'fax' => 'Fax',
'id' => 'ID',
'name' => 'Supplier Name',
'notes' => 'Notes',
'phone' => 'Phone',
'state' => 'State',
'suppliers' => 'Suppliers',
'update' => 'Update Supplier',
'url' => 'URL',
'view' => 'View Supplier',
'view_assets_for' => 'View Assets for',
'zip' => 'Postal Code',
'address' => 'Supplier Address',
'assets' => 'Assets',
'city' => 'City',
'contact' => 'Contact Name',
'country' => 'Country',
'create' => 'Create Supplier',
'email' => 'Email',
'fax' => 'Fax',
'id' => 'ID',
'licenses' => 'Licenses',
'name' => 'Supplier Name',
'notes' => 'Notes',
'phone' => 'Phone',
'state' => 'State',
'suppliers' => 'Suppliers',
'update' => 'Update Supplier',
'url' => 'URL',
'view' => 'View Supplier',
'view_assets_for' => 'View Assets for',
'zip' => 'Postal Code',
);
+6 -1
View File
@@ -112,6 +112,11 @@ class License extends Elegant
return $this->hasMany('LicenseSeat');
}
public function supplier()
{
return $this->belongsTo('Supplier','supplier_id');
}
/**
* Get depreciation class
*
@@ -147,7 +152,7 @@ class License extends Elegant
/**
/**
* Handle depreciation
*/
public function depreciate()
+17 -8
View File
@@ -4,19 +4,19 @@ class Supplier extends Elegant
protected $softDelete = true;
// Declare the rules for the form validation
protected $rules = array(
'name' => 'required|alpha_space|min:3|max:255|unique:suppliers,name,{id}',
'address' => 'alpha_space|min:3|max:50',
'address2' => 'alpha_space|min:2|max:50',
'city' => 'alpha_space|min:3|max:255',
'name' => 'required|alpha_space|min:3|max:255|unique:suppliers,name,{id}',
'address' => 'alpha_space|min:3|max:50',
'address2' => 'alpha_space|min:2|max:50',
'city' => 'alpha_space|min:3|max:255',
'state' => 'alpha_space|min:0|max:32',
'country' => 'alpha_space|min:0|max:2',
'fax' => 'alpha_space|min:7|max:20',
'phone' => 'alpha_space|min:7|max:20',
'fax' => 'alpha_space|min:7|max:20',
'phone' => 'alpha_space|min:7|max:20',
'contact' => 'alpha_space|min:0|max:100',
'notes' => 'alpha_space|min:0|max:255',
'email' => 'email|min:5|max:150',
'email' => 'email|min:5|max:150',
'zip' => 'alpha_space|min:0|max:10',
'url' => 'alpha_space|min:3|max:250',
'url' => 'alpha_space|min:3|max:250',
);
@@ -30,6 +30,15 @@ class Supplier extends Elegant
return $this->hasMany('Asset', 'supplier_id')->count();
}
public function licenses()
{
return $this->hasMany('License', 'supplier_id');
}
public function num_licenses()
{
return $this->hasMany('License', 'supplier_id')->count();
}
public function addhttp($url)
{
+35 -2
View File
@@ -33,7 +33,7 @@
<!-- CSRF Token -->
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
<!-- Asset Tag -->
<!-- License -->
<div class="form-group {{ $errors->has('name') ? ' has-error' : '' }}">
<label for="name" class="col-md-3 control-label">@lang('admin/licenses/form.name')
<i class='icon-asterisk'></i></label>
@@ -44,6 +44,7 @@
</div>
</div>
<!-- Serial -->
<div class="form-group {{ $errors->has('serial') ? ' has-error' : '' }}">
<label for="serial" class="col-md-3 control-label">@lang('admin/licenses/form.serial')
<i class='icon-asterisk'></i></label>
@@ -54,6 +55,7 @@
</div>
</div>
<!-- Licensed to name -->
<div class="form-group {{ $errors->has('license_name') ? ' has-error' : '' }}">
<label for="license_name" class="col-md-3 control-label">@lang('admin/licenses/form.to_name')</label>
<div class="col-md-7">
@@ -62,6 +64,7 @@
</div>
</div>
<!-- Licensed to email -->
<div class="form-group {{ $errors->has('license_email') ? ' has-error' : '' }}">
<label for="license_email" class="col-md-3 control-label">@lang('admin/licenses/form.to_email')</label>
<div class="col-md-7">
@@ -70,6 +73,7 @@
</div>
</div>
<!-- Seats -->
<div class="form-group {{ $errors->has('seats') ? ' has-error' : '' }}">
<label for="seats" class="col-md-3 control-label">@lang('admin/licenses/form.seats')
<i class='icon-asterisk'></i></label>
@@ -80,6 +84,26 @@
</div>
</div>
<!-- Expiration Date -->
<div class="form-group {{ $errors->has('expiration_date') ? ' has-error' : '' }}">
<label for="expiration_date" class="col-md-3 control-label">@lang('admin/licenses/form.expiration')</label>
<div class="input-group col-md-2">
<input type="date" class="datepicker form-control" data-date-format="yyyy-mm-dd" placeholder="Select Date" name="expiration_date" id="expiration_date" value="{{ Input::old('expiration_date', $license->expiration_date) }}">
<span class="input-group-addon"><i class="icon-calendar"></i></span>
{{ $errors->first('expiration_date', '<span class="alert-msg"><i class="icon-remove-sign"></i> :message</span>') }}
</div>
</div>
<!-- Supplier -->
<div class="form-group {{ $errors->has('supplier_id') ? ' has-error' : '' }}">
<label for="supplier_id" class="col-md-3 control-label">@lang('admin/licenses/form.supplier')</label>
<div class="col-md-7">
{{ Form::select('supplier_id', $supplier_list , Input::old('supplier_id', $license->supplier_id), array('class'=>'select2', 'style'=>'min-width:350px')) }}
{{ $errors->first('supplier_id', '<span class="alert-msg"><i class="icon-remove-sign"></i> :message</span>') }}
</div>
</div>
<!-- Order Number -->
<div class="form-group {{ $errors->has('order_number') ? ' has-error' : '' }}">
<label for="order_number" class="col-md-3 control-label">@lang('admin/licenses/form.order')</label>
<div class="col-md-7">
@@ -110,6 +134,15 @@
</div>
</div>
<!-- Purchase Order -->
<div class="form-group {{ $errors->has('purchase_order') ? ' has-error' : '' }}">
<label for="purchase_order" class="col-md-3 control-label">@lang('admin/licenses/form.purchase_order')</label>
<div class="col-md-7">
<input class="form-control" type="text" name="purchase_order" id="purchase_order" value="{{ Input::old('purchase_order', $license->purchase_order) }}" />
{{ $errors->first('purchase_order', '<span class="alert-msg"><i class="icon-remove-sign"></i> :message</span>') }}
</div>
</div>
<!-- Depreciation -->
<div class="form-group {{ $errors->has('depreciation_id') ? ' has-error' : '' }}">
<label for="parent" class="col-md-3 control-label">@lang('admin/licenses/form.depreciation')</label>
@@ -119,7 +152,7 @@
</div>
</div>
<!-- Notes -->
<!-- Notes -->
<div class="form-group {{ $errors->has('notes') ? ' has-error' : '' }}">
<label for="notes" class="col-md-3 control-label">@lang('admin/licenses/form.notes')</label>
<div class="col-md-7">
+15 -2
View File
@@ -43,6 +43,17 @@
<div class="col-md-6"><strong>@lang('admin/licenses/form.to_email'): </strong> {{ $license->license_email }} </div>
@endif
@if ($license->supplier_id)
<div class="col-md-6"><strong>@lang('admin/licenses/form.supplier'): </strong>
<a href="{{ route('view/supplier', $license->supplier_id) }}">
{{{ $license->supplier->name }}}
</a> </div>
@endif
@if ($license->expiration_date > 0)
<div class="col-md-6"><strong>@lang('admin/licenses/form.expiration'): </strong> {{ $license->expiration_date }} </div>
@endif
@if ($license->notes)
<div class="col-md-6"><strong>@lang('admin/licenses/form.notes'): </strong>{{ $license->notes }}</div>
@endif
@@ -104,7 +115,7 @@
<td>
@if ($licensedto->asset_id)
<a href="{{ route('view/hardware', $licensedto->asset_id) }}">
{{ $licensedto->asset->name }} {{ $licensedto->asset->asset_tag }}
{{ $licensedto->asset->name }} {{ $licensedto->asset->asset_tag }}
</a>
@endif
</td>
@@ -188,7 +199,9 @@
<div class="col-md-3 col-xs-12 address pull-right">
<h6><br>@lang('general.moreinfo'):</h6>
<ul>
@if ($license->purchase_order)
<li>@lang('admin/licenses/form.purchase_order'): {{ $license->purchase_order }} </li>
@endif
@if ($license->purchase_date > 0)
<li>@lang('admin/licenses/form.date'): {{ $license->purchase_date }} </li>
@endif
@@ -29,6 +29,7 @@
<th class="col-md-3">@lang('admin/suppliers/table.contact')</th>
<th class="col-md-3">@lang('admin/suppliers/table.phone')</th>
<th class="col-md-3">@lang('admin/suppliers/table.assets')</th>
<th class="col-md-3">@lang('admin/suppliers/table.licenses')</th>
<th class="col-md-2 actions">@lang('table.actions')</th>
</tr>
</thead>
@@ -56,6 +57,7 @@
</td>
<td>{{{ $supplier->phone }}}</td>
<td>{{{ $supplier->num_assets() }}}</td>
<td>{{{ $supplier->num_licenses() }}}</td>
<td>
<a href="{{ route('update/supplier', $supplier->id) }}" class="btn btn-warning"><i class="icon-pencil icon-white"></i></a>
<a data-html="false" class="btn delete-asset btn-danger" data-toggle="modal" href="{{ route('delete/supplier', $supplier->id) }}" data-content="@lang('admin/suppliers/message.delete.confirm')"
+36 -3
View File
@@ -23,9 +23,11 @@
<div class="user-profile">
<div class="row profile">
<div class="col-md-9 bio">
<div class="profile-box">
<!-- checked out suppliers table -->
<h6>Assets</h6>
<br>
@if (count($supplier->assets) > 0)
<table id="example">
<thead>
@@ -65,15 +67,46 @@
</table>
@else
<div class="col-md-9">
<div class="col-md-12">
<div class="alert alert-info alert-block">
<i class="icon-info-sign"></i>
@lang('general.no_results')
</div>
</div>
@endif
<br>
<br>
<h6>Software</h6>
<br>
@if (count($supplier->licenses) > 0)
<table class="table table-hover">
<thead>
<tr>
<th class="col-md-4"><span class="line"></span>Name</th>
<th class="col-md-4"><span class="line"></span>Serial</th>
</tr>
</thead>
<tbody>
@foreach ($supplier->licenses as $license)
<tr>
<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>
</tr>
@endforeach
</tbody>
</table>
@else
</div>
<div class="col-md-12">
<div class="alert alert-info alert-block">
<i class="icon-info-sign"></i>
@lang('general.no_results')
</div>
</div>
@endif
</div>
</div>
<!-- side address column -->