Merge pull request #503 from 1day2die/development

enable/disable Ticketsystem
This commit is contained in:
Dennis 2022-08-03 11:33:07 +02:00 committed by GitHub
commit ebf8902870
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 8 deletions

View file

@ -42,6 +42,7 @@ class Misc
'referral_allowed' => 'nullable|string',
'referral_percentage' => 'nullable|numeric',
'referral_mode' => 'nullable|string',
'ticket_enabled' => 'nullable|string',
]);
if ($validator->fails()) {
@ -78,7 +79,8 @@ class Misc
"SETTINGS::REFERRAL::REWARD" => "referral_reward",
"SETTINGS::REFERRAL::ALLOWED" => "referral_allowed",
"SETTINGS::REFERRAL:MODE" => "referral_mode",
"SETTINGS::REFERRAL:PERCENTAGE" => "referral_percentage"
"SETTINGS::REFERRAL:PERCENTAGE" => "referral_percentage",
"SETTINGS::TICKET:ENABLED" => "ticket_enabled"
];

View file

@ -187,7 +187,7 @@
<div class="col-md-3 px-3">
<div class="row mb-2">
<div class="col text-center">
<h1>Referral</h1>
<h1>Referral System</h1>
</div>
</div>
@ -249,6 +249,21 @@
@endif>{{ __("Clients") }}</option>
</select>
</div>
<div class="row mb-2">
<div class="col text-center">
<h1>Ticket System</h1>
</div>
</div>
<div class="custom-control mb-3 p-0">
<div class="col m-0 p-0 d-flex justify-content-between align-items-center">
<div>
<input value="true" id="ticket_enabled" name="ticket_enabled"
{{ config('SETTINGS::TICKET:ENABLED') == 'true' ? 'checked' : '' }}
type="checkbox">
<label for="ticket_enabled">{{ __('Enable Ticketsystem') }} </label>
</div>
</div>
</div>
</div>
</div>

View file

@ -225,14 +225,16 @@
</a>
</li>
@endif
@if(config("SETTINGS::TICKET:ENABLED"))
<li class="nav-item">
<a href="{{ route('ticket.index') }}" class="nav-link @if (Request::routeIs('ticket.*')) active @endif">
<i class="nav-icon fas fas fa-ticket-alt"></i>
<p>{{ __('Support Ticket') }}</p>
</a>
</li>
@endif
@if (Auth::user()->role == 'admin' || Auth::user()->role == 'moderator')
@if ((Auth::user()->role == 'admin' || Auth::user()->role == 'moderator') && config("SETTINGS::TICKET:ENABLED"))
<li class="nav-header">{{ __('Moderation') }}</li>
<li class="nav-item">

View file

@ -93,11 +93,13 @@ Route::middleware(['auth', 'checkSuspended'])->group(function () {
Route::post('changelocale', [TranslationController::class, 'changeLocale'])->name('changeLocale');
#ticket user
if(config("SETTINGS::TICKET:ENABLED")) {
Route::get('ticket', [TicketsController::class, 'index'])->name('ticket.index');
Route::get('ticket/new', [TicketsController::class, 'create'])->name('ticket.new');
Route::post('ticket/new', [TicketsController::class, 'store'])->name('ticket.new.store');
Route::get('ticket/show/{ticket_id}', [TicketsController::class, 'show'])->name('ticket.show');
Route::post('ticket/reply', [TicketsController::class, 'reply'])->name('ticket.reply');
}
#admin
Route::prefix('admin')->name('admin.')->middleware('admin')->group(function () {