Skip to content

A free open source IT asset/license management system

missed a few renames

Godfrey M7ce230fadcb4
diff --git a/app/Console/Commands/CheckoutLicenseToAllUsers.php b/app/Console/Commands/CheckoutLicenseToAllUsers.php
index 44ec72e13c..1ba57895c2 100644
--- a/app/Console/Commands/CheckoutLicenseToAllUsers.php
+++ b/app/Console/Commands/CheckoutLicenseToAllUsers.php
@@ -56,7 +56,7 @@ class CheckoutLicenseToAllUsers extends Command
return false;
}
- $users = User::whereNull('deleted_at')->where('should_autoassign', '==', 0)->with('licenses')->get();
+ $users = User::whereNull('deleted_at')->where('autoassign_licenses', '==', 1)->with('licenses')->get();
if ($users->count() > $license->getAvailSeatsCountAttribute()) {
$this->info('You do not have enough free seats to complete this task, so we will check out as many as we can. ');
diff --git a/app/Http/Controllers/Users/UsersController.php b/app/Http/Controllers/Users/UsersController.php
index b863fb966b..eecce0aea6 100755
--- a/app/Http/Controllers/Users/UsersController.php
+++ b/app/Http/Controllers/Users/UsersController.php
@@ -121,7 +121,7 @@ class UsersController extends Controller
$user->created_by = Auth::user()->id;
$user->start_date = $request->input('start_date', null);
$user->end_date = $request->input('end_date', null);
- $user->should_autoassign= $request->input('should_autoassign', 0);
+ $user->autoassign_licenses= $request->input('autoassign_licenses', 1);
// Strip out the superuser permission if the user isn't a superadmin
$permissions_array = $request->input('permission');
@@ -275,7 +275,7 @@ class UsersController extends Controller
$user->website = $request->input('website', null);
$user->start_date = $request->input('start_date', null);
$user->end_date = $request->input('end_date', null);
- $user->should_autoassign = $request->input('should_autoassign', 0);
+ $user->autoassign_licenses = $request->input('autoassign_licenses', 1);
// Update the location of any assets checked out to this user
Asset::where('assigned_type', User::class)
diff --git a/database/migrations/2022_11_15_232525_adds_should_autoassign_bool_to_users_table.php b/database/migrations/2022_11_15_232525_adds_should_autoassign_bool_to_users_table.php
index 854feebfea..b728e1f22b 100644
--- a/database/migrations/2022_11_15_232525_adds_should_autoassign_bool_to_users_table.php
+++ b/database/migrations/2022_11_15_232525_adds_should_autoassign_bool_to_users_table.php
@@ -26,7 +26,7 @@ class AddsShouldAutoassignBoolToUsersTable extends Migration
public function down()
{
Schema::table('users', function (Blueprint $table) {
- $table->dropColumn('should_autoassign');
+ $table->dropColumn('autoassign_licenses');
});
}
}
diff --git a/resources/views/users/edit.blade.php b/resources/views/users/edit.blade.php
index 7126428607..e4666a4d0c 100755
--- a/resources/views/users/edit.blade.php
+++ b/resources/views/users/edit.blade.php
@@ -379,8 +379,8 @@
<!-- Auto Assign checkbox -->
<div class="form-group">
<div class="col-md-7 col-md-offset-3">
- <label for="should_autoassign">
- <input type="checkbox" value="1" name="should_autoassign" class="minimal" {{ (old('should_autoassign', $user->should_autoassign)) == '1' ? ' checked="checked"' : '' }} aria-label="should_autoassign">
+ <label for="autoassign_licenses">
+ <input type="checkbox" value="1" name="autoassign_licenses" class="minimal" {{ (old('autoassign_licenses', $user->autoassign_licenses)) == '1' ? ' checked="checked"' : '' }} aria-label="autoassign_licenses">
{{ trans('admin/users/general.auto_assign_label') }}
</label>