Add manufacturer to licenses (#2436)

* Add manufacturer to licenses.  Shows in table and edit.  Need to improve manufacturer view to show lists beyond assets still.

* Remove extra closing tags, formatting

* Work on making the manufacturer view show more options. Need to figure out how to change the table dynamically.

* Cleanup formatting and fix a few weirdities in hardware/view.blade.php

* Standardize on two-space tabs in this file, as it seems the most
* common.

* Fix a few places where we call number_format without guaranteeing the
* item is a number and not a string.

* Show a "No Results" message on components page if there are no
* components.

* Show table of licenses on manufacturer view page.

This reworks the ManufacturersController::getDataView method to delegate
the view to a sub method (currently assets or licenses, but plan to
extend to consumables/accessories/components as well).  We then put tabs
at the top of the view to show multiple tables.  This just duplicates
the table layout from licenses/index.blade, but I wonder if theres a way
to centralize that code, maybe through partials, over time..

The only known missing part of manufacturers for licenses would be adding it
to the importer, but the license importer should probably migrate to
object importer before doing too much more...

* Add manufacturer to accessory.

* Add consumables to the manufacturer view page.
This commit is contained in:
Daniel Meltzer 2016-08-16 20:49:54 -05:00 committed by snipe
parent 44821b9667
commit ac63642224
18 changed files with 911 additions and 490 deletions

View file

@ -53,14 +53,12 @@ class AccessoriesController extends Controller
public function getCreate(Request $request) public function getCreate(Request $request)
{ {
// Show the page // Show the page
$category_list = Helper::categoryList('accessory');
$company_list = Helper::companyList();
$location_list = Helper::locationsList();
return View::make('accessories/edit') return View::make('accessories/edit')
->with('accessory', new Accessory) ->with('accessory', new Accessory)
->with('category_list', $category_list) ->with('category_list', Helper::categoryList('accessory'))
->with('company_list', $company_list) ->with('company_list', Helper::companyList())
->with('location_list', $location_list); ->with('location_list', Helper::locationsList())
->with('manufacturer_list', Helper::manufacturerList());
} }
@ -77,12 +75,13 @@ class AccessoriesController extends Controller
$accessory = new Accessory(); $accessory = new Accessory();
// Update the accessory data // Update the accessory data
$accessory->name = e(Input::get('name')); $accessory->name = e(Input::get('name'));
$accessory->category_id = e(Input::get('category_id')); $accessory->category_id = e(Input::get('category_id'));
$accessory->location_id = e(Input::get('location_id')); $accessory->location_id = e(Input::get('location_id'));
$accessory->min_amt = e(Input::get('min_amt')); $accessory->min_amt = e(Input::get('min_amt'));
$accessory->company_id = Company::getIdForCurrentUser(Input::get('company_id')); $accessory->company_id = Company::getIdForCurrentUser(Input::get('company_id'));
$accessory->order_number = e(Input::get('order_number')); $accessory->order_number = e(Input::get('order_number'));
$accessory->manufacturer_id = e(Input::get('manufacturer_id'));
if (e(Input::get('purchase_date')) == '') { if (e(Input::get('purchase_date')) == '') {
$accessory->purchase_date = null; $accessory->purchase_date = null;
@ -96,8 +95,8 @@ class AccessoriesController extends Controller
$accessory->purchase_cost = e(Input::get('purchase_cost')); $accessory->purchase_cost = e(Input::get('purchase_cost'));
} }
$accessory->qty = e(Input::get('qty')); $accessory->qty = e(Input::get('qty'));
$accessory->user_id = Auth::user()->id; $accessory->user_id = Auth::user()->id;
// Was the accessory created? // Was the accessory created?
if ($accessory->save()) { if ($accessory->save()) {
@ -126,14 +125,11 @@ class AccessoriesController extends Controller
return redirect()->to('admin/accessories')->with('error', trans('general.insufficient_permissions')); return redirect()->to('admin/accessories')->with('error', trans('general.insufficient_permissions'));
} }
$category_list = Helper::categoryList('accessory');
$company_list = Helper::companyList();
$location_list = Helper::locationsList();
return View::make('accessories/edit', compact('accessory')) return View::make('accessories/edit', compact('accessory'))
->with('category_list', $category_list) ->with('category_list', Helper::categoryList('accessory'))
->with('company_list', $company_list) ->with('company_list', Helper::companyList())
->with('location_list', $location_list); ->with('location_list', Helper::locationsList())
->with('manufacturer_list', Helper::manufacturerList());
} }
@ -146,9 +142,9 @@ class AccessoriesController extends Controller
*/ */
public function postEdit(Request $request, $accessoryId = null) public function postEdit(Request $request, $accessoryId = null)
{ {
// Check if the blog post exists // Check if the accessory exists
if (is_null($accessory = Accessory::find($accessoryId))) { if (is_null($accessory = Accessory::find($accessoryId))) {
// Redirect to the blogs management page // Redirect to the accessory index page
return redirect()->to('admin/accessories')->with('error', trans('admin/accessories/message.does_not_exist')); return redirect()->to('admin/accessories')->with('error', trans('admin/accessories/message.does_not_exist'));
} elseif (!Company::isCurrentUserHasAccess($accessory)) { } elseif (!Company::isCurrentUserHasAccess($accessory)) {
return redirect()->to('admin/accessories')->with('error', trans('general.insufficient_permissions')); return redirect()->to('admin/accessories')->with('error', trans('general.insufficient_permissions'));
@ -160,11 +156,12 @@ class AccessoriesController extends Controller
if (e(Input::get('location_id')) == '') { if (e(Input::get('location_id')) == '') {
$accessory->location_id = null; $accessory->location_id = null;
} else { } else {
$accessory->location_id = e(Input::get('location_id')); $accessory->location_id = e(Input::get('location_id'));
} }
$accessory->min_amt = e(Input::get('min_amt')); $accessory->min_amt = e(Input::get('min_amt'));
$accessory->category_id = e(Input::get('category_id')); $accessory->category_id = e(Input::get('category_id'));
$accessory->company_id = Company::getIdForCurrentUser(Input::get('company_id')); $accessory->company_id = Company::getIdForCurrentUser(Input::get('company_id'));
$accessory->manufacturer_id = e(Input::get('manufacturer_id'));
$accessory->order_number = e(Input::get('order_number')); $accessory->order_number = e(Input::get('order_number'));
if (e(Input::get('purchase_date')) == '') { if (e(Input::get('purchase_date')) == '') {
@ -181,9 +178,9 @@ class AccessoriesController extends Controller
$accessory->qty = e(Input::get('qty')); $accessory->qty = e(Input::get('qty'));
// Was the accessory created? // Was the accessory updated?
if ($accessory->save()) { if ($accessory->save()) {
// Redirect to the new accessory page // Redirect to the updated accessory page
return redirect()->to("admin/accessories")->with('success', trans('admin/accessories/message.update.success')); return redirect()->to("admin/accessories")->with('success', trans('admin/accessories/message.update.success'));
} }
@ -620,7 +617,9 @@ class AccessoriesController extends Controller
'purchase_cost' => number_format($accessory->purchase_cost, 2), 'purchase_cost' => number_format($accessory->purchase_cost, 2),
'numRemaining' => $accessory->numRemaining(), 'numRemaining' => $accessory->numRemaining(),
'actions' => $actions, 'actions' => $actions,
'companyName' => is_null($company) ? '' : e($company->name) 'companyName' => is_null($company) ? '' : e($company->name),
'manufacturer' => $accessory->manufacturer ? (string) link_to('/admin/settings/manufacturers/'.$accessory->manufacturer_id.'/view', $accessory->manufacturer->name) : ''
); );
} }

View file

@ -467,16 +467,16 @@ class ConsumablesController extends Controller
$rows[] = array( $rows[] = array(
'id' => $consumable->id, 'id' => $consumable->id,
'name' => (string)link_to('admin/consumables/'.$consumable->id.'/view', e($consumable->name)), 'name' => (string)link_to('admin/consumables/'.$consumable->id.'/view', e($consumable->name)),
'location' => ($consumable->location) ? e($consumable->location->name) : '', 'location' => ($consumable->location) ? e($consumable->location->name) : '',
'min_amt' => e($consumable->min_amt), 'min_amt' => e($consumable->min_amt),
'qty' => e($consumable->qty), 'qty' => e($consumable->qty),
'manufacturer' => ($consumable->manufacturer) ? e($consumable->manufacturer->name) : '', 'manufacturer' => ($consumable->manufacturer) ? (string) link_to('/admin/settings/manufacturers/'.$consumable->manufacturer_id.'/view', $consumable->manufacturer->name): '',
'model_no' => e($consumable->model_no), 'model_no' => e($consumable->model_no),
'item_no' => e($consumable->item_no), 'item_no' => e($consumable->item_no),
'category' => ($consumable->category) ? e($consumable->category->name) : 'Missing category', 'category' => ($consumable->category) ? (string) link_to('/admin/settings/categories/'.$consumable->category_id.'/view', $consumable->category->name) : 'Missing category',
'order_number' => e($consumable->order_number), 'order_number' => e($consumable->order_number),
'purchase_date' => e($consumable->purchase_date), 'purchase_date' => e($consumable->purchase_date),
'purchase_cost' => ($consumable->purchase_cost!='') ? number_format($consumable->purchase_cost, 2): '' , 'purchase_cost' => ($consumable->purchase_cost!='') ? number_format($consumable->purchase_cost, 2): '' ,
'numRemaining' => $consumable->numRemaining(), 'numRemaining' => $consumable->numRemaining(),
'actions' => $actions, 'actions' => $actions,
'companyName' => is_null($company) ? '' : e($company->name), 'companyName' => is_null($company) ? '' : e($company->name),

View file

@ -61,18 +61,17 @@ class LicensesController extends Controller
public function getCreate() public function getCreate()
{ {
$depreciation_list = Helper::depreciationList();
$supplier_list = Helper::suppliersList();
$maintained_list = array('' => 'Maintained', '1' => 'Yes', '0' => 'No'); $maintained_list = array('' => 'Maintained', '1' => 'Yes', '0' => 'No');
$company_list = Helper::companyList();
return View::make('licenses/edit') return View::make('licenses/edit')
//->with('license_options',$license_options) //->with('license_options',$license_options)
->with('depreciation_list', $depreciation_list) ->with('depreciation_list', Helper::depreciationList())
->with('supplier_list', $supplier_list) ->with('supplier_list', Helper::suppliersList())
->with('maintained_list', $maintained_list) ->with('maintained_list', $maintained_list)
->with('company_list', $company_list) ->with('company_list', Helper::companyList())
->with('manufacturer_list', Helper::manufacturerList())
->with('license', new License); ->with('license', new License);
} }
@ -125,6 +124,12 @@ class LicensesController extends Controller
$license->purchase_order = e(Input::get('purchase_order')); $license->purchase_order = e(Input::get('purchase_order'));
} }
if (empty(e(Input::get('manufacturer_id')))) {
$license->manufacturer_id = null;
} else {
$license->manufacturer_id = e(Input::get('manufacturer_id'));
}
// Save the license data // Save the license data
$license->name = e(Input::get('name')); $license->name = e(Input::get('name'));
$license->serial = e(Input::get('serial')); $license->serial = e(Input::get('serial'));
@ -206,17 +211,15 @@ class LicensesController extends Controller
// Show the page // Show the page
$license_options = array('' => 'Top Level') + DB::table('assets')->where('id', '!=', $licenseId)->pluck('name', 'id'); $license_options = array('' => 'Top Level') + DB::table('assets')->where('id', '!=', $licenseId)->pluck('name', 'id');
$depreciation_list = array('0' => trans('admin/licenses/form.no_depreciation')) + Depreciation::pluck('name', 'id')->toArray();
$supplier_list = array('' => 'Select Supplier') + Supplier::orderBy('name', 'asc')->pluck('name', 'id')->toArray();
$maintained_list = array('' => 'Maintained', '1' => 'Yes', '0' => 'No'); $maintained_list = array('' => 'Maintained', '1' => 'Yes', '0' => 'No');
$company_list = Helper::companyList();
return View::make('licenses/edit', compact('license')) return View::make('licenses/edit', compact('license'))
->with('license_options', $license_options) ->with('license_options', $license_options)
->with('depreciation_list', $depreciation_list) ->with('depreciation_list', Helper::depreciationList())
->with('supplier_list', $supplier_list) ->with('supplier_list', Helper::suppliersList())
->with('company_list', $company_list) ->with('company_list', Helper::companyList())
->with('maintained_list', $maintained_list); ->with('maintained_list', $maintained_list)
->with('manufacturer_list', Helper::manufacturerList());
} }
@ -253,6 +256,13 @@ class LicensesController extends Controller
$license->maintained = e(Input::get('maintained')); $license->maintained = e(Input::get('maintained'));
$license->reassignable = e(Input::get('reassignable')); $license->reassignable = e(Input::get('reassignable'));
if (empty(e(Input::get('manufacturer_id')))) {
$license->manufacturer_id = null;
} else {
$license->manufacturer_id = e(Input::get('manufacturer_id'));
}
if (e(Input::get('supplier_id')) == '') { if (e(Input::get('supplier_id')) == '') {
$license->supplier_id = null; $license->supplier_id = null;
} else { } else {
@ -502,7 +512,7 @@ class LicensesController extends Controller
} }
if (($asset->assigned_to!='') && (($asset->assigned_to!=$assigned_to)) && ($assigned_to!='') ) { if (($asset->assigned_to!='') && (($asset->assigned_to!=$assigned_to)) && ($assigned_to!='')) {
return redirect()->to('admin/licenses')->with('error', trans('admin/licenses/message.owner_doesnt_match_asset')); return redirect()->to('admin/licenses')->with('error', trans('admin/licenses/message.owner_doesnt_match_asset'));
} }
@ -987,21 +997,22 @@ class LicensesController extends Controller
$actions = '<span style="white-space: nowrap;">'; $actions = '<span style="white-space: nowrap;">';
if (Gate::allows('licenses.checkout')) { if (Gate::allows('licenses.checkout')) {
$actions .= '<a href="' . route('freecheckout/license', $actions .= '<a href="' . route('freecheckout/license', $license->id)
$license->id) . '" class="btn btn-primary btn-sm' . (($license->remaincount() > 0) ? '' : ' disabled') . '" style="margin-right:5px;">' . trans('general.checkout') . '</a> '; . '" class="btn btn-primary btn-sm' . (($license->remaincount() > 0) ? '' : ' disabled') . '" style="margin-right:5px;">' . trans('general.checkout') . '</a> ';
} }
if (Gate::allows('licenses.create')) { if (Gate::allows('licenses.create')) {
$actions .= '<a href="' . route('clone/license', $actions .= '<a href="' . route('clone/license', $license->id)
$license->id) . '" class="btn btn-info btn-sm" style="margin-right:5px;" title="Clone asset"><i class="fa fa-files-o"></i></a>'; . '" class="btn btn-info btn-sm" style="margin-right:5px;" title="Clone asset"><i class="fa fa-files-o"></i></a>';
} }
if (Gate::allows('licenses.edit')) { if (Gate::allows('licenses.edit')) {
$actions .= '<a href="' . route('update/license', $actions .= '<a href="' . route('update/license', $license->id)
$license->id) . '" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a>'; . '" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a>';
} }
if (Gate::allows('licenses.delete')) { if (Gate::allows('licenses.delete')) {
$actions .= '<a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="' . route('delete/license', $actions .= '<a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'
$license->id) . '" data-content="' . trans('admin/licenses/message.delete.confirm') . '" data-title="' . trans('general.delete') . ' ' . htmlspecialchars($license->name) . '?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a>'; . route('delete/license', $license->id)
. '" data-content="' . trans('admin/licenses/message.delete.confirm') . '" data-title="' . trans('general.delete') . ' ' . htmlspecialchars($license->name) . '?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a>';
} }
$actions .='</span>'; $actions .='</span>';
@ -1012,15 +1023,16 @@ class LicensesController extends Controller
'totalSeats' => $license->totalSeatsByLicenseID(), 'totalSeats' => $license->totalSeatsByLicenseID(),
'remaining' => $license->remaincount(), 'remaining' => $license->remaincount(),
'license_name' => e($license->license_name), 'license_name' => e($license->license_name),
'license_email' => e($license->license_email), 'license_email' => e($license->license_email),
'purchase_date' => ($license->purchase_date) ? $license->purchase_date : '', 'purchase_date' => ($license->purchase_date) ? $license->purchase_date : '',
'expiration_date' => ($license->expiration_date) ? $license->expiration_date : '', 'expiration_date' => ($license->expiration_date) ? $license->expiration_date : '',
'purchase_cost' => ($license->purchase_cost) ? number_format($license->purchase_cost, 2) : '', 'purchase_cost' => ($license->purchase_cost) ? number_format($license->purchase_cost, 2) : '',
'purchase_order' => ($license->purchase_order) ? e($license->purchase_order) : '', 'purchase_order' => ($license->purchase_order) ? e($license->purchase_order) : '',
'order_number' => ($license->order_number) ? e($license->order_number) : '', 'order_number' => ($license->order_number) ? e($license->order_number) : '',
'notes' => ($license->notes) ? e($license->notes) : '', 'notes' => ($license->notes) ? e($license->notes) : '',
'actions' => $actions, 'actions' => $actions,
'companyName' => is_null($license->company) ? '' : e($license->company->name) 'companyName' => is_null($license->company) ? '' : e($license->company->name),
'manufacturer' => $license->manufacturer ? (string) link_to('/admin/settings/manufacturers/'.$license->manufacturer_id.'/view', $license->manufacturer->name) : ''
); );
} }

View file

@ -5,7 +5,7 @@ use App\Models\Company;
use App\Models\Manufacturer; use App\Models\Manufacturer;
use App\Models\Setting; use App\Models\Setting;
use Auth; use Auth;
use Illuminate\Support\Facades\Gate; use Gate;
use Input; use Input;
use Lang; use Lang;
use Redirect; use Redirect;
@ -255,10 +255,27 @@ class ManufacturersController extends Controller
* @since [v1.0] * @since [v1.0]
* @return String JSON * @return String JSON
*/ */
public function getDataView($manufacturerId) public function getDataView($manufacturerId, $itemtype = null)
{ {
$manufacturer = Manufacturer::with('assets.company')->find($manufacturerId); $manufacturer = Manufacturer::with('assets.company')->find($manufacturerId);
switch ($itemtype) {
case "assets":
return $this->getDataAssetsView($manufacturer);
case "licenses":
return $this->getDataLicensesView($manufacturer);
case "accessories":
return $this->getDataAccessoriesView($manufacturer);
case "consumables":
return $this->getDataConsumablesView($manufacturer);
}
throw new Exception("We shouldn't be here");
}
protected function getDataAssetsView(Manufacturer $manufacturer)
{
$manufacturer_assets = $manufacturer->assets; $manufacturer_assets = $manufacturer->assets;
if (Input::has('search')) { if (Input::has('search')) {
@ -304,25 +321,203 @@ class ManufacturersController extends Controller
} }
} }
$row = array( $rows[] = array(
'id' => $asset->id, 'id' => $asset->id,
'name' => (string)link_to('/hardware/'.$asset->id.'/view', e($asset->showAssetName())), 'name' => (string)link_to('/hardware/'.$asset->id.'/view', e($asset->showAssetName())),
'model' => e($asset->model->name), 'model' => e($asset->model->name),
'asset_tag' => e($asset->asset_tag), 'asset_tag' => e($asset->asset_tag),
'serial' => e($asset->serial), 'serial' => e($asset->serial),
'assigned_to' => ($asset->assigneduser) ? (string)link_to('/admin/users/'.$asset->assigneduser->id.'/view', e($asset->assigneduser->fullName())): '', 'assigned_to' => ($asset->assigneduser) ? (string)link_to('/admin/users/'.$asset->assigneduser->id.'/view', e($asset->assigneduser->fullName())): '',
'actions' => $actions, 'actions' => $actions,
'companyName' => e(Company::getName($asset)), 'companyName' => e(Company::getName($asset)),
); );
if (isset($inout)) { if (isset($inout)) {
$row['change'] = $inout; $row['change'] = $inout;
}
} }
$rows[] = $row;
}
$data = array('total' => $count, 'rows' => $rows); $data = array('total' => $count, 'rows' => $rows);
return $data; return $data;
} }
protected function getDataLicensesView(Manufacturer $manufacturer)
{
$licenses = $manufacturer->licenses;
if (Input::has('search')) {
$licenses = $licenses->TextSearch(Input::get('search'));
}
$licenseCount = $licenses->count();
$rows = array();
foreach ($licenses as $license) {
$actions = '<span style="white-space: nowrap;">';
if (Gate::allows('licenses.checkout')) {
$actions .= '<a href="' . route('freecheckout/license', $license->id)
. '" class="btn btn-primary btn-sm' . (($license->remaincount() > 0) ? '' : ' disabled') . '" style="margin-right:5px;">' . trans('general.checkout') . '</a> ';
}
if (Gate::allows('licenses.create')) {
$actions .= '<a href="' . route('clone/license', $license->id)
. '" class="btn btn-info btn-sm" style="margin-right:5px;" title="Clone asset"><i class="fa fa-files-o"></i></a>';
}
if (Gate::allows('licenses.edit')) {
$actions .= '<a href="' . route('update/license', $license->id)
. '" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a>';
}
if (Gate::allows('licenses.delete')) {
$actions .= '<a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'
. route('delete/license', $license->id)
. '" data-content="' . trans('admin/licenses/message.delete.confirm') . '" data-title="' . trans('general.delete') . ' ' . htmlspecialchars($license->name) . '?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a>';
}
$actions .='</span>';
$rows[] = array(
'id' => $license->id,
'name' => (string) link_to('/admin/licenses/'.$license->id.'/view', $license->name),
'serial' => (string) link_to('/admin/licenses/'.$license->id.'/view', mb_strimwidth($license->serial, 0, 50, "...")),
'totalSeats' => $license->totalSeatsByLicenseID(),
'remaining' => $license->remaincount(),
'license_name' => e($license->license_name),
'license_email' => e($license->license_email),
'purchase_date' => ($license->purchase_date) ? $license->purchase_date : '',
'expiration_date' => ($license->expiration_date) ? $license->expiration_date : '',
'purchase_cost' => ($license->purchase_cost) ? number_format($license->purchase_cost, 2) : '',
'purchase_order' => ($license->purchase_order) ? e($license->purchase_order) : '',
'order_number' => ($license->order_number) ? e($license->order_number) : '',
'notes' => ($license->notes) ? e($license->notes) : '',
'actions' => $actions,
'companyName' => is_null($license->company) ? '' : e($license->company->name),
'manufacturer' => $license->manufacturer ? (string) link_to('/admin/settings/manufacturers/'.$license->manufacturer_id.'/view', $license->manufacturer->name) : ''
);
}
$data = array('total' => $licenseCount, 'rows' => $rows);
return $data;
}
public function getDataAccessoriesView(Manufacturer $manufacturer)
{
$accessories = $manufacturer->accessories;
if (Input::has('search')) {
$accessories = $accessories->TextSearch(e(Input::get('search')));
}
if (Input::has('limit')) {
$limit = e(Input::get('limit'));
} else {
$limit = 50;
}
$accessCount = $accessories->count();
$rows = array();
foreach ($accessories as $accessory) {
$actions = '<nobr>';
if (Gate::allows('accessories.checkout')) {
$actions .= '<a href="' . route('checkout/accessory',
$accessory->id) . '" style="margin-right:5px;" class="btn btn-info btn-sm" ' . (($accessory->numRemaining() > 0) ? '' : ' disabled') . '>' . trans('general.checkout') . '</a>';
}
if (Gate::allows('accessories.edit')) {
$actions .= '<a href="' . route('update/accessory',
$accessory->id) . '" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a>';
}
if (Gate::allows('accessories.delete')) {
$actions .= '<a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="' . route('delete/accessory',
$accessory->id) . '" data-content="' . trans('admin/accessories/message.delete.confirm') . '" data-title="' . trans('general.delete') . ' ' . htmlspecialchars($accessory->name) . '?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a>';
}
$actions .= '</nobr>';
$company = $accessory->company;
$rows[] = array(
'name' => '<a href="'.url('admin/accessories/'.$accessory->id).'/view">'. $accessory->name.'</a>',
'category' => ($accessory->category) ? (string)link_to('admin/settings/categories/'.$accessory->category->id.'/view', $accessory->category->name) : '',
'qty' => e($accessory->qty),
'order_number' => e($accessory->order_number),
'min_amt' => e($accessory->min_amt),
'location' => ($accessory->location) ? e($accessory->location->name): '',
'purchase_date' => e($accessory->purchase_date),
'purchase_cost' => number_format($accessory->purchase_cost, 2),
'numRemaining' => $accessory->numRemaining(),
'actions' => $actions,
'companyName' => is_null($company) ? '' : e($company->name),
'manufacturer' => $accessory->manufacturer ? (string) link_to('/admin/settings/manufacturers/'.$accessory->manufacturer_id.'/view', $accessory->manufacturer->name) : ''
);
}
$data = array('total'=>$accessCount, 'rows'=>$rows);
return $data;
}
public function getDataConsumablesView($manufacturer)
{
$consumables = $manufacturer->consumables;
if (Input::has('search')) {
$consumables = $consumables->TextSearch(e(Input::get('search')));
}
if (Input::has('limit')) {
$limit = e(Input::get('limit'));
} else {
$limit = 50;
}
$consumCount = $consumables->count();
$rows = array();
foreach ($consumables as $consumable) {
$actions = '<nobr>';
if (Gate::allows('consumables.checkout')) {
$actions .= '<a href="' . route('checkout/consumable',
$consumable->id) . '" style="margin-right:5px;" class="btn btn-info btn-sm" ' . (($consumable->numRemaining() > 0) ? '' : ' disabled') . '>' . trans('general.checkout') . '</a>';
}
if (Gate::allows('consumables.edit')) {
$actions .= '<a href="' . route('update/consumable',
$consumable->id) . '" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a>';
}
if (Gate::allows('consumables.delete')) {
$actions .= '<a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="' . route('delete/consumable',
$consumable->id) . '" data-content="' . trans('admin/consumables/message.delete.confirm') . '" data-title="' . trans('general.delete') . ' ' . htmlspecialchars($consumable->name) . '?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a>';
}
$actions .='</nobr>';
$company = $consumable->company;
$rows[] = array(
'id' => $consumable->id,
'name' => (string)link_to('admin/consumables/'.$consumable->id.'/view', e($consumable->name)),
'location' => ($consumable->location) ? e($consumable->location->name) : '',
'min_amt' => e($consumable->min_amt),
'qty' => e($consumable->qty),
'manufacturer' => ($consumable->manufacturer) ? (string) link_to('/admin/settings/manufacturers/'.$consumable->manufacturer_id.'/view', $consumable->manufacturer->name): '',
'model_no' => e($consumable->model_no),
'item_no' => e($consumable->item_no),
'category' => ($consumable->category) ? (string) link_to('/admin/settings/categories/'.$consumable->category_id.'/view', $consumable->category->name) : 'Missing category',
'order_number' => e($consumable->order_number),
'purchase_date' => e($consumable->purchase_date),
'purchase_cost' => ($consumable->purchase_cost!='') ? number_format($consumable->purchase_cost, 2): '' ,
'numRemaining' => $consumable->numRemaining(),
'actions' => $actions,
'companyName' => is_null($company) ? '' : e($company->name),
);
}
$data = array('total' => $consumCount, 'rows' => $rows);
return $data;
}
} }

View file

@ -78,7 +78,7 @@ Route::group([ 'prefix' => 'api', 'middleware' => 'auth' ], function () {
/*---Manufacturers API---*/ /*---Manufacturers API---*/
Route::group(array('prefix'=>'manufacturers'), function () { Route::group(array('prefix'=>'manufacturers'), function () {
Route::get('list', array('as'=>'api.manufacturers.list', 'uses'=>'ManufacturersController@getDatatable')); Route::get('list', array('as'=>'api.manufacturers.list', 'uses'=>'ManufacturersController@getDatatable'));
Route::get('{manufacturerID}/view', array('as'=>'api.manufacturers.view', 'uses'=>'ManufacturersController@getDataView')); Route::get('{manufacturerID}/view/{itemtype}', array('as'=>'api.manufacturers.view', 'uses'=>'ManufacturersController@getDataView'));
}); });
/*---Suppliers API---*/ /*---Suppliers API---*/

View file

@ -82,6 +82,11 @@ class Accessory extends Model
return $this->belongsToMany('\App\Models\User', 'accessories_users', 'accessory_id', 'assigned_to')->count(); return $this->belongsToMany('\App\Models\User', 'accessories_users', 'accessory_id', 'assigned_to')->count();
} }
public function manufacturer()
{
return $this->belongsTo('\App\Models\Manufacturer', 'manufacturer_id');
}
public function checkin_email() public function checkin_email()
{ {
return $this->category->checkin_email; return $this->category->checkin_email;

View file

@ -36,6 +36,11 @@ class License extends Depreciable
return $this->belongsTo('\App\Models\Company', 'company_id'); return $this->belongsTo('\App\Models\Company', 'company_id');
} }
public function manufacturer()
{
return $this->belongsTo('\App\Models\Manufacturer', 'manufacturer_id');
}
/** /**
* Get the assigned user * Get the assigned user
*/ */

View file

@ -46,6 +46,21 @@ class Manufacturer extends Model
return $this->hasManyThrough('\App\Models\Asset', '\App\Models\AssetModel', 'manufacturer_id', 'model_id'); return $this->hasManyThrough('\App\Models\Asset', '\App\Models\AssetModel', 'manufacturer_id', 'model_id');
} }
public function licenses()
{
return $this->hasMany('\App\Models\License', 'manufacturer_id');
}
public function accessories()
{
return $this->hasMany('\App\Models\Accessory', 'manufacturer_id');
}
public function consumables()
{
return $this->hasMany('\App\Models\Consumable', 'manufacturer_id');
}
/** /**
* Query builder scope to search on text * Query builder scope to search on text
* *

View file

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddManufacturerToLicenses extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('licenses', function (Blueprint $table) {
//
$table->integer('manufacturer_id')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('licenses', function (Blueprint $table) {
//
});
}
}

View file

@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddManufacturerToAccessoriesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('accessories', function (Blueprint $table) {
//
$table->integer('manufacturer_id')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('accessories', function (Blueprint $table) {
//
$table->dropColumn('manufacturer_id');
});
}
}

View file

@ -86,6 +86,18 @@
</div> </div>
</div> </div>
<!-- Manufacturer -->
<div class="form-group {{ $errors->has('manufacturer_id') ? ' has-error' : '' }}">
<div class="col-md-3">
{{ Form::label('manufacturer_id', trans('general.manufacturer')) }}
</div>
</label>
<div class="col-md-7">
{{ Form::select('manufacturer_id', $manufacturer_list , Input::old('manufacturer_id', $accessory->manufacturer_id), array('class'=>'select2', 'style'=>'width:350px')) }}
{!! $errors->first('manufacturer_id', '<span class="alert-msg"><br><i class="fa fa-times"></i> :message</span>') !!}
</div>
</div>
<!-- Location --> <!-- Location -->
<div class="form-group{{ $errors->has('location_id') ? ' has-error' : '' }}"> <div class="form-group{{ $errors->has('location_id') ? ' has-error' : '' }}">
<div class="col-md-3"> <div class="col-md-3">

View file

@ -35,6 +35,7 @@
<th data-switchable="true" data-searchable="true" data-sortable="true" data-field="companyName" data-visible="false">{{ trans('admin/companies/table.title') }}</th> <th data-switchable="true" data-searchable="true" data-sortable="true" data-field="companyName" data-visible="false">{{ trans('admin/companies/table.title') }}</th>
<th data-sortable="true" data-searchable="true" data-field="name">{{ trans('admin/accessories/table.title') }}</th> <th data-sortable="true" data-searchable="true" data-field="name">{{ trans('admin/accessories/table.title') }}</th>
<th data-searchable="true" data-sortable="true" data-field="category">{{ trans('admin/accessories/general.accessory_category') }}</th> <th data-searchable="true" data-sortable="true" data-field="category">{{ trans('admin/accessories/general.accessory_category') }}</th>
<th data-field="manufacturer" data-searchable="true" data-sortable="true">{{ trans('general.manufacturer') }}</th>
<th data-searchable="true" data-sortable="true" data-field="location">{{ trans('general.location') }}</th> <th data-searchable="true" data-sortable="true" data-field="location">{{ trans('general.location') }}</th>
<th data-searchable="false" data-sortable="false" data-field="qty">{{ trans('admin/accessories/general.total') }}</th> <th data-searchable="false" data-sortable="false" data-field="qty">{{ trans('admin/accessories/general.total') }}</th>
<th data-searchable="true" data-sortable="true" data-field="purchase_date" data-visible="false">{{ trans('admin/accessories/general.date') }}</th> <th data-searchable="true" data-sortable="true" data-field="purchase_date" data-visible="false">{{ trans('admin/accessories/general.date') }}</th>

View file

@ -43,8 +43,6 @@
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<!-- Custom Tabs --> <!-- Custom Tabs -->
<div class="nav-tabs-custom"> <div class="nav-tabs-custom">
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
@ -54,13 +52,12 @@
<li> <li>
<a href="#software" data-toggle="tab"><span class="hidden-lg hidden-md"><i class="fa fa-floppy-o"></i></span> <span class="hidden-xs hidden-sm">Licenses</span></a> <a href="#software" data-toggle="tab"><span class="hidden-lg hidden-md"><i class="fa fa-floppy-o"></i></span> <span class="hidden-xs hidden-sm">Licenses</span></a>
</li> </li>
<li> <li>
<a href="#components" data-toggle="tab"><span class="hidden-lg hidden-md"><i class="fa fa-hdd-o"></i></span> <span class="hidden-xs hidden-sm">Components</span></a> <a href="#components" data-toggle="tab"><span class="hidden-lg hidden-md"><i class="fa fa-hdd-o"></i></span> <span class="hidden-xs hidden-sm">Components</span></a>
</li> </li>
<li> <li>
<a href="#maintenances" data-toggle="tab"><span class="hidden-lg hidden-md"><i class="fa fa-wrench"></i></span> <span class="hidden-xs hidden-sm">Maintenances</span></a> <a href="#maintenances" data-toggle="tab"><span class="hidden-lg hidden-md"><i class="fa fa-wrench"></i></span> <span class="hidden-xs hidden-sm">Maintenances</span></a>
</li> </li>
<li> <li>
<a href="#history" data-toggle="tab"><span class="hidden-lg hidden-md"><i class="fa fa-history"></i></span> <span class="hidden-xs hidden-sm">History</span></a> <a href="#history" data-toggle="tab"><span class="hidden-lg hidden-md"><i class="fa fa-history"></i></span> <span class="hidden-xs hidden-sm">History</span></a>
</li> </li>
@ -68,32 +65,33 @@
<a href="#files" data-toggle="tab"><span class="hidden-lg hidden-md"><i class="fa fa-files-o"></i></span> <span class="hidden-xs hidden-sm">Files</span></a> <a href="#files" data-toggle="tab"><span class="hidden-lg hidden-md"><i class="fa fa-files-o"></i></span> <span class="hidden-xs hidden-sm">Files</span></a>
</li> </li>
<li class="pull-right"> <li class="pull-right">
<a href="#" data-toggle="modal" data-target="#uploadFileModal"><i class="fa fa-paperclip"></i> </a></li> <a href="#" data-toggle="modal" data-target="#uploadFileModal"><i class="fa fa-paperclip"></i> </a>
</li>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
<div class="tab-pane fade in active" id="details"> <div class="tab-pane fade in active" id="details">
<div class="row"> <div class="row">
<div class="col-md-8"> <div class="col-md-8">
<div class="table-responsive" style="margin-top: 10px;"> <div class="table-responsive" style="margin-top: 10px;">
<table class="table"> <table class="table">
<tbody> <tbody>
@if ($asset->company) @if ($asset->company)
<tr> <tr>
<td>{{ trans('general.company') }}</td> <td>{{ trans('general.company') }}</td>
<td>{{ $asset->company->name }}</td> <td>{{ $asset->company->name }}</td>
</tr> </tr>
@endif @endif
@if ($asset->name) @if ($asset->name)
<tr> <tr>
<td>{{ trans('admin/hardware/form.name') }}</td> <td>{{ trans('admin/hardware/form.name') }}</td>
<td>{{ $asset->name }}</td> <td>{{ $asset->name }}</td>
</tr> </tr>
@endif @endif
@if ($asset->serial) @if ($asset->serial)
<tr> <tr>
<td>{{ trans('admin/hardware/form.serial') }}</td> <td>{{ trans('admin/hardware/form.serial') }}</td>
<td>{{ $asset->serial }}</td> <td>{{ $asset->serial }}</td>
</tr> </tr>
@endif @endif
@if ($asset->model->manufacturer) @if ($asset->model->manufacturer)
<tr> <tr>
@ -110,7 +108,7 @@
<a href="{{ route('view/model', $asset->model->id) }}"> <a href="{{ route('view/model', $asset->model->id) }}">
{{ $asset->model->name }} {{ $asset->model->name }}
</a> </a>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>{{ trans('admin/models/table.modelnumber') }}</td> <td>{{ trans('admin/models/table.modelnumber') }}</td>
@ -121,18 +119,16 @@
@endif @endif
@if ($asset->model->fieldset) @if ($asset->model->fieldset)
@foreach($asset->model->fieldset->fields as $field) @foreach($asset->model->fieldset->fields as $field)
<tr> <tr>
<td>{{ $field->name }}</td> <td>{{ $field->name }}</td>
<td> <td>
{{ $asset->{$field->db_column_name()} }} {{ $asset->{$field->db_column_name()} }}
</td> </td>
</tr> </tr>
@endforeach @endforeach
@endif @endif
@if ($asset->purchase_date) @if ($asset->purchase_date)
<tr> <tr>
<td>{{ trans('admin/hardware/form.date') }}</td> <td>{{ trans('admin/hardware/form.date') }}</td>
@ -143,7 +139,6 @@
@endif @endif
@if ($asset->purchase_cost) @if ($asset->purchase_cost)
<tr> <tr>
<td>{{ trans('admin/hardware/form.cost') }}</td> <td>{{ trans('admin/hardware/form.cost') }}</td>
<td> <td>
@ -154,17 +149,15 @@
@else @else
{{ \App\Models\Setting::first()->default_currency }} {{ \App\Models\Setting::first()->default_currency }}
@endif @endif
{{ number_format($asset->purchase_cost,2) }} {{ is_numeric($asset->purchase_cost) ? number_format($asset->purchase_cost,2) : $asset->purchase_cost }}
@if ($asset->order_number) @if ($asset->order_number)
(Order #{{ $asset->order_number }}) (Order #{{ $asset->order_number }})
@endif @endif
</td>
</td>
</tr> </tr>
@endif @endif
@if ($asset->supplier_id) @if ($asset->supplier_id)
<tr> <tr>
<td>{{ trans('admin/hardware/form.supplier') }}</td> <td>{{ trans('admin/hardware/form.supplier') }}</td>
@ -172,22 +165,21 @@
<a href="{{ route('view/supplier', $asset->supplier_id) }}"> <a href="{{ route('view/supplier', $asset->supplier_id) }}">
{{ $asset->supplier->name }} {{ $asset->supplier->name }}
</a> </a>
</td> </td>
</tr> </tr>
@endif @endif
@if ($asset->warranty_months) @if ($asset->warranty_months)
<tr {!! $asset->warrantee_expires() < date("Y-m-d") ? ' class="warning"' : '' !!}>
<td>{{ trans('admin/hardware/form.warranty') }}</td>
<td>
{{ $asset->warranty_months }}
{{ trans('admin/hardware/form.months') }}
<tr{!! $asset->warrantee_expires() < date("Y-m-d") ? ' class="warning"' : '' !!}> ({{ trans('admin/hardware/form.expires') }}
<td>{{ trans('admin/hardware/form.warranty') }}</td> {{ $asset->warrantee_expires() }})
<td> </td>
{{ $asset->warranty_months }} </tr>
{{ trans('admin/hardware/form.months') }}
({{ trans('admin/hardware/form.expires') }}
{{ $asset->warrantee_expires() }})
</td>
</tr>
@endif @endif
@if ($asset->depreciation) @if ($asset->depreciation)
@ -198,8 +190,9 @@
({{ $asset->depreciation->months }} ({{ $asset->depreciation->months }}
{{ trans('admin/hardware/form.months') }} {{ trans('admin/hardware/form.months') }}
) )
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
{{ trans('admin/hardware/form.fully_depreciated') }} {{ trans('admin/hardware/form.fully_depreciated') }}
@ -212,10 +205,10 @@
{{ $asset->time_until_depreciated()->m }} {{ $asset->time_until_depreciated()->m }}
{{ trans('admin/hardware/form.months') }} {{ trans('admin/hardware/form.months') }}
({{ $asset->depreciated_date()->format('Y-m-d') }}) ({{ $asset->depreciated_date()->format('Y-m-d') }})
</td> </td>
</tr> </tr>
@endif @endif
@if ($asset->model->eol) @if ($asset->model->eol)
<tr> <tr>
<td>{{ trans('admin/hardware/form.eol_rate') }}</td> <td>{{ trans('admin/hardware/form.eol_rate') }}</td>
@ -234,243 +227,252 @@
{{ $asset->months_until_eol()->m }} {{ $asset->months_until_eol()->m }}
{{ trans('general.months') }} {{ trans('general.months') }}
)
@endif @endif
)
</td> </td>
</tr> </tr>
@endif @endif
@if ($asset->expected_checkin!='') @if ($asset->expected_checkin!='')
<tr> <tr>
<td>{{ trans('admin/hardware/form.expected_checkin') }}</td> <td>{{ trans('admin/hardware/form.expected_checkin') }}</td>
<td> <td>
{{ $asset->expected_checkin }} {{ $asset->expected_checkin }}
</td> </td>
</tr> </tr>
@endif @endif
<tr> <tr>
<td>{{ trans('admin/hardware/form.notes') }}</td> <td>{{ trans('admin/hardware/form.notes') }}</td>
<td> {!! nl2br(e($asset->notes)) !!}</td> <td> {!! nl2br(e($asset->notes)) !!}</td>
</tr> </tr>
@if ($asset->created_at!='') @if ($asset->created_at!='')
<tr> <tr>
<td>{{ trans('general.created_at') }}</td> <td>{{ trans('general.created_at') }}</td>
<td> <td>
{{ $asset->created_at->format('F j, Y h:iA') }} {{ $asset->created_at->format('F j, Y h:iA') }}
</td> </td>
</tr> </tr>
@endif @endif
</tbody> </tbody>
</table> </table>
</div> <!-- /table-responsive --> </div> <!-- /table-responsive -->
</div><!-- /col --> </div><!-- /col -->
<div class="col-md-4"> <div class="col-md-4">
@if ($asset->image) @if ($asset->image)
<img src="{{ Config::get('app.url') }}/uploads/assets/{{{ $asset->image }}}" class="assetimg"> <img src="{{ Config::get('app.url') }}/uploads/assets/{{{ $asset->image }}}" class="assetimg">
@else @elseif ($asset->model->image!='')
@if ($asset->model->image!='') <img src="{{ Config::get('app.url') }}/uploads/models/{{{ $asset->model->image }}}" class="assetimg">
<img src="{{ Config::get('app.url') }}/uploads/models/{{{ $asset->model->image }}}" class="assetimg">
@endif
@endif @endif
@if (App\Models\Setting::getSettings()->qr_code=='1') @if (App\Models\Setting::getSettings()->qr_code=='1')
<img src="{{ config('get.url') }}/hardware/{{ $asset->id }}/qr_code" class="img-thumbnail pull-right" style="height: 100px; width: 100px; margin-right: 10px;"> <img src="{{ config('get.url') }}/hardware/{{ $asset->id }}/qr_code" class="img-thumbnail pull-right" style="height: 100px; width: 100px; margin-right: 10px;">
@endif @endif
@if (($asset->assigneduser) && ($asset->assigned_to > 0) && ($asset->deleted_at==''))
@if (($asset->assigneduser) && ($asset->assigned_to > 0) && ($asset->deleted_at==''))
<h4>{{ trans('admin/hardware/form.checkedout_to') }}</h4> <h4>{{ trans('admin/hardware/form.checkedout_to') }}</h4>
<p><img src="{{ $asset->assigneduser->gravatar() }}" class="user-image-inline" alt="{{ $asset->assigneduser->fullName() }}"> <p>
<a href="{{ route('view/user', $asset->assigned_to) }}">{{ $asset->assigneduser->fullName() }}</a></p> <img src="{{ $asset->assigneduser->gravatar() }}" class="user-image-inline" alt="{{ $asset->assigneduser->fullName() }}">
<a href="{{ route('view/user', $asset->assigned_to) }}">{{ $asset->assigneduser->fullName() }}</a>
</p>
<ul class="list-unstyled"> <ul class="list-unstyled">
@if ((isset($asset->assigneduser->email)) && ($asset->assigneduser->email!=''))
<li><i class="fa fa-envelope-o"></i> <a href="mailto:{{ $asset->assigneduser->email }}">{{ $asset->assigneduser->email }}</a></li>
@endif
@if ((isset($asset->assigneduser->email)) && ($asset->assigneduser->email!='')) @if ((isset($asset->assigneduser->phone)) && ($asset->assigneduser->phone!=''))
<li><i class="fa fa-envelope-o"></i> <a href="mailto:{{ $asset->assigneduser->email }}">{{ $asset->assigneduser->email }}</a></li> <li><i class="fa fa-phone"></i> {{ $asset->assigneduser->phone }}</li>
@endif
@if (isset($asset->userloc))
<li>{{ $asset->userloc->name }}</li>
<li>{{ $asset->userloc->address }}
@if ($asset->userloc->address2!='')
{{ $asset->userloc->address2 }}
@endif @endif
</li>
@if ((isset($asset->assigneduser->phone)) && ($asset->assigneduser->phone!='')) <li>{{ $asset->userloc->city }}
<li><i class="fa fa-phone"></i> {{ $asset->assigneduser->phone }}</li> @if (($asset->userloc->city!='') && ($asset->userloc->state!=''))
,
@endif @endif
{{ $asset->userloc->state }} {{ $asset->userloc->zip }}
</li>
@if (isset($asset->userloc)) @elseif (isset($asset->assetloc))
<li>{{ $asset->userloc->name }} <li>{{ $asset->assetloc->name }}</li>
<li>{{ $asset->userloc->address }} <li>{{ $asset->assetloc->address }}
@if ($asset->userloc->address2!='') @if ($asset->assetloc->address2!='')
{{ $asset->userloc->address2 }} {{ $asset->assetloc->address2 }}
@endif
</li>
<li>{{ $asset->userloc->city }}
@if (($asset->userloc->city!='') && ($asset->userloc->state!=''))
,
@endif
{{ $asset->userloc->state }} {{ $asset->userloc->zip }}</li>
@elseif (isset($asset->assetloc))
<li>{{ $asset->assetloc->name }}
<li>{{ $asset->assetloc->address }}
@if ($asset->assetloc->address2!='')
{{ $asset->assetloc->address2 }}
@endif
</li>
<li>{{ $asset->assetloc->city }}
@if (($asset->assetloc->city!='') && ($asset->assetloc->state!=''))
,
@endif
{{ $asset->assetloc->state }} {{ $asset->assetloc->zip }}</li>
@endif @endif
</ul> </li>
@endif <li>
</div> {{ $asset->assetloc->city }}
</div><!-- /row --> @if (($asset->assetloc->city!='') && ($asset->assetloc->state!=''))
</div><!-- /.tab-pane --> ,
@endif
{{ $asset->assetloc->state }} {{ $asset->assetloc->zip }}
</li>
<div class="tab-pane fade" id="components"> @endif
<!-- checked out assets table --> </ul>
<div class="row">
<div class="col-md-12"> @endif
<table class="table table-striped"> </div> <!-- div.col-md-4 -->
</div><!-- /row -->
</div><!-- /.tab-pane asset details -->
<tbody>
<?php $totalCost = 0; ?>
@foreach ($asset->components as $component)
@if (is_null($component->deleted_at))
<tr>
<td><a href="{{ route('view/component', $component->id) }}">{{ $component->name }}</a></td>
</tr>
@endif
@endforeach
</tbody>
<tfoot>
<tr>
<td colspan="7" class="text-right">{{ $use_currency.$totalCost }}</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
<div class="tab-pane fade" id="software"> <div class="tab-pane fade" id="software">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<!-- Licenses assets table --> <!-- Licenses assets table -->
@if (count($asset->licenses) > 0) @if (count($asset->licenses) > 0)
<table class="table"> <table class="table">
<thead>
<tr>
<th class="col-md-4">{{ trans('general.name') }}</th>
<th class="col-md-4"><span class="line"></span>{{ trans('admin/licenses/form.license_key') }}</th>
<th class="col-md-1"><span class="line"></span>{{ trans('table.actions') }}</th>
</tr>
</thead>
<tbody>
@foreach ($asset->licenseseats as $seat)
<tr>
<td><a href="{{ route('view/license', $seat->license->id) }}">{{ $seat->license->name }}</a></td>
<td>{{ $seat->license->serial }}</td>
<td><a href="{{ route('checkin/license', $seat->id) }}" class="btn-flat info btn-sm">{{ trans('general.checkin') }}</a>
</td>
</tr>
@endforeach
</tbody>
</table>
@else
<div class="col-md-12">
<div class="alert alert-info alert-block">
<i class="fa fa-info-circle"></i>
{{ trans('general.no_results') }}
</div>
</div>
@endif
</div><!-- /col -->
</div>
</div>
<div class="tab-pane fade" id="maintenances">
<div class="row">
<div class="col-md-12">
<h6>{{ trans('general.asset_maintenances') }}
[ <a href="{{ route('create/asset_maintenances', $asset->id) }}">{{ trans('button.add') }}</a> ]
</h6>
<!-- Asset Maintenance table -->
@if (count($asset->assetmaintenances) > 0)
<table class="table table-striped">
<thead> <thead>
<tr> <tr>
<th>{{ trans('admin/asset_maintenances/table.supplier_name') }}</th> <th class="col-md-4">{{ trans('general.name') }}</th>
<th>{{ trans('admin/asset_maintenances/form.title') }}</th> <th class="col-md-4"><span class="line"></span>{{ trans('admin/licenses/form.license_key') }}</th>
<th>{{ trans('admin/asset_maintenances/form.asset_maintenance_type') }}</th> <th class="col-md-1"><span class="line"></span>{{ trans('table.actions') }}</th>
<th>{{ trans('admin/asset_maintenances/form.start_date') }}</th> </tr>
<th>{{ trans('admin/asset_maintenances/form.completion_date') }}</th>
<th>{{ trans('admin/asset_maintenances/form.notes') }}</th>
<th>{{ trans('admin/asset_maintenances/table.is_warranty') }}</th>
<th>{{ trans('admin/asset_maintenances/form.cost') }}</th>
<th>{{ trans('general.admin') }}</th>
<th>{{ trans('table.actions') }}</th>
</tr>
</thead> </thead>
<tbody> <tbody>
<?php $totalCost = 0; ?> @foreach ($asset->licenseseats as $seat)
<tr>
@foreach ($asset->assetmaintenances as $assetMaintenance) <td><a href="{{ route('view/license', $seat->license->id) }}">{{ $seat->license->name }}</a></td>
@if (is_null($assetMaintenance->deleted_at)) <td>{{ $seat->license->serial }}</td>
<tr> <td>
<td><a href="{{ route('view/supplier', $assetMaintenance->supplier_id) }}">{{ $assetMaintenance->supplier->name }}</a></td> <a href="{{ route('checkin/license', $seat->id) }}" class="btn-flat info btn-sm">{{ trans('general.checkin') }}</a>
<td>{{ $assetMaintenance->title }}</td> </td>
<td>{{ $assetMaintenance->asset_maintenance_type }}</td> </tr>
<td>{{ $assetMaintenance->start_date }}</td> @endforeach
<td>{{ $assetMaintenance->completion_date }}</td>
<td>{{ $assetMaintenance->notes }}</td>
<td>{{ $assetMaintenance->is_warranty ? trans('admin/asset_maintenances/message.warranty') : trans('admin/asset_maintenances/message.not_warranty') }}</td>
<td class="text-right"><nobr>{{ $use_currency.$assetMaintenance->cost }}</nobr></td>
<td>
@if ($assetMaintenance->admin)
<a href="{{ config('app.url') }}/admin/users/{{ $assetMaintenance->admin->id }}/view">{{ $assetMaintenance->admin->fullName() }}</a>
@endif
</td>
<?php $totalCost += $assetMaintenance->cost; ?>
<td><a href="{{ route('update/asset_maintenance', $assetMaintenance->id) }}" class="btn btn-warning btn-sm"><i class="fa fa-pencil icon-white"></i></a>
</td>
</tr>
@endif
@endforeach
</tbody> </tbody>
<tfoot> </table>
<tr> @else
<td colspan="8" class="text-right">{{ $use_currency.number_format($totalCost, 2) }}</td>
</tr>
</tfoot>
</table>
@else
<div class="alert alert-info alert-block"> <div class="col-md-12">
<div class="alert alert-info alert-block">
<i class="fa fa-info-circle"></i>
{{ trans('general.no_results') }}
</div>
</div>
@endif
</div><!-- /col -->
</div> <!-- row -->
</div> <!-- /.tab-pane software -->
<div class="tab-pane fade" id="components">
<!-- checked out assets table -->
<div class="row">
<div class="col-md-12">
@if(count($asset->components) > 0)
<table class="table table-striped">
<tbody>
<?php $totalCost = 0; ?>
@foreach ($asset->components as $component)
@if (is_null($component->deleted_at))
<tr>
<td><a href="{{ route('view/component', $component->id) }}">{{ $component->name }}</a></td>
</tr>
@endif
@endforeach
</tbody>
<tfoot>
<tr>
<td colspan="7" class="text-right">{{ $use_currency.$totalCost }}</td>
</tr>
</tfoot>
</table>
@else
<div class="alert alert-info alert-block">
<i class="fa fa-info-circle"></i>
{{ trans('general.no_results') }}
</div>
@endif
</div>
</div>
</div> <!-- /.tab-pane components -->
<div class="tab-pane fade" id="maintenances">
<div class="row">
<div class="col-md-12">
<h6>{{ trans('general.asset_maintenances') }}
[ <a href="{{ route('create/asset_maintenances', $asset->id) }}">{{ trans('button.add') }}</a> ]
</h6>
<!-- Asset Maintenance table -->
@if (count($asset->assetmaintenances) > 0)
<table class="table table-striped">
<thead>
<tr>
<th>{{ trans('admin/asset_maintenances/table.supplier_name') }}</th>
<th>{{ trans('admin/asset_maintenances/form.title') }}</th>
<th>{{ trans('admin/asset_maintenances/form.asset_maintenance_type') }}</th>
<th>{{ trans('admin/asset_maintenances/form.start_date') }}</th>
<th>{{ trans('admin/asset_maintenances/form.completion_date') }}</th>
<th>{{ trans('admin/asset_maintenances/form.notes') }}</th>
<th>{{ trans('admin/asset_maintenances/table.is_warranty') }}</th>
<th>{{ trans('admin/asset_maintenances/form.cost') }}</th>
<th>{{ trans('general.admin') }}</th>
<th>{{ trans('table.actions') }}</th>
</tr>
</thead>
<tbody>
<?php $totalCost = 0; ?>
@foreach ($asset->assetmaintenances as $assetMaintenance)
@if (is_null($assetMaintenance->deleted_at))
<tr>
<td><a href="{{ route('view/supplier', $assetMaintenance->supplier_id) }}">{{ $assetMaintenance->supplier->name }}</a></td>
<td>{{ $assetMaintenance->title }}</td>
<td>{{ $assetMaintenance->asset_maintenance_type }}</td>
<td>{{ $assetMaintenance->start_date }}</td>
<td>{{ $assetMaintenance->completion_date }}</td>
<td>{{ $assetMaintenance->notes }}</td>
<td>{{ $assetMaintenance->is_warranty ? trans('admin/asset_maintenances/message.warranty') : trans('admin/asset_maintenances/message.not_warranty') }}</td>
<td class="text-right"><nobr>{{ $use_currency.$assetMaintenance->cost }}</nobr></td>
<td>
@if ($assetMaintenance->admin)
<a href="{{ config('app.url') }}/admin/users/{{ $assetMaintenance->admin->id }}/view">{{ $assetMaintenance->admin->fullName() }}</a>
@endif
</td>
<?php $totalCost += $assetMaintenance->cost; ?>
<td>
<a href="{{ route('update/asset_maintenance', $assetMaintenance->id) }}" class="btn btn-warning btn-sm"><i class="fa fa-pencil icon-white"></i></a>
</td>
</tr>
@endif
@endforeach
</tbody>
<tfoot>
<tr>
<td colspan="8" class="text-right">{{ is_numeric($totalCost) ? $use_currency.number_format($totalCost, 2) : $totalCost }}</td>
</tr>
</tfoot>
</table>
@else
<div class="alert alert-info alert-block">
<i class="fa fa-info-circle"></i> <i class="fa fa-info-circle"></i>
{{ trans('general.no_results') }} {{ trans('general.no_results') }}
</div> </div>
@endif @endif
</div> </div> <!-- /.col-md-12 -->
</div> </div> <!-- /.row -->
</div> </div> <!-- /.tab-pane maintenances -->
<div class="tab-pane fade" id="history"> <div class="tab-pane fade" id="history">
<!-- checked out assets table --> <!-- checked out assets table -->
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<table class="table table-hover table-fixed break-word"> <table class="table table-hover table-fixed break-word">
<thead> <thead>
<tr> <tr>
<th class="col-md-3">{{ trans('general.date') }}</th> <th class="col-md-3">{{ trans('general.date') }}</th>
<th class="col-md-2"><span class="line"></span>{{ trans('general.admin') }}</th> <th class="col-md-2"><span class="line"></span>{{ trans('general.admin') }}</th>
@ -478,157 +480,150 @@
<th class="col-md-2"><span class="line"></span>{{ trans('general.user') }}</th> <th class="col-md-2"><span class="line"></span>{{ trans('general.user') }}</th>
<th class="col-md-3"><span class="line"></span>{{ trans('general.notes') }}</th> <th class="col-md-3"><span class="line"></span>{{ trans('general.notes') }}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@if (count($asset->assetlog) > 0) @if (count($asset->assetlog) > 0)
@foreach ($asset->assetlog as $log) @foreach ($asset->assetlog as $log)
<tr>
<tr> <td>{{ $log->created_at }}</td>
<td>{{ $log->created_at }}</td> <td>
<td> @if (isset($log->adminlog))
@if (isset($log->adminlog)) {{ $log->adminlog->fullName() }}
{{ $log->adminlog->fullName() }} @else
@else Deleted Admin
Deleted Admin @endif
@endif </td>
</td> <td>{{ $log->action_type }}</td>
<td>{{ $log->action_type }}</td> <td>
<td>
@if ((isset($log->checkedout_to)) && ($log->checkedout_to!=0) && ($log->checkedout_to!='')) @if ((isset($log->checkedout_to)) && ($log->checkedout_to!=0) && ($log->checkedout_to!=''))
@if ($log->userlog) @if ($log->userlog)
@if ($log->userlog->deleted_at=='') @if ($log->userlog->deleted_at=='')
<a href="{{ route('view/user', $log->checkedout_to) }}"> <a href="{{ route('view/user', $log->checkedout_to) }}">
{{ $log->userlog->fullName() }} {{ $log->userlog->fullName() }}
</a> </a>
@else
<del>{{ $log->userlog->fullName() }}</del> @else
@endif <del>{{ $log->userlog->fullName() }}</del>
@else @endif
Deleted User @else
@endif Deleted User
@endif
@endif @endif
</td> </td>
<td> <td>
@if ($log->note) {{ $log->note }} @if ($log->note) {{ $log->note }}
@endif @endif
</td> </td>
</tr> </tr>
@endforeach @endforeach
@endif @endif
<!-- Add a "created asset" row to the log list. This isn't an official log entry.-->
<tr> <tr>
<td>{{ $asset->created_at }}</td> <td>{{ $asset->created_at }}</td>
<td> <td>
@if ($asset->adminuser) @if ($asset->adminuser)
{{ $asset->adminuser->fullName() }} {{ $asset->adminuser->fullName() }}
@else @else
{{ trans('general.unknown_admin') }} {{ trans('general.unknown_admin') }}
@endif @endif
</td>
</td> <td>{{ trans('general.created_asset') }}</td>
<td>{{ trans('general.created_asset') }}</td> <td></td> <!-- User -->
<td></td> <td></td> <!-- Notes -->
<td>
<!-- @if ($asset->notes)
{!! nl2br(e($asset->notes)) !!}
@endif -->
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div> <!-- /.row -->
</div> </div> <!-- /.tab-pane history -->
<div class="tab-pane fade" id="files"> <div class="tab-pane fade" id="files">
<div class="row"> <div class="row">
{{ Form::open([
'method' => 'POST',
'route' => ['upload/asset', $asset->id],
'files' => true, 'class' => 'form-horizontal' ]) }}
{{ Form::open([ <div class="col-md-2">
'method' => 'POST', <span class="btn btn-default btn-file">Browse for file...
'route' => ['upload/asset', $asset->id], {{ Form::file('assetfile[]', ['multiple' => 'multiple']) }}
'files' => true, 'class' => 'form-horizontal' ]) }} </span>
</div>
<div class="col-md-7">
{{ Form::text('notes', Input::old('notes', Input::old('notes')), array('class' => 'form-control','placeholder' => 'Notes')) }}
</div>
<div class="col-md-3">
<button type="submit" class="btn btn-primary">{{ trans('button.upload') }}</button>
</div>
<div class="col-md-2"> <div class="col-md-12">
<span class="btn btn-default btn-file">Browse for file... <p>{{ trans('admin/hardware/general.filetype_info') }}</p>
{{ Form::file('assetfile[]', ['multiple' => 'multiple']) }} <hr>
</span> </div>
</div>
<div class="col-md-7">
{{ Form::text('notes', Input::old('notes', Input::old('notes')), array('class' => 'form-control','placeholder' => 'Notes')) }}
</div>
<div class="col-md-3">
<button type="submit" class="btn btn-primary">{{ trans('button.upload') }}</button>
</div>
<div class="col-md-12"> {{ Form::close() }}
<p>{{ trans('admin/hardware/general.filetype_info') }}</p>
<hr>
</div>
{{ Form::close() }} <div class="col-md-12">
<div class="col-md-12"> <table class="table table-hover">
<table class="table table-hover">
<thead> <thead>
<tr> <tr>
<th class="col-md-4">{{ trans('general.notes') }}</th> <th class="col-md-4">{{ trans('general.notes') }}</th>
<th class="col-md-2"></th> <th class="col-md-2"></th>
<th class="col-md-4"><span class="line"></span>{{ trans('general.file_name') }}</th> <th class="col-md-4"><span class="line"></span>{{ trans('general.file_name') }}</th>
<th class="col-md-2"></th> <th class="col-md-2"></th>
<th class="col-md-2"></th> <th class="col-md-2"></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@if (count($asset->uploads) > 0) @if (count($asset->uploads) > 0)
@foreach ($asset->uploads as $file) @foreach ($asset->uploads as $file)
<tr> <tr>
<td> <td>
@if ($file->note) @if ($file->note)
{{ $file->note }} {{ $file->note }}
@endif @endif
</td> </td>
<td> <td>
@if ( \App\Helpers\Helper::checkUploadIsImage($file->get_src('assets'))) @if ( \App\Helpers\Helper::checkUploadIsImage($file->get_src('assets')))
<a href="../{{ $asset->id }}/showfile/{{ $file->id }}" data-toggle="lightbox" data-type="image"><img src="../{{ $asset->id }}/showfile/{{ $file->id }}"" class="img-thumbnail" style="max-width: 50px;"></a> <a href="../{{ $asset->id }}/showfile/{{ $file->id }}" data-toggle="lightbox" data-type="image"><img src="../{{ $asset->id }}/showfile/{{ $file->id }}"" class="img-thumbnail" style="max-width: 50px;"></a>
@endif @endif
</td> </td>
<td> <td>
{{ $file->filename }} {{ $file->filename }}
</td> </td>
<td> <td>
@if ($file->filename) @if ($file->filename)
<a href="{{ route('show/assetfile', [$asset->id, $file->id]) }}" class="btn btn-default">{{ trans('general.download') }}</a> <a href="{{ route('show/assetfile', [$asset->id, $file->id]) }}" class="btn btn-default">{{ trans('general.download') }}</a>
@endif @endif
</td> </td>
<td> <td>
<a class="btn delete-asset btn-danger btn-sm" href="{{ route('delete/assetfile', [$asset->id, $file->id]) }}"><i class="fa fa-trash icon-white"></i></a> <a class="btn delete-asset btn-danger btn-sm" href="{{ route('delete/assetfile', [$asset->id, $file->id]) }}"><i class="fa fa-trash icon-white"></i></a>
</td> </td>
</tr> </tr>
@endforeach @endforeach
@else @else
<tr> <tr>
<td colspan="4"> <td colspan="4">
{{ trans('general.no_results') }} {{ trans('general.no_results') }}
</td> </td>
</tr> </tr>
@endif @endif
</tbody> </tbody>
</table> </table>
</div> </div> <!-- /.col-md-12 -->
</div> </div> <!-- /.row -->
</div> </div> <!-- /.tab-pane files -->
</div> <!-- /. tab-content -->
</div><!-- nav-tabs-custom --> </div> <!-- /.nav-tabs-custom -->
</div> <!-- /. col-md-12 -->
</div> <!-- /. row -->
</div>
</div>
@section('moar_scripts') @section('moar_scripts')
<script> <script>

View file

@ -83,6 +83,15 @@
</div> </div>
@endif @endif
<!-- Manufacturer -->
<div class="form-group {{ $errors->has('manufacturer_id') ? ' has-error' : '' }}">
<label for="manufacturer_id" class="col-md-3 control-label">{{ trans('general.manufacturer') }}
</label>
<div class="col-md-7 required">
{{ Form::select('manufacturer_id', $manufacturer_list , Input::old('manufacturer_id', $license->manufacturer_id), array('class'=>'select2', 'style'=>'width:350px')) }}
{!! $errors->first('manufacturer_id', '<span class="alert-msg"><br><i class="fa fa-times"></i> :message</span>') !!}
</div>
</div>
<!-- Licensed to name --> <!-- Licensed to name -->
<div class="form-group {{ $errors->has('license_name') ? ' has-error' : '' }}"> <div class="form-group {{ $errors->has('license_name') ? ' has-error' : '' }}">

View file

@ -37,6 +37,7 @@
<th data-sortable="true" data-field="id" data-visible="false">{{ trans('general.id') }}</th> <th data-sortable="true" data-field="id" data-visible="false">{{ trans('general.id') }}</th>
<th data-field="companyName" data-sortable="false" data-switchable="true">{{ trans('general.company') }}</th> <th data-field="companyName" data-sortable="false" data-switchable="true">{{ trans('general.company') }}</th>
<th data-field="name" data-sortable="true">{{ trans('admin/licenses/table.title') }}</th> <th data-field="name" data-sortable="true">{{ trans('admin/licenses/table.title') }}</th>
<th data-field="manufacturer" data-sortable="true">{{ trans('general.manufacturer') }}</th>
<th data-field="serial" data-sortable="true" >{{ trans('admin/licenses/table.serial') }}</th> <th data-field="serial" data-sortable="true" >{{ trans('admin/licenses/table.serial') }}</th>
<th data-field="license_name" data-sortable="true" data-visible="false">{{ trans('admin/licenses/form.to_name') }}</th> <th data-field="license_name" data-sortable="true" data-visible="false">{{ trans('admin/licenses/form.to_name') }}</th>
<th data-field="license_email" data-sortable="true" data-visible="false">{{ trans('admin/licenses/form.to_email') }}</th> <th data-field="license_email" data-sortable="true" data-visible="false">{{ trans('admin/licenses/form.to_email') }}</th>

View file

@ -136,6 +136,13 @@
</tr> </tr>
@endif @endif
@if (!is_null($license->manufacturer))
<tr>
<td>{{ trans('general.manufacturer') }}</td>
<td>{{ $license->manufacturer->name }}</td>
</tr>
@endif
@can('licenses.keys') @can('licenses.keys')
@if (!is_null($license->serial)) @if (!is_null($license->serial))
<tr> <tr>

View file

@ -25,37 +25,146 @@
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div class="box box-default">
<div class="box-body">
<table <div class="nav-tabs-custom">
name="category_assets" <ul class="nav nav-tabs">
class="table table-striped" <li class="active">
id="table" <a href="#assets" data-toggle="tab">Assets</a>
data-url="{{ route('api.manufacturers.view', $manufacturer->id) }}" </li>
data-cookie="true" <li>
data-click-to-select="true" <a href="#licenses" data-toggle="tab">Licenses</a>
data-cookie-id-table="maufacturerAssetsTableOIUOIUI"> </li>
<li>
<a href="#accessories" data-toggle="tab">Accessories</a>
</li>
<li>
<a href="#consumables" data-toggle="tab">Consumables</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane fade in active" id="assets">
<table
name="manufacturer_assets"
class="table table-striped bootstrap-table"
id="assets-table"
data-url="{{ route('api.manufacturers.view', ['manufacturerId' => $manufacturer->id, 'itemtype' => 'assets']) }}"
data-cookie="true"
data-click-to-select="true"
data-cookie-id-table="maufacturerAssetsTable-{{config('version.hash_version') }}"
>
<thead> <thead>
<tr> <tr>
<th data-searchable="false" data-sortable="false" data-field="companyName" data-visible="false"> <th data-searchable="false" data-sortable="false" data-field="companyName" data-visible="false">
{{ trans('admin/companies/table.title') }} {{ trans('admin/companies/table.title') }}
</th> </th>
<th data-searchable="false" data-sortable="false" data-field="id" data-visible="false">{{ trans('general.id') }}</th> <th data-searchable="false" data-sortable="false" data-field="id" data-visible="false">{{ trans('general.id') }}</th>
<th data-searchable="false" data-sortable="false" data-field="name">{{ trans('general.name') }}</th> <th data-searchable="false" data-sortable="false" data-field="name">{{ trans('general.name') }}</th>
<th data-searchable="false" data-sortable="false" data-field="model">{{ trans('admin/hardware/form.model') }}</th> <th data-searchable="false" data-sortable="false" data-field="model">{{ trans('admin/hardware/form.model') }}</th>
<th data-searchable="false" data-sortable="false" data-field="asset_tag">{{ trans('general.asset_tag') }}</th> <th data-searchable="false" data-sortable="false" data-field="asset_tag">{{ trans('general.asset_tag') }}</th>
<th data-searchable="false" data-sortable="false" data-field="serial">{{ trans('admin/hardware/form.serial') }}</th> <th data-searchable="false" data-sortable="false" data-field="serial">{{ trans('admin/hardware/form.serial') }}</th>
<th data-searchable="false" data-sortable="false" data-field="assigned_to">{{ trans('general.user') }}</th> <th data-searchable="false" data-sortable="false" data-field="assigned_to">{{ trans('general.user') }}</th>
<th data-searchable="false" data-sortable="false" data-field="change" data-switchable="false">{{ trans('admin/hardware/table.change') }}</th> <th data-searchable="false" data-sortable="false" data-field="change" data-switchable="false">{{ trans('admin/hardware/table.change') }}</th>
<th data-searchable="false" data-sortable="false" data-field="actions" data-switchable="false">{{ trans('table.actions') }}</th> <th data-searchable="false" data-sortable="false" data-field="actions" data-switchable="false">{{ trans('table.actions') }}</th>
</tr> </tr>
</thead> </thead>
</table> </table>
</div> </div> <!-- /.tab-pane assets -->
</div>
</div> <div class="tab-pane fade" id="licenses">
</div> <table
name="manufacturer_licenses"
class="table table-striped bootstrap-table"
id="licenses-table"
data-url="{{ route('api.manufacturers.view', ['manufacturerId' => $manufacturer->id, 'itemtype' => 'licenses']) }}"
data-cookie="true"
data-click-to-select="true"
data-cookie-id-table="maufacturerLicensesTable-{{config('version.hash_version') }}"
>
<thead>
<tr>
<th data-sortable="true" data-field="id" data-visible="false">{{ trans('general.id') }}</th>
<th data-field="companyName" data-sortable="false" data-switchable="true">{{ trans('general.company') }}</th>
<th data-field="name" data-sortable="true">{{ trans('admin/licenses/table.title') }}</th>
<th data-field="manufacturer" data-sortable="true">{{ trans('general.manufacturer') }}</th>
<th data-field="serial" data-sortable="true" >{{ trans('admin/licenses/table.serial') }}</th>
<th data-field="license_name" data-sortable="true" data-visible="false">{{ trans('admin/licenses/form.to_name') }}</th>
<th data-field="license_email" data-sortable="true" data-visible="false">{{ trans('admin/licenses/form.to_email') }}</th>
<th data-field="totalSeats" data-sortable="false">{{ trans('admin/licenses/form.seats') }}</th>
<th data-field="remaining" data-sortable="false">{{ trans('admin/licenses/form.remaining_seats') }}</th>
<th data-field="purchase_date" data-sortable="true">{{ trans('admin/licenses/table.purchase_date') }}</th>
<th data-field="purchase_cost" data-sortable="true">{{ trans('admin/licenses/form.cost') }}</th>
<th data-field="purchase_order" data-sortable="true" data-visible="false">{{ trans('admin/licenses/form.purchase_order') }}</th>
<th data-field="expiration_date" data-sortable="true" data-visible="false">{{ trans('admin/licenses/form.expiration') }}</th>
<th data-field="notes" data-sortable="true" data-visible="false">{{ trans('admin/licenses/form.notes') }}</th>
<th data-field="actions">{{ trans('table.actions') }}</th>
</tr>
</thead>
</table>
</div>
<div class="tab-pane fade" id="accessories">
<table
name="manufacturer_licenses"
class="table table-striped bootstrap-table"
id="licenses-table"
data-url="{{ route('api.manufacturers.view', ['manufacturerId' => $manufacturer->id, 'itemtype' => 'accessories']) }}"
data-cookie="true"
data-click-to-select="true"
data-cookie-id-table="maufacturerLicensesTable-{{config('version.hash_version') }}"
>
<thead>
<tr>
<th data-switchable="true" data-searchable="true" data-sortable="true" data-field="companyName" data-visible="false">{{ trans('admin/companies/table.title') }}</th>
<th data-sortable="true" data-searchable="true" data-field="name">{{ trans('admin/accessories/table.title') }}</th>
<th data-searchable="true" data-sortable="true" data-field="category">{{ trans('admin/accessories/general.accessory_category') }}</th>
<th data-field="manufacturer" data-searchable="true" data-sortable="true">{{ trans('general.manufacturer') }}</th>
<th data-searchable="true" data-sortable="true" data-field="location">{{ trans('general.location') }}</th>
<th data-searchable="false" data-sortable="false" data-field="qty">{{ trans('admin/accessories/general.total') }}</th>
<th data-searchable="true" data-sortable="true" data-field="purchase_date" data-visible="false">{{ trans('admin/accessories/general.date') }}</th>
<th data-searchable="true" data-sortable="true" data-field="purchase_cost">{{ trans('admin/accessories/general.cost') }}</th>
<th data-searchable="true" data-sortable="true" data-field="order_number" data-visible="false">{{ trans('admin/accessories/general.order') }}</th>
<th data-searchable="false" data-sortable="true" data-field="min_amt">{{ trans('general.min_amt') }}</th>
<th data-searchable="false" data-sortable="false" data-field="numRemaining">{{ trans('admin/accessories/general.remaining') }}</th>
<th data-switchable="false" data-searchable="false" data-sortable="false" data-field="actions">{{ trans('table.actions') }}</th>
</tr>
</thead>
</table>
</div>
<div class="tab-pane fade" id="consumables">
<table
name="manufacturer_licenses"
class="table table-striped bootstrap-table"
id="licenses-table"
data-url="{{ route('api.manufacturers.view', ['manufacturerId' => $manufacturer->id, 'itemtype' => 'consumables']) }}"
data-cookie="true"
data-click-to-select="true"
data-cookie-id-table="maufacturerLicensesTable-{{config('version.hash_version') }}"
>
<thead>
<tr>
<th data-sortable="true" data-field="id" data-visible="false">{{ trans('general.id') }}</th>
<th data-switchable="true" data-searchable="true" data-sortable="true" data-field="companyName">{{ trans('admin/companies/table.title') }}</th>
<th data-sortable="true" data-searchable="true" data-field="name">{{ trans('admin/consumables/table.title') }}</th>
<th data-searchable="true" data-sortable="true" data-field="location">{{ trans('general.location') }}</th>
<th data-searchable="true" data-sortable="true" data-field="category">{{ trans('general.category') }}</th>
<th data-switchable="false" data-searchable="false" data-sortable="false" data-field="qty"> {{ trans('admin/consumables/general.total') }}</th>
<th data-switchable="false" data-searchable="false" data-sortable="false" data-field="numRemaining"> {{ trans('admin/consumables/general.remaining') }}</th>
<th data-switchable="false" data-searchable="false" data-sortable="true" data-field="min_amt"> {{ trans('general.min_amt') }}</th>
<th data-sortable="true" data-field="manufacturer" data-visible="false">{{ trans('general.manufacturer') }}</th>
<th data-sortable="true" data-field="model_no" data-visible="false">{{ trans('general.model_no') }}</th>
<th data-sortable="true" data-field="item_no" data-visible="false">{{ trans('admin/consumables/general.item_no') }}</th>
<th data-sortable="true" data-searchable="true" data-field="order_number" data-visible="false">{{ trans('admin/consumables/general.order') }}</th>
<th data-sortable="true" data-searchable="true" data-field="purchase_date" data-visible="false">{{ trans('admin/consumables/general.date') }}</th>
<th data-sortable="true" data-searchable="true" data-field="purchase_cost" data-visible="false">{{ trans('admin/consumables/general.cost') }}</th>
<th data-switchable="false" data-searchable="false" data-sortable="false" data-field="actions"> {{ trans('table.actions') }}</th>
</tr>
</thead>
</table>
</div>
</div> <!-- /.tab-content -->
</div> <!-- /.nav-tabs-custom -->
</div><!-- /. col-md-12 -->
</div> <!-- /.row -->
@section('moar_scripts') @section('moar_scripts')
@ -66,7 +175,7 @@
<script src="{{ asset('assets/js/extensions/export/tableExport.js') }}"></script> <script src="{{ asset('assets/js/extensions/export/tableExport.js') }}"></script>
<script src="{{ asset('assets/js/extensions/export/jquery.base64.js') }}"></script> <script src="{{ asset('assets/js/extensions/export/jquery.base64.js') }}"></script>
<script type="text/javascript"> <script type="text/javascript">
$('#table').bootstrapTable({ $('.bootstrap-table').bootstrapTable({
classes: 'table table-responsive table-no-bordered', classes: 'table table-responsive table-no-bordered',
undefinedText: '', undefinedText: '',
iconsPrefix: 'fa', iconsPrefix: 'fa',

View file

@ -41,7 +41,6 @@
<!-- Model name --> <!-- Model name -->
<div class="form-group {{ $errors->has('name') ? ' has-error' : '' }}"> <div class="form-group {{ $errors->has('name') ? ' has-error' : '' }}">
<label for="name" class="col-md-3 control-label">{{ trans('admin/models/table.name') }}</label> <label for="name" class="col-md-3 control-label">{{ trans('admin/models/table.name') }}</label>
</label>
<div class="col-md-7 required"> <div class="col-md-7 required">
<input class="form-control" type="text" name="name" id="name" value="{{ Input::old('name', $model->name) }}" /> <input class="form-control" type="text" name="name" id="name" value="{{ Input::old('name', $model->name) }}" />
{!! $errors->first('name', '<span class="alert-msg"><i class="fa fa-times"></i> :message</span>') !!} {!! $errors->first('name', '<span class="alert-msg"><i class="fa fa-times"></i> :message</span>') !!}
@ -49,20 +48,16 @@
</div> </div>
<div class="form-group {{ $errors->has('manufacturer_id') ? ' has-error' : '' }}"> <div class="form-group {{ $errors->has('manufacturer_id') ? ' has-error' : '' }}">
<label for="manufacturer_id" class="col-md-3 control-label">{{ trans('general.manufacturer') }} <label for="manufacturer_id" class="col-md-3 control-label">{{ trans('general.manufacturer') }}</label>
</label>
</label>
<div class="col-md-7 required"> <div class="col-md-7 required">
{{ Form::select('manufacturer_id', $manufacturer_list , Input::old('manufacturer_id', $model->manufacturer_id), array('class'=>'select2', 'style'=>'width:350px')) }} {{ Form::select('manufacturer_id', $manufacturer_list , Input::old('manufacturer_id', $model->manufacturer_id), array('class'=>'select2', 'style'=>'width:350px')) }}
{!! $errors->first('manufacturer_id', '<span class="alert-msg"><br><i class="fa fa-times"></i> :message</span>') !!} {!! $errors->first('manufacturer_id', '<span class="alert-msg"><br><i class="fa fa-times"></i> :message</span>') !!}
</div> </div>
</div> </div>
<!-- Category --> <!-- Category -->
<div class="form-group {{ $errors->has('category_id') ? ' has-error' : '' }}"> <div class="form-group {{ $errors->has('category_id') ? ' has-error' : '' }}">
<label for="category_id" class="col-md-3 control-label">{{ trans('general.category') }} <label for="category_id" class="col-md-3 control-label">{{ trans('general.category') }}</label>
</label>
</label>
<div class="col-md-7 required"> <div class="col-md-7 required">
{{ Form::select('category_id', $category_list , Input::old('category_id', $model->category_id), array('class'=>'select2', 'style'=>'width:350px')) }} {{ Form::select('category_id', $category_list , Input::old('category_id', $model->category_id), array('class'=>'select2', 'style'=>'width:350px')) }}
{!! $errors->first('category_id', '<span class="alert-msg"><br><i class="fa fa-times"></i> :message</span>') !!} {!! $errors->first('category_id', '<span class="alert-msg"><br><i class="fa fa-times"></i> :message</span>') !!}
@ -94,9 +89,9 @@
<label for="eol" class="col-md-3 control-label">{{ trans('general.eol') }}</label> <label for="eol" class="col-md-3 control-label">{{ trans('general.eol') }}</label>
<div class="col-md-3"> <div class="col-md-3">
<div class="input-group"> <div class="input-group">
<input class="col-md-1 form-control" type="text" name="eol" id="eol" value="{{ Input::old('eol', isset($model->eol)) ? $model->eol : 0 }}" /> <span class="input-group-addon"> <input class="col-md-1 form-control" type="text" name="eol" id="eol" value="{{ Input::old('eol', isset($model->eol)) ? $model->eol : 0 }}" />
{{ trans('general.months') }} <span class="input-group-addon">
{{ trans('general.months') }}
</span> </span>
{!! $errors->first('eol', '<span class="alert-msg"><br><i class="fa fa-times"></i> :message</span>') !!} {!! $errors->first('eol', '<span class="alert-msg"><br><i class="fa fa-times"></i> :message</span>') !!}
</div> </div>
@ -109,7 +104,6 @@
<div class="col-md-7"> <div class="col-md-7">
{{ Form::select('custom_fieldset', \App\Helpers\Helper::customFieldsetList(),Input::old('custom_fieldset', $model->fieldset_id), array('class'=>'select2', 'style'=>'width:350px')) }} {{ Form::select('custom_fieldset', \App\Helpers\Helper::customFieldsetList(),Input::old('custom_fieldset', $model->fieldset_id), array('class'=>'select2', 'style'=>'width:350px')) }}
{!! $errors->first('custom_fieldset', '<span class="alert-msg"><br><i class="fa fa-times"></i> :message</span>') !!} {!! $errors->first('custom_fieldset', '<span class="alert-msg"><br><i class="fa fa-times"></i> :message</span>') !!}
</label>
</div> </div>
</div> </div>
@ -152,7 +146,4 @@
</div> </div>
</div> </div>
</form>
</div>
@stop @stop