A free open source IT asset/license management system
Add manufacturer to licenses (#2436)
Daniel Meltzerac6364222478
diff --git a/app/Http/Controllers/AccessoriesController.php b/app/Http/Controllers/AccessoriesController.phpindex 6c079345d9..d5e8dd7e79 100755--- a/app/Http/Controllers/AccessoriesController.php+++ b/app/Http/Controllers/AccessoriesController.php@@ -53,14 +53,12 @@ class AccessoriesController extends Controllerpublic function getCreate(Request $request){// Show the page- $category_list = Helper::categoryList('accessory');- $company_list = Helper::companyList();- $location_list = Helper::locationsList();return View::make('accessories/edit')->with('accessory', new Accessory)- ->with('category_list', $category_list)- ->with('company_list', $company_list)- ->with('location_list', $location_list);+ ->with('category_list', Helper::categoryList('accessory'))+ ->with('company_list', Helper::companyList())+ ->with('location_list', Helper::locationsList())+ ->with('manufacturer_list', Helper::manufacturerList());}@@ -77,12 +75,13 @@ class AccessoriesController extends Controller$accessory = new Accessory();// Update the accessory data- $accessory->name = e(Input::get('name'));- $accessory->category_id = e(Input::get('category_id'));- $accessory->location_id = e(Input::get('location_id'));- $accessory->min_amt = e(Input::get('min_amt'));+ $accessory->name = e(Input::get('name'));+ $accessory->category_id = e(Input::get('category_id'));+ $accessory->location_id = e(Input::get('location_id'));+ $accessory->min_amt = e(Input::get('min_amt'));$accessory->company_id = Company::getIdForCurrentUser(Input::get('company_id'));$accessory->order_number = e(Input::get('order_number'));+ $accessory->manufacturer_id = e(Input::get('manufacturer_id'));if (e(Input::get('purchase_date')) == '') {$accessory->purchase_date = null;@@ -96,8 +95,8 @@ class AccessoriesController extends Controller$accessory->purchase_cost = e(Input::get('purchase_cost'));}- $accessory->qty = e(Input::get('qty'));- $accessory->user_id = Auth::user()->id;+ $accessory->qty = e(Input::get('qty'));+ $accessory->user_id = Auth::user()->id;// Was the accessory created?if ($accessory->save()) {@@ -126,14 +125,11 @@ class AccessoriesController extends Controllerreturn 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'))- ->with('category_list', $category_list)- ->with('company_list', $company_list)- ->with('location_list', $location_list);+ ->with('category_list', Helper::categoryList('accessory'))+ ->with('company_list', Helper::companyList())+ ->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){- // Check if the blog post exists+ // Check if the accessory existsif (is_null($accessory = Accessory::find($accessoryId))) {- // Redirect to the blogs management page+ // Redirect to the accessory index pagereturn redirect()->to('admin/accessories')->with('error', trans('admin/accessories/message.does_not_exist'));} elseif (!Company::isCurrentUserHasAccess($accessory)) {return redirect()->to('admin/accessories')->with('error', trans('general.insufficient_permissions'));@@ -160,11 +156,12 @@ class AccessoriesController extends Controllerif (e(Input::get('location_id')) == '') {$accessory->location_id = null;} 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->company_id = Company::getIdForCurrentUser(Input::get('company_id'));+ $accessory->manufacturer_id = e(Input::get('manufacturer_id'));$accessory->order_number = e(Input::get('order_number'));if (e(Input::get('purchase_date')) == '') {@@ -181,9 +178,9 @@ class AccessoriesController extends Controller$accessory->qty = e(Input::get('qty'));- // Was the accessory created?+ // Was the accessory updated?if ($accessory->save()) {- // Redirect to the new accessory page+ // Redirect to the updated accessory pagereturn 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),'numRemaining' => $accessory->numRemaining(),'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) : ''+);}diff --git a/app/Http/Controllers/ConsumablesController.php b/app/Http/Controllers/ConsumablesController.phpindex 11f6a7812d..1c9609d196 100644--- a/app/Http/Controllers/ConsumablesController.php+++ b/app/Http/Controllers/ConsumablesController.php@@ -467,16 +467,16 @@ class ConsumablesController extends Controller$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),+ 'location' => ($consumable->location) ? e($consumable->location->name) : '',+ 'min_amt' => e($consumable->min_amt),'qty' => e($consumable->qty),- 'manufacturer' => ($consumable->manufacturer) ? e($consumable->manufacturer->name) : '',- 'model_no' => e($consumable->model_no),- 'item_no' => e($consumable->item_no),- 'category' => ($consumable->category) ? e($consumable->category->name) : 'Missing category',+ '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): '' ,+ '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),diff --git a/app/Http/Controllers/LicensesController.php b/app/Http/Controllers/LicensesController.phpindex bfd46a190d..671ac1e91f 100755--- a/app/Http/Controllers/LicensesController.php+++ b/app/Http/Controllers/LicensesController.php@@ -61,18 +61,17 @@ class LicensesController extends Controllerpublic function getCreate(){- $depreciation_list = Helper::depreciationList();- $supplier_list = Helper::suppliersList();$maintained_list = array('' => 'Maintained', '1' => 'Yes', '0' => 'No');- $company_list = Helper::companyList();return View::make('licenses/edit')//->with('license_options',$license_options)- ->with('depreciation_list', $depreciation_list)- ->with('supplier_list', $supplier_list)+ ->with('depreciation_list', Helper::depreciationList())+ ->with('supplier_list', Helper::suppliersList())->with('maintained_list', $maintained_list)- ->with('company_list', $company_list)+ ->with('company_list', Helper::companyList())+ ->with('manufacturer_list', Helper::manufacturerList())->with('license', new License);+}@@ -125,6 +124,12 @@ class LicensesController extends Controller$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$license->name = e(Input::get('name'));$license->serial = e(Input::get('serial'));@@ -206,17 +211,15 @@ class LicensesController extends Controller// Show the page$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');- $company_list = Helper::companyList();return View::make('licenses/edit', compact('license'))->with('license_options', $license_options)- ->with('depreciation_list', $depreciation_list)- ->with('supplier_list', $supplier_list)- ->with('company_list', $company_list)- ->with('maintained_list', $maintained_list);+ ->with('depreciation_list', Helper::depreciationList())+ ->with('supplier_list', Helper::suppliersList())+ ->with('company_list', Helper::companyList())+ ->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->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')) == '') {$license->supplier_id = null;} 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'));}@@ -987,21 +997,22 @@ class LicensesController extends Controller$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> ';+ $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>';+ $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>';+ $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 .= '<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>';@@ -1012,15 +1023,16 @@ class LicensesController extends Controller'totalSeats' => $license->totalSeatsByLicenseID(),'remaining' => $license->remaincount(),'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 : '',- '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_order' => ($license->purchase_order) ? e($license->purchase_order) : '',- 'order_number' => ($license->order_number) ? e($license->order_number) : '',- 'notes' => ($license->notes) ? e($license->notes) : '',+ '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)+ '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) : '');}diff --git a/app/Http/Controllers/ManufacturersController.php b/app/Http/Controllers/ManufacturersController.phpindex 312083bc5a..666b8f8ea6 100755--- a/app/Http/Controllers/ManufacturersController.php+++ b/app/Http/Controllers/ManufacturersController.php@@ -5,7 +5,7 @@ use App\Models\Company;use App\Models\Manufacturer;use App\Models\Setting;use Auth;-use Illuminate\Support\Facades\Gate;+use Gate;use Input;use Lang;use Redirect;@@ -255,10 +255,27 @@ class ManufacturersController extends Controller* @since [v1.0]* @return String JSON*/- public function getDataView($manufacturerId)+ public function getDataView($manufacturerId, $itemtype = null){-$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;if (Input::has('search')) {@@ -304,25 +321,203 @@ class ManufacturersController extends Controller}}- $row = array(- 'id' => $asset->id,- 'name' => (string)link_to('/hardware/'.$asset->id.'/view', e($asset->showAssetName())),- 'model' => e($asset->model->name),- 'asset_tag' => e($asset->asset_tag),- 'serial' => e($asset->serial),- 'assigned_to' => ($asset->assigneduser) ? (string)link_to('/admin/users/'.$asset->assigneduser->id.'/view', e($asset->assigneduser->fullName())): '',- 'actions' => $actions,- 'companyName' => e(Company::getName($asset)),+ $rows[] = array(+ 'id' => $asset->id,+ 'name' => (string)link_to('/hardware/'.$asset->id.'/view', e($asset->showAssetName())),+ 'model' => e($asset->model->name),+ 'asset_tag' => e($asset->asset_tag),+ 'serial' => e($asset->serial),+ 'assigned_to' => ($asset->assigneduser) ? (string)link_to('/admin/users/'.$asset->assigneduser->id.'/view', e($asset->assigneduser->fullName())): '',+ 'actions' => $actions,+ 'companyName' => e(Company::getName($asset)),+ );++ if (isset($inout)) {+ $row['change'] = $inout;+ }+ }++ $data = array('total' => $count, 'rows' => $rows);+ 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);- if (isset($inout)) {- $row['change'] = $inout;+ 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) : ''- $rows[] = $row;+ );}- $data = array('total' => $count, 'rows' => $rows);+ $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;}}diff --git a/app/Http/routes.php b/app/Http/routes.phpindex 8f7404d22f..25feecf9cf 100755--- a/app/Http/routes.php+++ b/app/Http/routes.php@@ -78,7 +78,7 @@ Route::group([ 'prefix' => 'api', 'middleware' => 'auth' ], function () {/*---Manufacturers API---*/Route::group(array('prefix'=>'manufacturers'), function () {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---*/diff --git a/app/Models/Accessory.php b/app/Models/Accessory.phpindex 1a37a6a595..8bd139b499 100755--- a/app/Models/Accessory.php+++ b/app/Models/Accessory.php@@ -82,6 +82,11 @@ class Accessory extends Modelreturn $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(){return $this->category->checkin_email;diff --git a/app/Models/License.php b/app/Models/License.phpindex 843a74c4f0..4444ac6497 100755--- a/app/Models/License.php+++ b/app/Models/License.php@@ -36,6 +36,11 @@ class License extends Depreciablereturn $this->belongsTo('\App\Models\Company', 'company_id');}+ public function manufacturer()+ {+ return $this->belongsTo('\App\Models\Manufacturer', 'manufacturer_id');+ }+/*** Get the assigned user*/diff --git a/app/Models/Manufacturer.php b/app/Models/Manufacturer.phpindex cc10833f88..c5d5b8e049 100755--- a/app/Models/Manufacturer.php+++ b/app/Models/Manufacturer.php@@ -46,6 +46,21 @@ class Manufacturer extends Modelreturn $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*diff --git a/database/migrations/2016_08_09_002225_add_manufacturer_to_licenses.php b/database/migrations/2016_08_09_002225_add_manufacturer_to_licenses.phpnew file mode 100644index 0000000000..4b7dc0a09b--- /dev/null+++ b/database/migrations/2016_08_09_002225_add_manufacturer_to_licenses.php@@ -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) {+ //+ });+ }+}diff --git a/database/migrations/2016_08_12_121613_add_manufacturer_to_accessories_table.php b/database/migrations/2016_08_12_121613_add_manufacturer_to_accessories_table.phpnew file mode 100644index 0000000000..0415f14519--- /dev/null+++ b/database/migrations/2016_08_12_121613_add_manufacturer_to_accessories_table.php@@ -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');+ });+ }+}diff --git a/resources/views/accessories/edit.blade.php b/resources/views/accessories/edit.blade.phpindex 99f2cd5ede..a422d225e0 100755--- a/resources/views/accessories/edit.blade.php+++ b/resources/views/accessories/edit.blade.php@@ -86,6 +86,18 @@</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 --><div class="form-group{{ $errors->has('location_id') ? ' has-error' : '' }}"><div class="col-md-3">diff --git a/resources/views/accessories/index.blade.php b/resources/views/accessories/index.blade.phpindex 827719672d..1ad97dfdd4 100755--- a/resources/views/accessories/index.blade.php+++ b/resources/views/accessories/index.blade.php@@ -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-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>diff --git a/resources/views/hardware/view.blade.php b/resources/views/hardware/view.blade.phpindex 302e255e1e..6321dd1e9b 100755--- a/resources/views/hardware/view.blade.php+++ b/resources/views/hardware/view.blade.php@@ -43,8 +43,6 @@<div class="row"><div class="col-md-12">--<!-- Custom Tabs --><div class="nav-tabs-custom"><ul class="nav nav-tabs">@@ -54,13 +52,12 @@<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></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>- </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>+ </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></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></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></li><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><div class="tab-content"><div class="tab-pane fade in active" id="details"><div class="row">- <div class="col-md-8">- <div class="table-responsive" style="margin-top: 10px;">- <table class="table">+ <div class="col-md-8">+ <div class="table-responsive" style="margin-top: 10px;">+ <table class="table"><tbody>- @if ($asset->company)+ @if ($asset->company)<tr>- <td>{{ trans('general.company') }}</td>- <td>{{ $asset->company->name }}</td>+ <td>{{ trans('general.company') }}</td>+ <td>{{ $asset->company->name }}</td></tr>- @endif+ @endif@if ($asset->name)- <tr>- <td>{{ trans('admin/hardware/form.name') }}</td>- <td>{{ $asset->name }}</td>- </tr>+ <tr>+ <td>{{ trans('admin/hardware/form.name') }}</td>+ <td>{{ $asset->name }}</td>+ </tr>@endif@if ($asset->serial)- <tr>- <td>{{ trans('admin/hardware/form.serial') }}</td>- <td>{{ $asset->serial }}</td>- </tr>+ <tr>+ <td>{{ trans('admin/hardware/form.serial') }}</td>+ <td>{{ $asset->serial }}</td>+ </tr>@endif@if ($asset->model->manufacturer)<tr>@@ -110,7 +108,7 @@<a href="{{ route('view/model', $asset->model->id) }}">{{ $asset->model->name }}</a>- </td>+ </td></tr><tr><td>{{ trans('admin/models/table.modelnumber') }}</td>@@ -121,18 +119,16 @@@endif@if ($asset->model->fieldset)- @foreach($asset->model->fieldset->fields as $field)- <tr>- <td>{{ $field->name }}</td>- <td>- {{ $asset->{$field->db_column_name()} }}- </td>- </tr>+ @foreach($asset->model->fieldset->fields as $field)+ <tr>+ <td>{{ $field->name }}</td>+ <td>+ {{ $asset->{$field->db_column_name()} }}+ </td>+ </tr>@endforeach@endif--@if ($asset->purchase_date)<tr><td>{{ trans('admin/hardware/form.date') }}</td>@@ -143,7 +139,6 @@@endif@if ($asset->purchase_cost)-<tr><td>{{ trans('admin/hardware/form.cost') }}</td><td>@@ -154,17 +149,15 @@@else{{ \App\Models\Setting::first()->default_currency }}@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)(Order #{{ $asset->order_number }})@endif-- </td>+ </td></tr>@endif-@if ($asset->supplier_id)<tr><td>{{ trans('admin/hardware/form.supplier') }}</td>@@ -172,22 +165,21 @@<a href="{{ route('view/supplier', $asset->supplier_id) }}">{{ $asset->supplier->name }}</a>- </td>+ </td></tr>@endif@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"' : '' !!}>- <td>{{ trans('admin/hardware/form.warranty') }}</td>- <td>- {{ $asset->warranty_months }}- {{ trans('admin/hardware/form.months') }}-- ({{ trans('admin/hardware/form.expires') }}- {{ $asset->warrantee_expires() }})- </td>- </tr>+ ({{ trans('admin/hardware/form.expires') }}+ {{ $asset->warrantee_expires() }})+ </td>+ </tr>@endif@if ($asset->depreciation)@@ -198,8 +190,9 @@({{ $asset->depreciation->months }}{{ trans('admin/hardware/form.months') }})- </td>+ </td></tr>+<tr><td>{{ trans('admin/hardware/form.fully_depreciated') }}@@ -212,10 +205,10 @@{{ $asset->time_until_depreciated()->m }}{{ trans('admin/hardware/form.months') }}({{ $asset->depreciated_date()->format('Y-m-d') }})- </td>+ </td></tr>-@endif+@if ($asset->model->eol)<tr><td>{{ trans('admin/hardware/form.eol_rate') }}</td>@@ -234,243 +227,252 @@{{ $asset->months_until_eol()->m }}{{ trans('general.months') }}+ )@endif- )- </td>++ </td></tr>@endif+@if ($asset->expected_checkin!='')<tr><td>{{ trans('admin/hardware/form.expected_checkin') }}</td><td>{{ $asset->expected_checkin }}- </td>+ </td></tr>- @endif- <tr>+ @endif+ <tr><td>{{ trans('admin/hardware/form.notes') }}</td><td> {!! nl2br(e($asset->notes)) !!}</td></tr>- @if ($asset->created_at!='')+ @if ($asset->created_at!='')<tr>- <td>{{ trans('general.created_at') }}</td>- <td>- {{ $asset->created_at->format('F j, Y h:iA') }}- </td>+ <td>{{ trans('general.created_at') }}</td>+ <td>+ {{ $asset->created_at->format('F j, Y h:iA') }}+ </td></tr>- @endif+ @endif</tbody>- </table>- </div> <!-- /table-responsive -->- </div><!-- /col -->+ </table>+ </div> <!-- /table-responsive -->+ </div><!-- /col -->- <div class="col-md-4">+ <div class="col-md-4">@if ($asset->image)- <img src="{{ Config::get('app.url') }}/uploads/assets/{{{ $asset->image }}}" class="assetimg">- @else- @if ($asset->model->image!='')- <img src="{{ Config::get('app.url') }}/uploads/models/{{{ $asset->model->image }}}" class="assetimg">- @endif+ <img src="{{ Config::get('app.url') }}/uploads/assets/{{{ $asset->image }}}" class="assetimg">+ @elseif ($asset->model->image!='')+ <img src="{{ Config::get('app.url') }}/uploads/models/{{{ $asset->model->image }}}" class="assetimg">@endif@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;">@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>- <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>+ <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!=''))- <li><i class="fa fa-envelope-o"></i> <a href="mailto:{{ $asset->assigneduser->email }}">{{ $asset->assigneduser->email }}</a></li>- @endif+ @if ((isset($asset->assigneduser->phone)) && ($asset->assigneduser->phone!=''))+ <li><i class="fa fa-phone"></i> {{ $asset->assigneduser->phone }}</li>+ @endif- @if ((isset($asset->assigneduser->phone)) && ($asset->assigneduser->phone!=''))- <li><i class="fa fa-phone"></i> {{ $asset->assigneduser->phone }}</li>+ @if (isset($asset->userloc))+ <li>{{ $asset->userloc->name }}</li>+ <li>{{ $asset->userloc->address }}+ @if ($asset->userloc->address2!='')+ {{ $asset->userloc->address2 }}@endif+ </li>- @if (isset($asset->userloc))- <li>{{ $asset->userloc->name }}- <li>{{ $asset->userloc->address }}- @if ($asset->userloc->address2!='')- {{ $asset->userloc->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>+ <li>{{ $asset->assetloc->address }}+ @if ($asset->assetloc->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>+ <li>+ {{ $asset->assetloc->city }}+ @if (($asset->assetloc->city!='') && ($asset->assetloc->state!=''))+ ,+ @endif+ {{ $asset->assetloc->state }} {{ $asset->assetloc->zip }}+ </li>+ @endif+ </ul>- @elseif (isset($asset->assetloc))- <li>{{ $asset->assetloc->name }}- <li>{{ $asset->assetloc->address }}- @if ($asset->assetloc->address2!='')- {{ $asset->assetloc->address2 }}- @endif- </li>+ @endif+ </div> <!-- div.col-md-4 -->+ </div><!-- /row -->+ </div><!-- /.tab-pane asset details -->- <li>{{ $asset->assetloc->city }}- @if (($asset->assetloc->city!='') && ($asset->assetloc->state!=''))- ,- @endif- {{ $asset->assetloc->state }} {{ $asset->assetloc->zip }}</li>-- @endif- </ul>+ <div class="tab-pane fade" id="software">+ <div class="row">+ <div class="col-md-12">+ <!-- Licenses assets table -->- @endif- </div>- </div><!-- /row -->- </div><!-- /.tab-pane -->-- <div class="tab-pane fade" id="components">- <!-- checked out assets table -->- <div class="row">- <div class="col-md-12">- <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>+ @if (count($asset->licenses) > 0)+ <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> <!-- 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 colspan="7" class="text-right">{{ $use_currency.$totalCost }}</td>+ <td><a href="{{ route('view/component', $component->id) }}">{{ $component->name }}</a></td></tr>- </tfoot>- </table>- </div>+ @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 class="tab-pane fade" id="software">- <div class="row">- <div class="col-md-12">- <!-- Licenses assets table -->-- @if (count($asset->licenses) > 0)- <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> <!-- /.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))+ <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>- <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>+ <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>+ <a href="{{ config('app.url') }}/admin/users/{{ $assetMaintenance->admin->id }}/view">{{ $assetMaintenance->admin->fullName() }}</a>@endif-- </td>+ </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>+ <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>- @endif- @endforeach- </tbody>- <tfoot>- <tr>- <td colspan="8" class="text-right">{{ $use_currency.number_format($totalCost, 2) }}</td>- </tr>- </tfoot>- </table>- @else-- <div class="alert alert-info alert-block">+ </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>+ </div>+ @endif+ </div> <!-- /.col-md-12 -->+ </div> <!-- /.row -->+ </div> <!-- /.tab-pane maintenances --><div class="tab-pane fade" id="history"><!-- checked out assets table --><div class="row">- <div class="col-md-12">- <table class="table table-hover table-fixed break-word">- <thead>+ <div class="col-md-12">+ <table class="table table-hover table-fixed break-word">+ <thead><tr><th class="col-md-3">{{ trans('general.date') }}</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-3"><span class="line"></span>{{ trans('general.notes') }}</th></tr>- </thead>- <tbody>- @if (count($asset->assetlog) > 0)- @foreach ($asset->assetlog as $log)-- <tr>- <td>{{ $log->created_at }}</td>- <td>- @if (isset($log->adminlog))- {{ $log->adminlog->fullName() }}- @else- Deleted Admin- @endif- </td>- <td>{{ $log->action_type }}</td>- <td>+ </thead>+ <tbody>+ @if (count($asset->assetlog) > 0)+ @foreach ($asset->assetlog as $log)+ <tr>+ <td>{{ $log->created_at }}</td>+ <td>+ @if (isset($log->adminlog))+ {{ $log->adminlog->fullName() }}+ @else+ Deleted Admin+ @endif+ </td>+ <td>{{ $log->action_type }}</td>+ <td>@if ((isset($log->checkedout_to)) && ($log->checkedout_to!=0) && ($log->checkedout_to!=''))- @if ($log->userlog)-- @if ($log->userlog->deleted_at=='')- <a href="{{ route('view/user', $log->checkedout_to) }}">- {{ $log->userlog->fullName() }}- </a>- @else- <del>{{ $log->userlog->fullName() }}</del>- @endif- @else- Deleted User- @endif+ @if ($log->userlog)++ @if ($log->userlog->deleted_at=='')+ <a href="{{ route('view/user', $log->checkedout_to) }}">+ {{ $log->userlog->fullName() }}+ </a>++ @else+ <del>{{ $log->userlog->fullName() }}</del>+ @endif+ @else+ Deleted User+ @endif@endif- </td>- <td>+ </td>+ <td>@if ($log->note) {{ $log->note }}@endif- </td>- </tr>+ </td>+ </tr>- @endforeach+ @endforeach@endif+ <!-- Add a "created asset" row to the log list. This isn't an official log entry.--><tr>- <td>{{ $asset->created_at }}</td>- <td>- @if ($asset->adminuser)- {{ $asset->adminuser->fullName() }}- @else- {{ trans('general.unknown_admin') }}- @endif-- </td>- <td>{{ trans('general.created_asset') }}</td>- <td></td>- <td>- <!-- @if ($asset->notes)- {!! nl2br(e($asset->notes)) !!}- @endif -->- </td>+ <td>{{ $asset->created_at }}</td>+ <td>+ @if ($asset->adminuser)+ {{ $asset->adminuser->fullName() }}+ @else+ {{ trans('general.unknown_admin') }}+ @endif+ </td>+ <td>{{ trans('general.created_asset') }}</td>+ <td></td> <!-- User -->+ <td></td> <!-- Notes --></tr>- </tbody>- </table>- </div>- </div>- </div>+ </tbody>+ </table>+ </div>+ </div> <!-- /.row -->+ </div> <!-- /.tab-pane history -->+<div class="tab-pane fade" id="files"><div class="row">+ {{ Form::open([+ 'method' => 'POST',+ 'route' => ['upload/asset', $asset->id],+ 'files' => true, 'class' => 'form-horizontal' ]) }}- {{ Form::open([- 'method' => 'POST',- 'route' => ['upload/asset', $asset->id],- 'files' => true, 'class' => 'form-horizontal' ]) }}-- <div class="col-md-2">- <span class="btn btn-default btn-file">Browse for file...- {{ Form::file('assetfile[]', ['multiple' => 'multiple']) }}- </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-12">- <p>{{ trans('admin/hardware/general.filetype_info') }}</p>- <hr>- </div>+ <div class="col-md-2">+ <span class="btn btn-default btn-file">Browse for file...+ {{ Form::file('assetfile[]', ['multiple' => 'multiple']) }}+ </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>- {{ Form::close() }}+ <div class="col-md-12">+ <p>{{ trans('admin/hardware/general.filetype_info') }}</p>+ <hr>+ </div>- <div class="col-md-12">+ {{ Form::close() }}+ <div class="col-md-12">- <table class="table table-hover">+ <table class="table table-hover"><thead>- <tr>- <th class="col-md-4">{{ trans('general.notes') }}</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-2"></th>- <th class="col-md-2"></th>- </tr>+ <tr>+ <th class="col-md-4">{{ trans('general.notes') }}</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-2"></th>+ <th class="col-md-2"></th>+ </tr></thead><tbody>- @if (count($asset->uploads) > 0)- @foreach ($asset->uploads as $file)- <tr>- <td>- @if ($file->note)- {{ $file->note }}- @endif- </td>- <td>- @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>- @endif- </td>- <td>- {{ $file->filename }}- </td>- <td>- @if ($file->filename)- <a href="{{ route('show/assetfile', [$asset->id, $file->id]) }}" class="btn btn-default">{{ trans('general.download') }}</a>- @endif- </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>- </td>- </tr>- @endforeach- @else- <tr>- <td colspan="4">- {{ trans('general.no_results') }}- </td>- </tr>+ @if (count($asset->uploads) > 0)+ @foreach ($asset->uploads as $file)+ <tr>+ <td>+ @if ($file->note)+ {{ $file->note }}+ @endif+ </td>+ <td>+ @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>+ @endif+ </td>+ <td>+ {{ $file->filename }}+ </td>+ <td>+ @if ($file->filename)+ <a href="{{ route('show/assetfile', [$asset->id, $file->id]) }}" class="btn btn-default">{{ trans('general.download') }}</a>+ @endif+ </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>+ </td>+ </tr>+ @endforeach+ @else+ <tr>+ <td colspan="4">+ {{ trans('general.no_results') }}+ </td>+ </tr>- @endif+ @endif</tbody>- </table>- </div>- </div>- </div>-- </div><!-- nav-tabs-custom -->--- </div>-</div>+ </table>+ </div> <!-- /.col-md-12 -->+ </div> <!-- /.row -->+ </div> <!-- /.tab-pane files -->+ </div> <!-- /. tab-content -->+ </div> <!-- /.nav-tabs-custom -->+ </div> <!-- /. col-md-12 -->+</div> <!-- /. row -->@section('moar_scripts')<script>diff --git a/resources/views/licenses/edit.blade.php b/resources/views/licenses/edit.blade.phpindex 46994e8e53..66410ef532 100755--- a/resources/views/licenses/edit.blade.php+++ b/resources/views/licenses/edit.blade.php@@ -83,6 +83,15 @@</div>@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 --><div class="form-group {{ $errors->has('license_name') ? ' has-error' : '' }}">diff --git a/resources/views/licenses/index.blade.php b/resources/views/licenses/index.blade.phpindex 5ecd381c5d..f6af833ba2 100755--- a/resources/views/licenses/index.blade.php+++ b/resources/views/licenses/index.blade.php@@ -37,6 +37,7 @@<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>diff --git a/resources/views/licenses/view.blade.php b/resources/views/licenses/view.blade.phpindex 3f1fca4e45..c2ee6d43de 100755--- a/resources/views/licenses/view.blade.php+++ b/resources/views/licenses/view.blade.php@@ -136,6 +136,13 @@</tr>@endif+ @if (!is_null($license->manufacturer))+ <tr>+ <td>{{ trans('general.manufacturer') }}</td>+ <td>{{ $license->manufacturer->name }}</td>+ </tr>+ @endif+@can('licenses.keys')@if (!is_null($license->serial))<tr>diff --git a/resources/views/manufacturers/view.blade.php b/resources/views/manufacturers/view.blade.phpindex 5d734849b5..267038ebb8 100644--- a/resources/views/manufacturers/view.blade.php+++ b/resources/views/manufacturers/view.blade.php@@ -25,37 +25,146 @@<div class="row"><div class="col-md-12">- <div class="box box-default">- <div class="box-body">- <table- name="category_assets"- class="table table-striped"- id="table"- data-url="{{ route('api.manufacturers.view', $manufacturer->id) }}"- data-cookie="true"- data-click-to-select="true"- data-cookie-id-table="maufacturerAssetsTableOIUOIUI">+ <div class="nav-tabs-custom">+ <ul class="nav nav-tabs">+ <li class="active">+ <a href="#assets" data-toggle="tab">Assets</a>+ </li>+ <li>+ <a href="#licenses" data-toggle="tab">Licenses</a>+ </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>- <tr>- <th data-searchable="false" data-sortable="false" data-field="companyName" data-visible="false">- {{ trans('admin/companies/table.title') }}- </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="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="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="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>- </tr>+ <tr>+ <th data-searchable="false" data-sortable="false" data-field="companyName" data-visible="false">+ {{ trans('admin/companies/table.title') }}+ </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="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="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="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>+ </tr></thead>- </table>- </div>- </div>- </div>-</div>+ </table>+ </div> <!-- /.tab-pane assets -->++ <div class="tab-pane fade" id="licenses">+ <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')@@ -66,7 +175,7 @@<script src="{{ asset('assets/js/extensions/export/tableExport.js') }}"></script><script src="{{ asset('assets/js/extensions/export/jquery.base64.js') }}"></script><script type="text/javascript">- $('#table').bootstrapTable({+ $('.bootstrap-table').bootstrapTable({classes: 'table table-responsive table-no-bordered',undefinedText: '',iconsPrefix: 'fa',diff --git a/resources/views/models/edit.blade.php b/resources/views/models/edit.blade.phpindex 760043c6cc..9dfde7afca 100755--- a/resources/views/models/edit.blade.php+++ b/resources/views/models/edit.blade.php@@ -41,7 +41,6 @@<!-- Model name --><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><div class="col-md-7 required"><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>') !!}@@ -49,20 +48,16 @@</div><div class="form-group {{ $errors->has('manufacturer_id') ? ' has-error' : '' }}">- <label for="manufacturer_id" class="col-md-3 control-label">{{ trans('general.manufacturer') }}- </label>- </label>+ <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', $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>') !!}</div>- </div>+ </div><!-- Category --><div class="form-group {{ $errors->has('category_id') ? ' has-error' : '' }}">- <label for="category_id" class="col-md-3 control-label">{{ trans('general.category') }}- </label>- </label>+ <label for="category_id" class="col-md-3 control-label">{{ trans('general.category') }}</label><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')) }}{!! $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><div class="col-md-3"><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">- {{ trans('general.months') }}-+ <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">+ {{ trans('general.months') }}</span>{!! $errors->first('eol', '<span class="alert-msg"><br><i class="fa fa-times"></i> :message</span>') !!}</div>@@ -109,7 +104,6 @@<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')) }}{!! $errors->first('custom_fieldset', '<span class="alert-msg"><br><i class="fa fa-times"></i> :message</span>') !!}- </label></div></div>@@ -152,7 +146,4 @@</div></div>--</form>-</div>@stop