disable invoices by default || full frontend roles shown

This commit is contained in:
Dennis 2023-05-03 16:17:31 +02:00 committed by GitHub
commit 88bb1395ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 25 additions and 56 deletions

View file

@ -101,6 +101,8 @@ class MakeUserCommand extends Command
['Referral code', $user->referral_code],
]);
$user->syncRoles(1);
return 1;
}
}

View file

@ -104,7 +104,7 @@ class ExtensionHelper
if (!(basename($extension) == $extensionName)) {
continue;
}
$extension = str_replace('/', '\\', $extension);
$extensionClass = $extension . '\\' . $extensionName . 'Extension';
return $extensionClass;
}

View file

@ -18,7 +18,7 @@ class isMod
*/
public function handle(Request $request, Closure $next)
{
if (Auth::user() && Auth::user()->role == 'moderator' || Auth::user() && Auth::user()->hasRole("Admin")) {
if (Auth::user() && Auth::user()->role == 'moderator' || Auth::user() && Auth::user()->hasRole(1)) {
return $next($request);
}

View file

@ -79,8 +79,8 @@ class UserPayment
}
}
//update role give Referral-reward
if ($user->role == 'member') {
$user->update(['role' => 'client']);
if ($user->hasRole(4)) {
$user->syncRoles(3);
//give referral commission only on first purchase
if (($this->referral_mode === "commission" || $this->referral_mode === "both") && $shopProduct->type == "Credits" && !$this->referral_always_give_commission) {

View file

@ -16,7 +16,7 @@ class CreateInvoiceSettings extends SettingsMigration
$this->migrator->add('invoice.company_phone', $table_exists ? $this->getOldValue('SETTINGS::INVOICE:COMPANY_PHONE') : '');
$this->migrator->add('invoice.company_vat', $table_exists ? $this->getOldValue('SETTINGS::INVOICE:COMPANY_VAT') : '');
$this->migrator->add('invoice.company_website', $table_exists ? $this->getOldValue('SETTINGS::INVOICE:COMPANY_WEBSITE') : '');
$this->migrator->add('invoice.enabled', $table_exists ? $this->getOldValue('SETTINGS::INVOICE:ENABLED') : true);
$this->migrator->add('invoice.enabled', $table_exists ? $this->getOldValue('SETTINGS::INVOICE:ENABLED') : false);
$this->migrator->add('invoice.prefix', $table_exists ? $this->getOldValue('SETTINGS::INVOICE:PREFIX') : 'INV');
}

View file

@ -113,7 +113,7 @@ Route::middleware(['auth', 'checkSuspended'])->group(function () {
Route::post('ticket/new', [TicketsController::class, 'store'])->middleware(['throttle:ticket-new'])->name('ticket.new.store');
Route::get('ticket/show/{ticket_id}', [TicketsController::class, 'show'])->name('ticket.show');
Route::post('ticket/reply', [TicketsController::class, 'reply'])->middleware(['throttle:ticket-reply'])->name('ticket.reply');
Route::post('ticket/close/{ticket_id}', [TicketsController::class, 'close'])->name('ticket.close');
Route::post('ticket/status/{ticket_id}', [TicketsController::class, 'changeStatus'])->name('ticket.changeStatus');
//admin

View file

@ -74,18 +74,9 @@
<label>{{ __('Role') }}</label>
</div>
<div class="col-lg-8">
<span style="max-width: 250px;"
class="d-inline-block text-truncate badge
@if ($user->hasRole("Admin")) badge-danger
@elseif ($user->role == 'moderator')
badge-info
@elseif ($user->role == 'client')
badge-success
@else
badge-secondary @endif
">
{{ $user->role }}
</span>
@foreach ($user->roles as $role)
<span style='background-color: {{$role->color}}' class='badge'>{{$role->name}}</span>
@endforeach
</div>
</div>
</div>

View file

@ -112,15 +112,9 @@
src="https://www.gravatar.com/avatar/{{ md5(strtolower($ticket->user->email)) }}?s=25"
class="user-image" alt="User Image">
<a href="/admin/users/{{$ticket->user->id}}">{{ $ticket->user->name }}</a>
@if($ticket->user->role === "member")
<span class="badge badge-secondary"> Member </span>
@elseif ($ticket->user->role === "client")
<span class="badge badge-success"> Client </span>
@elseif ($ticket->user->role === "moderator")
<span class="badge badge-info"> Moderator </span>
@elseif ($ticket->user->hasRole("Admin"))
<span class="badge badge-danger"> Admin </span>
@endif
@foreach ($ticket->user->roles as $role)
<span style='background-color: {{$role->color}}' class='badge'>{{$role->name}}</span>
@endforeach
</h5>
<span class="badge badge-primary">{{ $ticket->created_at->diffForHumans() }}</span>
</div>
@ -135,15 +129,9 @@
src="https://www.gravatar.com/avatar/{{ md5(strtolower($ticketcomment->user->email)) }}?s=25"
class="user-image" alt="User Image">
<a href="/admin/users/{{$ticketcomment->user->id}}">{{ $ticketcomment->user->name }}</a>
@if($ticketcomment->user->role === "member")
<span class="badge badge-secondary"> Member </span>
@elseif ($ticketcomment->user->role === "client")
<span class="badge badge-success"> Client </span>
@elseif ($ticketcomment->user->role === "moderator")
<span class="badge badge-info"> Moderator </span>
@elseif ($ticketcomment->user->hasRole("Admin"))
<span class="badge badge-danger"> Admin </span>
@endif
@foreach ($ticketcomment->user->roles as $role)
<span style='background-color: {{$role->color}}' class='badge'>{{$role->name}}</span>
@endforeach
</h5>
<span class="badge badge-primary">{{ $ticketcomment->created_at->diffForHumans() }}</span>
</div>

View file

@ -112,15 +112,9 @@
src="https://www.gravatar.com/avatar/{{ md5(strtolower($ticket->user->email)) }}?s=25"
class="user-image" alt="User Image">
<a href="/admin/users/{{$ticket->user->id}}">{{ $ticket->user->name }} </a>
@if($ticket->user->role === "member")
<span class="badge badge-secondary"> Member </span>
@elseif ($ticket->user->role === "client")
<span class="badge badge-success"> Client </span>
@elseif ($ticket->user->role === "moderator")
<span class="badge badge-info"> Moderator </span>
@elseif ($ticket->user->hasRole("Admin"))
<span class="badge badge-danger"> Admin </span>
@endif
@foreach ($ticket->user->roles as $role)
<span style='background-color: {{$role->color}}' class='badge'>{{$role->name}}</span>
@endforeach
</h5>
<span
class="badge badge-primary">{{ $ticket->created_at->diffForHumans() }}</span>
@ -136,15 +130,9 @@
src="https://www.gravatar.com/avatar/{{ md5(strtolower($ticketcomment->user->email)) }}?s=25"
class="user-image" alt="User Image">
<a href="/admin/users/{{$ticketcomment->user->id}}">{{ $ticketcomment->user->name }}</a>
@if($ticketcomment->user->role === "member")
<span class="badge badge-secondary"> Member </span>
@elseif ($ticketcomment->user->role === "client")
<span class="badge badge-success"> Client </span>
@elseif ($ticketcomment->user->role === "moderator")
<span class="badge badge-info"> Moderator </span>
@elseif ($ticketcomment->user->hasRole("Admin"))
<span class="badge badge-danger"> Admin </span>
@endif
@foreach ($ticketcomment->user->roles as $role)
<span style='background-color: {{$role->color}}' class='badge'>{{$role->name}}</span>
@endforeach
</h5>
<span
class="badge badge-primary">{{ $ticketcomment->created_at->diffForHumans() }}</span>