Skip to content

A free open source IT asset/license management system

renamed unassignable to reassignable_seat

Godfrey M52bf0faaa5c5
diff --git a/app/Helpers/Helper.php b/app/Helpers/Helper.php
index 0d7665f978..a51c957c5a 100644
--- a/app/Helpers/Helper.php
+++ b/app/Helpers/Helper.php
@@ -1535,7 +1535,7 @@ class Helper
{
if (!$license->reassignable) {
- $count = LicenseSeat::where('unassignable', '=', true)
+ $count = LicenseSeat::where('reassignable_seat', '=', true)
->where('license_id', '=', $license->id)
->count();
return $count;
diff --git a/app/Http/Controllers/Api/LicenseSeatsController.php b/app/Http/Controllers/Api/LicenseSeatsController.php
index de1cc3b53c..5115523c2e 100644
--- a/app/Http/Controllers/Api/LicenseSeatsController.php
+++ b/app/Http/Controllers/Api/LicenseSeatsController.php
@@ -119,7 +119,7 @@ class LicenseSeatsController extends Controller
// nothing to update
return response()->json(Helper::formatStandardApiResponse('success', $licenseSeat, trans('admin/licenses/message.update.success')));
}
- if( $touched && $licenseSeat->unassignable) {
+ if( $touched && $licenseSeat->reassignable_seat) {
return response()->json(Helper::formatStandardApiResponse('error', $licenseSeat, trans('admin/licenses/message.checkout.unavailable')));
}
// the logging functions expect only one "target". if both asset and user are present in the request,
@@ -140,7 +140,7 @@ class LicenseSeatsController extends Controller
if ($is_checkin) {
$licenseSeat->logCheckin($target, $request->input('note'));
if(!$licenseSeat->license->reassignable){
- $licenseSeat->unassignable = true;
+ $licenseSeat->reassignable_seat = true;
$licenseSeat->save();
}
diff --git a/app/Http/Controllers/Licenses/LicenseCheckinController.php b/app/Http/Controllers/Licenses/LicenseCheckinController.php
index 94cf55380a..6553b9ab12 100644
--- a/app/Http/Controllers/Licenses/LicenseCheckinController.php
+++ b/app/Http/Controllers/Licenses/LicenseCheckinController.php
@@ -96,7 +96,7 @@ class LicenseCheckinController extends Controller
$licenseSeat->asset_id = null;
$licenseSeat->notes = $request->input('notes');
if (! $licenseSeat->license->reassignable) {
- $licenseSeat->unassignable = true;
+ $licenseSeat->reassignable_seat = true;
$licenseSeat->notes .= "\n" . trans('admin/licenses/message.checkin.not_reassignable') . '.';
}
diff --git a/app/Http/Transformers/LicenseSeatsTransformer.php b/app/Http/Transformers/LicenseSeatsTransformer.php
index f79be04d09..ec74d74326 100644
--- a/app/Http/Transformers/LicenseSeatsTransformer.php
+++ b/app/Http/Transformers/LicenseSeatsTransformer.php
@@ -49,7 +49,7 @@ class LicenseSeatsTransformer
'reassignable' => (bool) $seat->license->reassignable,
'notes' => e($seat->notes),
'user_can_checkout' => (($seat->assigned_to == '') && ($seat->asset_id == '')),
- 'disabled' => $seat->unassignable,
+ 'disabled' => $seat->reassignable_seat,
];
if ($seat_count != 0) {
diff --git a/app/Models/License.php b/app/Models/License.php
index ac0e5a0049..b6fef33e1e 100755
--- a/app/Models/License.php
+++ b/app/Models/License.php
@@ -653,7 +653,7 @@ class License extends Depreciable
{
return $this->licenseseats()
->whereNull('deleted_at')
- ->where('unassignable', '=', false)
+ ->where('reassignable_seat', '=', false)
->where(function ($query) {
$query->whereNull('assigned_to')
->whereNull('asset_id');
diff --git a/database/factories/LicenseSeatFactory.php b/database/factories/LicenseSeatFactory.php
index a4752f7388..09ea283d0c 100644
--- a/database/factories/LicenseSeatFactory.php
+++ b/database/factories/LicenseSeatFactory.php
@@ -14,7 +14,7 @@ class LicenseSeatFactory extends Factory
{
return [
'license_id' => License::factory(),
- 'unassignable' => false,
+ 'reassignable_seat' => false,
];
}
diff --git a/database/migrations/2025_01_15_190348_adds_unavailable_to_license_seats_tables.php b/database/migrations/2025_01_15_190348_adds_unavailable_to_license_seats_tables.php
index 6d41b68b83..334104d40e 100644
--- a/database/migrations/2025_01_15_190348_adds_unavailable_to_license_seats_tables.php
+++ b/database/migrations/2025_01_15_190348_adds_unavailable_to_license_seats_tables.php
@@ -14,7 +14,7 @@ return new class extends Migration
public function up(): void
{
Schema::table('license_seats', function (Blueprint $table) {
- $table->addColumn('boolean', 'unassignable')->default(false)->after('assigned_to');
+ $table->addColumn('boolean', 'reassignable_seat')->default(false)->after('assigned_to');
});
}
/**
@@ -23,7 +23,7 @@ return new class extends Migration
public function down(): void
{
Schema::table('license_seats', function (Blueprint $table) {
- $table->dropColumn('unassignable');
+ $table->dropColumn('reassignable_seat');
});
}
};
diff --git a/tests/Feature/Checkins/Ui/LicenseCheckinTest.php b/tests/Feature/Checkins/Ui/LicenseCheckinTest.php
index ed8604d9ac..d43ccb593d 100644
--- a/tests/Feature/Checkins/Ui/LicenseCheckinTest.php
+++ b/tests/Feature/Checkins/Ui/LicenseCheckinTest.php
@@ -32,7 +32,7 @@ class LicenseCheckinTest extends TestCase
$licenseSeat->refresh();
- $this->assertEquals(1, $licenseSeat->unassignable);
+ $this->assertEquals(1, $licenseSeat->reassignable_seat);
}
public function testCannotCheckinLicenseThatIsNotAssigned()