1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-18 00:53:10 +01:00

bug fixes

This commit is contained in:
Hillel Coren 2014-02-02 22:13:28 +02:00
parent 968df9409e
commit 3ea3b6462a
3 changed files with 25 additions and 43 deletions

View File

@ -315,9 +315,17 @@ class InvoiceController extends \BaseController {
return InvoiceController::cloneInvoice($publicId);
}
else if ($action == 'email')
{
$this->mailer->sendInvoice($invoice);
Session::flash('message', 'Successfully emailed invoice'.$message);
{
if (Auth::user()->confirmed)
{
$this->mailer->sendInvoice($invoice);
Session::flash('message', 'Successfully emailed invoice'.$message);
}
else
{
Session::flash('message', 'Successfully saved invoice'.$message);
Session::flash('error', 'Please sign up to email an invoice');
}
}
else
{

View File

@ -75,7 +75,17 @@ class UserController extends BaseController {
if( Confide::user() )
{
Event::fire('user.login');
return Redirect::to('/invoices/create');
$invoice = Invoice::scope()->orderBy('id', 'desc')->first();
if ($invoice)
{
return Redirect::to('/invoices/' . $invoice->public_id);
}
else
{
return Redirect::to('/invoices/create');
}
}
else
{

View File

@ -406,37 +406,6 @@
</div>
</div>
<div class="modal fade" id="notSignedUpModal" tabindex="-1" role="dialog" aria-labelledby="notSignedUpModalLabel" aria-hidden="true">
<div class="modal-dialog" style="min-width:150px">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" id="notSignedUpModalLabel">Email Invoice</h4>
</div>
<div style="background-color: #EEEEEE; padding-left: 16px; padding-right: 16px">
<br/>
@if (Auth::user()->registered)
Please confirm your account to email an invoice.
@else
Please sign up to email an invoice.
@endif
<br/>&nbsp;
</div>
<div class="modal-footer" style="margin-top: 0px">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
@if (!Auth::user()->registered)
<button type="button" class="btn btn-primary" onclick="showSignUp()">Sign Up</button>
@endif
</div>
</div>
</div>
</div>
<div class="modal fade" id="recurringModal" tabindex="-1" role="dialog" aria-labelledby="recurringModalLabel" aria-hidden="true">
<div class="modal-dialog" style="min-width:150px">
<div class="modal-content">
@ -469,7 +438,6 @@
<script type="text/javascript">
function showSignUp() {
$('#notSignedUpModal').modal('hide');
$('#signUpModal').modal('show');
}
@ -643,13 +611,9 @@
}
function onEmailClick() {
if ({{ !Auth::user()->confirmed ? 'true' : 'false' }}) {
$('#notSignedUpModal').modal('show');
} else {
if (confirm('Are you sure you want to email this invoice?')) {
$('#action').val('email');
$('.main_form').submit();
}
if (confirm('Are you sure you want to email this invoice?')) {
$('#action').val('email');
$('.main_form').submit();
}
}