mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 08:14:44 -04:00
Enable non-admins to set notification preferences
This commit is contained in:
parent
f5ce8c325a
commit
01439a0f43
@ -1220,6 +1220,13 @@ class AccountController extends BaseController
|
||||
$user->email = trim(strtolower(Input::get('email')));
|
||||
$user->phone = trim(Input::get('phone'));
|
||||
|
||||
if ( ! Auth::user()->is_admin) {
|
||||
$user->notify_sent = Input::get('notify_sent');
|
||||
$user->notify_viewed = Input::get('notify_viewed');
|
||||
$user->notify_paid = Input::get('notify_paid');
|
||||
$user->notify_approved = Input::get('notify_approved');
|
||||
}
|
||||
|
||||
if (Utils::isNinja()) {
|
||||
if (Input::get('referral_code') && !$user->referral_code) {
|
||||
$user->referral_code = $this->accountRepo->getReferralCode();
|
||||
|
@ -7,22 +7,8 @@
|
||||
|
||||
{!! Former::open()->addClass('warn-on-exit') !!}
|
||||
{{ Former::populate($account) }}
|
||||
{{ Former::populateField('notify_sent', intval(Auth::user()->notify_sent)) }}
|
||||
{{ Former::populateField('notify_viewed', intval(Auth::user()->notify_viewed)) }}
|
||||
{{ Former::populateField('notify_paid', intval(Auth::user()->notify_paid)) }}
|
||||
{{ Former::populateField('notify_approved', intval(Auth::user()->notify_approved)) }}
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">{!! trans('texts.email_notifications') !!}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
{!! Former::checkbox('notify_sent')->label(' ')->text(trans('texts.email_sent')) !!}
|
||||
{!! Former::checkbox('notify_viewed')->label(' ')->text(trans('texts.email_viewed')) !!}
|
||||
{!! Former::checkbox('notify_paid')->label(' ')->text(trans('texts.email_paid')) !!}
|
||||
{!! Former::checkbox('notify_approved')->label(' ')->text(trans('texts.email_approved')) !!}
|
||||
</div>
|
||||
</div>
|
||||
@include('accounts.partials.notifications')
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
|
16
resources/views/accounts/partials/notifications.blade.php
Normal file
16
resources/views/accounts/partials/notifications.blade.php
Normal file
@ -0,0 +1,16 @@
|
||||
{{ Former::populateField('notify_sent', intval(Auth::user()->notify_sent)) }}
|
||||
{{ Former::populateField('notify_viewed', intval(Auth::user()->notify_viewed)) }}
|
||||
{{ Former::populateField('notify_paid', intval(Auth::user()->notify_paid)) }}
|
||||
{{ Former::populateField('notify_approved', intval(Auth::user()->notify_approved)) }}
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">{!! trans('texts.email_notifications') !!}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
{!! Former::checkbox('notify_sent')->label(' ')->text(trans('texts.email_sent')) !!}
|
||||
{!! Former::checkbox('notify_viewed')->label(' ')->text(trans('texts.email_viewed')) !!}
|
||||
{!! Former::checkbox('notify_paid')->label(' ')->text(trans('texts.email_paid')) !!}
|
||||
{!! Former::checkbox('notify_approved')->label(' ')->text(trans('texts.email_approved')) !!}
|
||||
</div>
|
||||
</div>
|
@ -74,6 +74,12 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if ( ! Auth::user()->is_admin)
|
||||
@include('accounts.partials.notifications')
|
||||
@endif
|
||||
|
||||
<center>
|
||||
@if (Auth::user()->confirmed)
|
||||
{!! Button::primary(trans('texts.change_password'))
|
||||
@ -88,7 +94,6 @@
|
||||
->submit()->large()
|
||||
->appendIcon(Icon::create('floppy-disk')) !!}
|
||||
</center>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="passwordModal" tabindex="-1" role="dialog" aria-labelledby="passwordModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
|
Loading…
x
Reference in New Issue
Block a user