Add option to allow or disable profile updates

This commit is contained in:
David Bomba 2025-02-14 07:40:43 +11:00
parent 3ea7ae242c
commit 75b4c0a165
5 changed files with 11 additions and 3 deletions

View File

@ -523,7 +523,10 @@ class CompanySettings extends BaseSettings
public string $email_subject_payment_failed = '';
public string $email_template_payment_failed = '';
public bool $enable_client_profile_update = true;
public static $casts = [
'enable_client_profile_update' => 'bool',
'merge_e_invoice_to_pdf' => 'bool',
'payment_flow' => 'string',
'enable_quote_reminder1' => 'bool',

View File

@ -30,6 +30,10 @@ class ProfileController extends Controller
*/
public function edit(ClientContact $client_contact)
{
if (auth()->guard('contact')->user()->client->getSetting('enable_client_profile_update') === false) {
return redirect()->route('client.dashboard');
}
return $this->render('profile.index');
}

View File

@ -2802,7 +2802,7 @@ Sobald Sie die Beträge erhalten haben, kommen Sie bitte wieder zurück zu diese
'gateway_fee_description' => 'Gateway-Gebühren Zuschlag',
'gateway_fee_discount_description' => 'Gateway-Gebühren Nachlass',
'show_payments' => 'Zeige Zahlungen',
'show_aging' => 'Zeige Zeiterfassung',
'show_aging' => 'Zeige Abrechnungszeitraum',
'reference' => 'Referenz',
'amount_paid' => 'Bezahlter Betrag',
'send_notifications_for' => 'Benachrichtigungen senden für',

View File

@ -4974,7 +4974,7 @@ $lang = array(
'e_invoice' => 'E-Invoice',
'light_dark_mode' => 'Light/Dark Mode',
'activities' => 'Activities',
'recent_transactions' => "Here are your company's most recent transactions:",
'recent_transactions' => "Recent Transactions",
'country_Palestine' => "Palestine",
'country_Taiwan' => 'Taiwan',
'duties' => 'Duties',

View File

@ -49,12 +49,13 @@
x-transition:leave-end="transform opacity-0 scale-95"
class="origin-top-right absolute right-0 mt-2 w-48 rounded-md shadow-lg">
<div class="py-1 rounded-md bg-white ring-1 ring-black ring-opacity-5">
@if(auth()->guard('contact')->user()->client->getSetting('enable_client_profile_update'))
<a data-ref="client-profile-dropdown-settings"
href="{{ route('client.profile.edit', ['client_contact' => auth()->guard('contact')->user()->hashed_id]) }}"
class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 transition ease-in-out duration-150">
{{ ctrans('texts.profile') }}
</a>
@endif
<a href="{{ route('client.logout') }}"
class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 transition ease-in-out duration-150">
{{ ctrans('texts.logout') }}