Skip to content

A free open source IT asset/license management system

setting created

akemidx3ff1745f560f
diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php
index 9c7392560d..f0903f412b 100755
--- a/app/Http/Controllers/SettingsController.php
+++ b/app/Http/Controllers/SettingsController.php
@@ -342,6 +342,8 @@ class SettingsController extends Controller
$setting->depreciation_method = $request->input('depreciation_method');
$setting->dash_chart_type = $request->input('dash_chart_type');
$setting->profile_edit = $request->input('profile_edit', 0);
+ $setting->require_checkinout_notes = $request->input('require_checkinout_notes', 0);
+
if ($request->input('per_page') != '') {
$setting->per_page = $request->input('per_page');
diff --git a/database/migrations/2024_08_01_201721_add_required_notes_setting.php b/database/migrations/2024_08_01_201721_add_required_notes_setting.php
new file mode 100644
index 0000000000..d4934ed7fb
--- /dev/null
+++ b/database/migrations/2024_08_01_201721_add_required_notes_setting.php
@@ -0,0 +1,30 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration
+{
+ /**
+ * Run the migrations.
+ */
+ public function up(): void
+ {
+ Schema::table('settings', function (Blueprint $table) {
+ $table->boolean('require_checkinout_notes')->nullable()->default(1);
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ */
+ public function down(): void
+ {
+ Schema::table('settings', function (Blueprint $table) {
+ if (Schema::hasColumn('settings', 'require_checkinout_notes')) {
+ $table->dropColumn('require_checkinout_notes');
+ }
+ });
+ }
+};
diff --git a/resources/lang/en-US/admin/settings/general.php b/resources/lang/en-US/admin/settings/general.php
index 9ba69ef22a..abbf263209 100644
--- a/resources/lang/en-US/admin/settings/general.php
+++ b/resources/lang/en-US/admin/settings/general.php
@@ -276,6 +276,8 @@ return [
'two_factor_enrollment_text' => "Two factor authentication is required, however your device has not been enrolled yet. Open your Google Authenticator app and scan the QR code below to enroll your device. Once you've enrolled your device, enter the code below",
'require_accept_signature' => 'Require Signature',
'require_accept_signature_help_text' => 'Enabling this feature will require users to physically sign off on accepting an asset.',
+ 'require_checkinout_notes' => 'Require Notes on Checkin/Checkout',
+ 'require_checkinout_notes_help_text' => 'Enabling this feature will require the note fields to be populated when checking in or checking out an asset.',
'left' => 'left',
'right' => 'right',
'top' => 'top',
diff --git a/resources/views/settings/general.blade.php b/resources/views/settings/general.blade.php
index 91d3b1c56f..477d8e68a0 100644
--- a/resources/views/settings/general.blade.php
+++ b/resources/views/settings/general.blade.php
@@ -200,6 +200,23 @@
</div>
</div>
+ <!-- Require Notes on checkin/checkout checkbox -->
+ <div class="form-group">
+ <div class="col-md-3">
+ <label>
+ {{ trans('admin/settings/general.require_checkinout_notes') }}
+ </label>
+ </div>
+ <div class="col-md-8">
+ <label class="form-control">
+ <input type="checkbox" value="1" name="require_checkinout_notes" {{ (old('require_checkinout_notes', $setting->require_checkinout_notes)) == '1' ? ' checked="checked"' : '' }} aria-label="require_checkinout_notes">
+ {{ trans('general.yes') }}
+ </label>
+ <p class="help-block">{{ trans('admin/settings/general.require_checkinout_notes_help_text') }}</p>
+ </div>
+ </div>
+ <!-- /.form-group -->
+
<!-- login text -->
<div class="form-group {{ $errors->has('login_note') ? 'error' : '' }}">