Skip to content

A free open source IT asset/license management system

Added breadcrumbs

snipe8eacb1c1f007
diff --git a/routes/web/accessories.php b/routes/web/accessories.php
index e4d2c524de..065a2d5328 100644
--- a/routes/web/accessories.php
+++ b/routes/web/accessories.php
@@ -2,7 +2,9 @@
use App\Http\Controllers\Accessories;
use App\Http\Controllers\BulkAccessoriesController;
+use App\Models\Accessory;
use Illuminate\Support\Facades\Route;
+use Tabuna\Breadcrumbs\Trail;
/*
* Accessories
@@ -46,6 +48,26 @@ Route::group(['prefix' => 'accessories', 'middleware' => ['auth']], function ()
[Accessories\AccessoriesController::class, 'adjustQuantity']
)->name('accessories.adjust-quantity');
+ // Bulk-fulfill: process the accessory's pending-request queue
+ // in one pass. Reached from the "Fulfill Multiple" button on
+ // the /requests admin queue when ≥2 pending requests exist for
+ // the same accessory. See AccessoryCheckoutController for the
+ // per-row iteration semantics.
+ Route::get('{accessory}/fulfill-requests',
+ [Accessories\AccessoryCheckoutController::class, 'bulkFulfillCreate']
+ )->name('accessories.fulfill-requests.create')
+ ->breadcrumbs(fn (Trail $trail, Accessory $accessory) => $trail
+ // Bulk-fulfill always starts from the /requests queue -
+ // root there so the trail reads as the natural flow.
+ ->parent('requests.index')
+ ->push($accessory->name, route('accessories.show', $accessory))
+ ->push(trans('general.checkout'), route('accessories.fulfill-requests.create', $accessory))
+ );
+
+ Route::post('{accessory}/fulfill-requests',
+ [Accessories\AccessoryCheckoutController::class, 'bulkFulfillStore']
+ )->name('accessories.fulfill-requests.store');
+
});
Route::resource('accessories', Accessories\AccessoriesController::class, [
diff --git a/routes/web/components.php b/routes/web/components.php
index b369725eb3..2ac0bc2a61 100644
--- a/routes/web/components.php
+++ b/routes/web/components.php
@@ -1,7 +1,9 @@
<?php
use App\Http\Controllers\Components;
+use App\Models\Component;
use Illuminate\Support\Facades\Route;
+use Tabuna\Breadcrumbs\Trail;
// Components
Route::group(['prefix' => 'components', 'middleware' => ['auth']], function () {
@@ -46,6 +48,26 @@ Route::group(['prefix' => 'components', 'middleware' => ['auth']], function () {
)->where('component', '[0-9]+')
->name('components.adjust-quantity');
+ // Bulk-fulfill queue for this component. Distinct from the
+ // sibling user-target bulk-fulfill routes (accessories/
+ // consumables/licenses) because component checkouts target an
+ // Asset - the per-row picker filters to the requester's
+ // assigned assets.
+ Route::get('{component}/fulfill-requests',
+ [Components\ComponentCheckoutController::class, 'bulkFulfillCreate']
+ )->where('component', '[0-9]+')
+ ->name('components.fulfill-requests.create')
+ ->breadcrumbs(fn (Trail $trail, Component $component) => $trail
+ ->parent('requests.index')
+ ->push($component->name, route('components.show', $component))
+ ->push(trans('general.checkout'), route('components.fulfill-requests.create', $component))
+ );
+
+ Route::post('{component}/fulfill-requests',
+ [Components\ComponentCheckoutController::class, 'bulkFulfillStore']
+ )->where('component', '[0-9]+')
+ ->name('components.fulfill-requests.store');
+
});
Route::resource('components', Components\ComponentsController::class, [
diff --git a/routes/web/consumables.php b/routes/web/consumables.php
index 5d2f22ccbf..13eeb78392 100644
--- a/routes/web/consumables.php
+++ b/routes/web/consumables.php
@@ -1,7 +1,9 @@
<?php
use App\Http\Controllers\Consumables;
+use App\Models\Consumable;
use Illuminate\Support\Facades\Route;
+use Tabuna\Breadcrumbs\Trail;
Route::group(['prefix' => 'consumables', 'middleware' => ['auth']], function () {
Route::get(
@@ -26,6 +28,24 @@ Route::group(['prefix' => 'consumables', 'middleware' => ['auth']], function ()
)->where('consumable', '[0-9]+')
->name('consumables.adjust-quantity');
+ // Bulk-fulfill queue for this consumable. See sibling
+ // accessories.fulfill-requests.* for the shared per-row shape
+ // and controller semantics.
+ Route::get('{consumable}/fulfill-requests',
+ [Consumables\ConsumableCheckoutController::class, 'bulkFulfillCreate']
+ )->where('consumable', '[0-9]+')
+ ->name('consumables.fulfill-requests.create')
+ ->breadcrumbs(fn (Trail $trail, Consumable $consumable) => $trail
+ ->parent('requests.index')
+ ->push($consumable->name, route('consumables.show', $consumable))
+ ->push(trans('general.checkout'), route('consumables.fulfill-requests.create', $consumable))
+ );
+
+ Route::post('{consumable}/fulfill-requests',
+ [Consumables\ConsumableCheckoutController::class, 'bulkFulfillStore']
+ )->where('consumable', '[0-9]+')
+ ->name('consumables.fulfill-requests.store');
+
});
Route::resource('consumables', Consumables\ConsumablesController::class, [
diff --git a/routes/web/hardware.php b/routes/web/hardware.php
index f315ece76c..bfac1aa3ac 100644
--- a/routes/web/hardware.php
+++ b/routes/web/hardware.php
@@ -40,11 +40,14 @@ Route::group(
->push('Quickscan Checkin', route('hardware/quickscancheckin'))
);
- Route::get('requested', [AssetsController::class, 'getRequestedIndex'])
- ->name('assets.requested')
- ->breadcrumbs(fn (Trail $trail) => $trail->parent('hardware.index')
- ->push(trans('admin/hardware/general.requested'), route('assets.requested'))
- );
+ // Legacy /hardware/requested URL. Route + name have moved to
+ // /requests since the queue covers every requestable item
+ // type now (not just hardware). Kept here as a 301 so external
+ // bookmarks + integrations that point at the old URL land in
+ // the right place. Delete once we're confident nothing in the
+ // wild still references it.
+ Route::redirect('requested', '/requests', 301);
+ Route::redirect('requested/bulk-cancel', '/requests/bulk-cancel', 301);
Route::get('audit/due', [AssetsController::class, 'dueForAudit'])
->name('assets.audit.due')
diff --git a/routes/web/licenses.php b/routes/web/licenses.php
index 4bc34669f1..7b9901a11a 100644
--- a/routes/web/licenses.php
+++ b/routes/web/licenses.php
@@ -54,6 +54,25 @@ Route::group(['prefix' => 'licenses', 'middleware' => ['auth']], function () {
)->where('licenseId', '[0-9]+')
->name('licenses.bulkcheckout');
+ // Bulk-fulfill queue for this license. Distinct from
+ // bulkcheckout above (which assigns free seats to every user
+ // in the org). See sibling accessories.fulfill-requests.* for
+ // the shared per-row shape and controller semantics.
+ Route::get('{license}/fulfill-requests',
+ [Licenses\LicenseCheckoutController::class, 'bulkFulfillCreate']
+ )->where('license', '[0-9]+')
+ ->name('licenses.fulfill-requests.create')
+ ->breadcrumbs(fn (Trail $trail, License $license) => $trail
+ ->parent('requests.index')
+ ->push($license->name, route('licenses.show', $license))
+ ->push(trans('general.checkout'), route('licenses.fulfill-requests.create', $license))
+ );
+
+ Route::post('{license}/fulfill-requests',
+ [Licenses\LicenseCheckoutController::class, 'bulkFulfillStore']
+ )->where('license', '[0-9]+')
+ ->name('licenses.fulfill-requests.store');
+
Route::get(
'export',
[
diff --git a/routes/web/models.php b/routes/web/models.php
index 3e92882cd0..53568bb175 100644
--- a/routes/web/models.php
+++ b/routes/web/models.php
@@ -2,6 +2,7 @@
use App\Http\Controllers\AssetModelsController;
use App\Http\Controllers\BulkAssetModelsController;
+use App\Models\AssetModel;
use Illuminate\Support\Facades\Route;
use Tabuna\Breadcrumbs\Trail;
@@ -85,6 +86,30 @@ Route::group(['prefix' => 'models', 'middleware' => ['auth']], function () {
]
)->name('models.bulkdelete.store');
+ // Bulk-fulfill queue for a model's pending requests. Each row
+ // picks a specific available asset OF this model to hand out.
+ // See AssetModelsController::bulkFulfillRequests for design
+ // notes on the pool + auto-pick behavior.
+ Route::get(
+ '{model}/fulfill-requests',
+ [AssetModelsController::class, 'bulkFulfillRequests']
+ )->where('model', '[0-9]+')
+ ->name('models.fulfill-requests.create')
+ ->breadcrumbs(fn (Trail $trail, AssetModel $model) => $trail
+ // Bulk-fulfill always starts from the /requests queue -
+ // root there so the trail reads as the natural flow the
+ // admin came through, not the item-type indexes.
+ ->parent('requests.index')
+ ->push($model->name, route('models.show', $model))
+ ->push(trans('general.checkout'), route('models.fulfill-requests.create', $model))
+ );
+
+ Route::post(
+ '{model}/fulfill-requests',
+ [AssetModelsController::class, 'bulkFulfillStoreRequests']
+ )->where('model', '[0-9]+')
+ ->name('models.fulfill-requests.store');
+
});
Route::resource('models', AssetModelsController::class, [