diff --git a/app/Http/Controllers/Api/AssetModelsController.php b/app/Http/Controllers/Api/AssetModelsController.php index 8b81947d2a..637d13d61d 100644 --- a/app/Http/Controllers/Api/AssetModelsController.php +++ b/app/Http/Controllers/Api/AssetModelsController.php @@ -182,7 +182,6 @@ class AssetModelsController extends Controller */ public function selectlist(Request $request) { - $this->authorize('view', AssetModel::class); $assetmodels = AssetModel::select([ 'models.id', diff --git a/app/Http/Controllers/Api/CompaniesController.php b/app/Http/Controllers/Api/CompaniesController.php index 3a21e80290..4d5a1b2a4f 100644 --- a/app/Http/Controllers/Api/CompaniesController.php +++ b/app/Http/Controllers/Api/CompaniesController.php @@ -153,7 +153,6 @@ class CompaniesController extends Controller */ public function selectlist(Request $request) { - $this->authorize('view', Company::class); $companies = Company::select([ 'companies.id', diff --git a/app/Http/Controllers/Api/DepartmentsController.php b/app/Http/Controllers/Api/DepartmentsController.php index a899708ee7..7acd3f5976 100644 --- a/app/Http/Controllers/Api/DepartmentsController.php +++ b/app/Http/Controllers/Api/DepartmentsController.php @@ -122,7 +122,6 @@ class DepartmentsController extends Controller */ public function selectlist(Request $request) { - $this->authorize('view', Department::class); $departments = Department::select([ 'id', diff --git a/app/Http/Controllers/Api/ManufacturersController.php b/app/Http/Controllers/Api/ManufacturersController.php index 21c99810a1..9b35148cc0 100644 --- a/app/Http/Controllers/Api/ManufacturersController.php +++ b/app/Http/Controllers/Api/ManufacturersController.php @@ -132,7 +132,6 @@ class ManufacturersController extends Controller */ public function selectlist(Request $request) { - $this->authorize('view', Manufacturers::class); $manufacturers = Manufacturer::select([ 'id', diff --git a/app/Http/Controllers/Api/SuppliersController.php b/app/Http/Controllers/Api/SuppliersController.php index 288b6b3c2d..96a1efe224 100644 --- a/app/Http/Controllers/Api/SuppliersController.php +++ b/app/Http/Controllers/Api/SuppliersController.php @@ -146,7 +146,6 @@ class SuppliersController extends Controller */ public function selectlist(Request $request) { - $this->authorize('view', Supplier::class); $suppliers = Supplier::select([ 'id', diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php index 810d610d67..125c91bd7d 100755 --- a/app/Http/Controllers/SettingsController.php +++ b/app/Http/Controllers/SettingsController.php @@ -748,6 +748,7 @@ class SettingsController extends Controller $setting->labels_fontsize = $request->input('labels_fontsize'); $setting->labels_pagewidth = $request->input('labels_pagewidth'); $setting->labels_pageheight = $request->input('labels_pageheight'); + $setting->labels_display_company_name = $request->input('labels_display_company_name', '0'); diff --git a/app/Models/Asset.php b/app/Models/Asset.php index 75c8343267..1dafcfd450 100644 --- a/app/Models/Asset.php +++ b/app/Models/Asset.php @@ -42,6 +42,7 @@ class Asset extends Depreciable */ protected $injectUniqueIdentifier = true; + // We set these as protected dates so that they will be easily accessible via Carbon protected $dates = [ 'created_at', 'updated_at', @@ -138,7 +139,7 @@ class Asset extends Depreciable * @param User $user * @param User $admin * @param Carbon $checkout_at - * @param null $expected_checkin + * @param Carbon $expected_checkin * @param string $note * @param null $name * @return bool @@ -710,7 +711,7 @@ class Asset extends Depreciable */ public function scopeInModelList($query, array $modelIdListing) { - return $query->whereIn('model_id', $modelIdListing); + return $query->whereIn('assets.model_id', $modelIdListing); } /** diff --git a/app/Notifications/CheckoutNotification.php b/app/Notifications/CheckoutNotification.php index a0f44baf10..8a5512aa91 100644 --- a/app/Notifications/CheckoutNotification.php +++ b/app/Notifications/CheckoutNotification.php @@ -93,7 +93,7 @@ class CheckoutNotification extends Notification 'first_name' => $target->present()->fullName(), 'item_name' => $item->present()->name(), 'checkout_date' => $item->last_checkout, - 'expected_checkin' => $item->expected_checkin, + 'expected_checkin' => $item->expected_checkin->format('Y-m-d'), 'item_tag' => $item->asset_tag, 'note' => $this->params['note'], 'item_serial' => $item->serial, diff --git a/database/migrations/2017_11_08_123942_labels_display_company_name.php b/database/migrations/2017_11_08_123942_labels_display_company_name.php new file mode 100644 index 0000000000..4e4d018ae4 --- /dev/null +++ b/database/migrations/2017_11_08_123942_labels_display_company_name.php @@ -0,0 +1,34 @@ +boolean('labels_display_company_name')->default(0); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('settings', function ($table) { + $table->dropColumn( + 'labels_display_company_name' + ); + }); + } +} diff --git a/resources/views/hardware/labels.blade.php b/resources/views/hardware/labels.blade.php index 9e3994037b..cbfb1f4449 100644 --- a/resources/views/hardware/labels.blade.php +++ b/resources/views/hardware/labels.blade.php @@ -112,28 +112,32 @@ @endif