mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 11:24:28 -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->email = trim(strtolower(Input::get('email')));
|
||||||
$user->phone = trim(Input::get('phone'));
|
$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 (Utils::isNinja()) {
|
||||||
if (Input::get('referral_code') && !$user->referral_code) {
|
if (Input::get('referral_code') && !$user->referral_code) {
|
||||||
$user->referral_code = $this->accountRepo->getReferralCode();
|
$user->referral_code = $this->accountRepo->getReferralCode();
|
||||||
|
@ -7,22 +7,8 @@
|
|||||||
|
|
||||||
{!! Former::open()->addClass('warn-on-exit') !!}
|
{!! Former::open()->addClass('warn-on-exit') !!}
|
||||||
{{ Former::populate($account) }}
|
{{ 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">
|
@include('accounts.partials.notifications')
|
||||||
<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>
|
|
||||||
|
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<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,22 +74,27 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<center>
|
|
||||||
@if (Auth::user()->confirmed)
|
|
||||||
{!! Button::primary(trans('texts.change_password'))
|
|
||||||
->appendIcon(Icon::create('lock'))
|
|
||||||
->large()->withAttributes(['onclick'=>'showChangePassword()']) !!}
|
|
||||||
@elseif (Auth::user()->registered && Utils::isNinja())
|
|
||||||
{!! Button::primary(trans('texts.resend_confirmation'))
|
|
||||||
->appendIcon(Icon::create('send'))
|
|
||||||
->asLinkTo(URL::to('/resend_confirmation'))->large() !!}
|
|
||||||
@endif
|
|
||||||
{!! Button::success(trans('texts.save'))
|
|
||||||
->submit()->large()
|
|
||||||
->appendIcon(Icon::create('floppy-disk')) !!}
|
|
||||||
</center>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@if ( ! Auth::user()->is_admin)
|
||||||
|
@include('accounts.partials.notifications')
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<center>
|
||||||
|
@if (Auth::user()->confirmed)
|
||||||
|
{!! Button::primary(trans('texts.change_password'))
|
||||||
|
->appendIcon(Icon::create('lock'))
|
||||||
|
->large()->withAttributes(['onclick'=>'showChangePassword()']) !!}
|
||||||
|
@elseif (Auth::user()->registered && Utils::isNinja())
|
||||||
|
{!! Button::primary(trans('texts.resend_confirmation'))
|
||||||
|
->appendIcon(Icon::create('send'))
|
||||||
|
->asLinkTo(URL::to('/resend_confirmation'))->large() !!}
|
||||||
|
@endif
|
||||||
|
{!! Button::success(trans('texts.save'))
|
||||||
|
->submit()->large()
|
||||||
|
->appendIcon(Icon::create('floppy-disk')) !!}
|
||||||
|
</center>
|
||||||
|
|
||||||
<div class="modal fade" id="passwordModal" tabindex="-1" role="dialog" aria-labelledby="passwordModalLabel" aria-hidden="true">
|
<div class="modal fade" id="passwordModal" tabindex="-1" role="dialog" aria-labelledby="passwordModalLabel" aria-hidden="true">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user