Merge remote-tracking branch 'origin/develop'

This commit is contained in:
snipe 2024-03-07 21:22:01 +00:00
commit ea2d54b0f7
3 changed files with 8 additions and 1 deletions

View file

@ -14,6 +14,7 @@ use App\View\Label;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Session;
use App\Http\Requests\AssetCheckoutRequest;
use App\Models\CustomField;
@ -95,6 +96,11 @@ class BulkAssetsController extends Controller
$assets = $assets->get();
if ($assets->isEmpty()) {
Log::debug('No assets were found for the provided IDs', ['ids' => $asset_ids]);
return redirect()->back()->with('error', trans('admin/hardware/message.update.assets_do_not_exist_or_are_invalid'));
}
$models = $assets->unique('model_id');
$modelNames = [];
foreach($models as $model) {

View file

@ -41,7 +41,7 @@ class Label implements View
$template = LabelModel::find($settings->label2_template);
// If disabled, pass to legacy view
if ((!$settings->label2_enable) && (!$template)) {
if ((!$settings->label2_enable)) {
return view('hardware/labels')
->with('assets', $assets)
->with('settings', $settings)

View file

@ -19,6 +19,7 @@ return [
'success' => 'Asset updated successfully.',
'nothing_updated' => 'No fields were selected, so nothing was updated.',
'no_assets_selected' => 'No assets were selected, so nothing was updated.',
'assets_do_not_exist_or_are_invalid' => 'Selected assets cannot be updated.',
],
'restore' => [