mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
renamed dead to unassigned, replaced 0 and 1 with true and flase
This commit is contained in:
parent
db11fc35f4
commit
f050864fb4
|
@ -1535,7 +1535,7 @@ class Helper
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!$license->reassignable) {
|
if (!$license->reassignable) {
|
||||||
$count = LicenseSeat::where('dead', '=', true)
|
$count = LicenseSeat::where('unassignable', '=', true)
|
||||||
->where('license_id', '=', $license->id)
|
->where('license_id', '=', $license->id)
|
||||||
->count();
|
->count();
|
||||||
return $count;
|
return $count;
|
||||||
|
|
|
@ -119,7 +119,7 @@ class LicenseSeatsController extends Controller
|
||||||
// nothing to update
|
// nothing to update
|
||||||
return response()->json(Helper::formatStandardApiResponse('success', $licenseSeat, trans('admin/licenses/message.update.success')));
|
return response()->json(Helper::formatStandardApiResponse('success', $licenseSeat, trans('admin/licenses/message.update.success')));
|
||||||
}
|
}
|
||||||
if( $touched && $licenseSeat->dead) {
|
if( $touched && $licenseSeat->unassignable) {
|
||||||
return response()->json(Helper::formatStandardApiResponse('error', $licenseSeat, trans('admin/licenses/message.checkout.unavailable')));
|
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,
|
// 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) {
|
if ($is_checkin) {
|
||||||
$licenseSeat->logCheckin($target, $request->input('note'));
|
$licenseSeat->logCheckin($target, $request->input('note'));
|
||||||
if(!$licenseSeat->license->reassignable){
|
if(!$licenseSeat->license->reassignable){
|
||||||
$licenseSeat->dead = 1;
|
$licenseSeat->unassignable = true;
|
||||||
$licenseSeat->save();
|
$licenseSeat->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,7 @@ class LicenseCheckinController extends Controller
|
||||||
$licenseSeat->asset_id = null;
|
$licenseSeat->asset_id = null;
|
||||||
$licenseSeat->notes = $request->input('notes');
|
$licenseSeat->notes = $request->input('notes');
|
||||||
if (! $licenseSeat->license->reassignable) {
|
if (! $licenseSeat->license->reassignable) {
|
||||||
$licenseSeat->dead = 1;
|
$licenseSeat->unassignable = true;
|
||||||
$licenseSeat->notes .= "\n" . trans('admin/licenses/message.checkin.not_reassignable') . '.';
|
$licenseSeat->notes .= "\n" . trans('admin/licenses/message.checkin.not_reassignable') . '.';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ class LicenseSeatsTransformer
|
||||||
'reassignable' => (bool) $seat->license->reassignable,
|
'reassignable' => (bool) $seat->license->reassignable,
|
||||||
'notes' => e($seat->notes),
|
'notes' => e($seat->notes),
|
||||||
'user_can_checkout' => (($seat->assigned_to == '') && ($seat->asset_id == '')),
|
'user_can_checkout' => (($seat->assigned_to == '') && ($seat->asset_id == '')),
|
||||||
'disabled' => $seat->dead,
|
'disabled' => $seat->unassignable,
|
||||||
];
|
];
|
||||||
|
|
||||||
if ($seat_count != 0) {
|
if ($seat_count != 0) {
|
||||||
|
|
|
@ -653,7 +653,7 @@ class License extends Depreciable
|
||||||
{
|
{
|
||||||
return $this->licenseseats()
|
return $this->licenseseats()
|
||||||
->whereNull('deleted_at')
|
->whereNull('deleted_at')
|
||||||
->where('dead', '=', 0)
|
->where('unassignable', '=', false)
|
||||||
->where(function ($query) {
|
->where(function ($query) {
|
||||||
$query->whereNull('assigned_to')
|
$query->whereNull('assigned_to')
|
||||||
->whereNull('asset_id');
|
->whereNull('asset_id');
|
||||||
|
|
|
@ -14,7 +14,7 @@ class LicenseSeatFactory extends Factory
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'license_id' => License::factory(),
|
'license_id' => License::factory(),
|
||||||
'dead' => 0,
|
'dead' => false,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ return new class extends Migration
|
||||||
public function up(): void
|
public function up(): void
|
||||||
{
|
{
|
||||||
Schema::table('license_seats', function (Blueprint $table) {
|
Schema::table('license_seats', function (Blueprint $table) {
|
||||||
$table->addColumn('boolean', 'dead')->default(false)->after('assigned_to');
|
$table->addColumn('boolean', 'unassignable')->default(false)->after('assigned_to');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -23,7 +23,7 @@ return new class extends Migration
|
||||||
public function down(): void
|
public function down(): void
|
||||||
{
|
{
|
||||||
Schema::table('license_seats', function (Blueprint $table) {
|
Schema::table('license_seats', function (Blueprint $table) {
|
||||||
$table->dropColumn('dead');
|
$table->dropColumn('unassignable');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue