1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-12 14:12:44 +01:00

Minor bug fixes

This commit is contained in:
Hillel Coren 2014-11-11 10:29:43 +02:00
parent 6fc91d165e
commit 8317b0349f
5 changed files with 25 additions and 17 deletions

View File

@ -912,7 +912,10 @@ class AccountController extends \BaseController {
$user->registered = true;
$user->amend();
$this->userMailer->sendConfirmation($user);
if (Utils::isNinja())
{
$this->userMailer->sendConfirmation($user);
}
$activities = Activity::scope()->get();
foreach ($activities as $activity)

View File

@ -18,6 +18,7 @@ class ContactMailer extends Mailer {
$view = 'invoice';
$subject = trans("texts.{$entityType}_subject", ['invoice' => $invoice->invoice_number, 'account' => $invoice->account->getDisplayName()]);
$accountName = $invoice->account->getDisplayName();
foreach ($invoice->invitations as $invitation)
{
@ -33,17 +34,15 @@ class ContactMailer extends Mailer {
'entityType' => $entityType,
'link' => $invitation->getLink(),
'clientName' => $invoice->client->getDisplayName(),
'accountName' => $invoice->account->getDisplayName(),
'accountName' => $accountName,
'contactName' => $invitation->contact->getDisplayName(),
'invoiceAmount' => Utils::formatMoney($invoice->amount, $invoice->client->currency_id),
'emailFooter' => $invoice->account->email_footer,
'showNinjaFooter' => !$invoice->account->isPro()
];
$fromEmail = $invitation->user->email;
$fromName = $invitation->user->getDisplayName();
$this->sendTo($invitation->contact->email, $fromEmail, $fromName, $subject, $view, $data);
$fromEmail = $invitation->user->email;
$this->sendTo($invitation->contact->email, $fromEmail, $accountName, $subject, $view, $data);
Activity::emailInvoice($invitation);
}
@ -61,9 +60,10 @@ class ContactMailer extends Mailer {
{
$view = 'payment_confirmation';
$subject = trans('texts.payment_subject', ['invoice' => $payment->invoice->invoice_number]);
$accountName = $payment->account->getDisplayName();
$data = [
'accountName' => $payment->account->getDisplayName(),
'accountName' => $accountName,
'clientName' => $payment->client->getDisplayName(),
'emailFooter' => $payment->account->email_footer,
'paymentAmount' => Utils::formatMoney($payment->amount, $payment->client->currency_id),
@ -71,7 +71,7 @@ class ContactMailer extends Mailer {
];
$user = $payment->invitation->user;
$this->sendTo($payment->contact->email, $user->email, $user->getDisplayName(), $subject, $view, $data);
$this->sendTo($payment->contact->email, $user->email, $accountName, $subject, $view, $data);
}
public function sendLicensePaymentConfirmation($name, $email, $amount, $license, $productId)

View File

@ -12,6 +12,7 @@ use Invitation;
use Invoice;
use InvoiceItem;
use AccountGateway;
use Utils;
class AccountRepository
{
@ -38,6 +39,7 @@ class AccountRepository
$user->password = $random;
$user->password_confirmation = $random;
$user->username = $random;
$user->confirmed = !Utils::isNinja();
$account->users()->save($user, []);
return $account;

View File

@ -12,7 +12,7 @@
@if ($product)
{{ Former::populate($product) }}
{{ Former::populateField('cost', number_format($product->cost, 2)) }}
{{ Former::populateField('cost', number_format($product->cost, 2, '.', '')) }}
@endif
{{ Former::text('product_key')->label('texts.product') }}

View File

@ -255,7 +255,6 @@ Want something changed? We're {{ link_to('https://github.com/hillelcoren/invoice
<center><div id="errorTaken" style="display:none">&nbsp;<br/>{{ trans('texts.email_taken') }}</div></center>
<br/>
</div>
<div style="padding-left:40px;padding-right:40px;display:none;min-height:130px" id="working">
@ -268,12 +267,13 @@ Want something changed? We're {{ link_to('https://github.com/hillelcoren/invoice
<div style="background-color: #fff; padding-right:20px;padding-left:20px; display:none" id="signUpSuccessDiv">
<br/>
<h3>{{ trans('texts.success') }}</h3>
{{ trans('texts.success_message') }}<br/>&nbsp;
@if (Utils::isNinja())
{{ trans('texts.success_message') }}<br/>&nbsp;
@endif
</div>
<div class="modal-footer" id="signUpFooter" style="margin-top: 0px">
<button type="button" class="btn btn-default" data-dismiss="modal">{{ trans('texts.close') }} <i class="glyphicon glyphicon-remove-circle"></i></button>
<button type="button" class="btn btn-default" id="closeSignUpButton" data-dismiss="modal">{{ trans('texts.close') }} <i class="glyphicon glyphicon-remove-circle"></i></button>
<button type="button" class="btn btn-primary" id="saveSignUpButton" onclick="validateServerSignUp()" disabled>{{ trans('texts.save') }} <i class="glyphicon glyphicon-floppy-disk"></i></button>
</div>
</div>
@ -454,12 +454,10 @@ Want something changed? We're {{ link_to('https://github.com/hillelcoren/invoice
localStorage.setItem('guest_key', '');
trackUrl('/signed_up');
NINJA.isRegistered = true;
/*
$('#signUpButton').hide();
$('#myAccountButton').html(result);
*/
$('#myAccountButton').html(result);
}
$('#signUpSuccessDiv, #signUpFooter').show();
$('#signUpSuccessDiv, #signUpFooter, #closeSignUpButton').show();
$('#working, #saveSignUpButton').hide();
}
});
@ -577,6 +575,11 @@ Want something changed? We're {{ link_to('https://github.com/hillelcoren/invoice
})
@endif
@if (Auth::check() && !Utils::isNinja() && !Auth::user()->registered)
$('#closeSignUpButton').hide();
showSignUp();
@endif
@yield('onReady')
});