1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 08:21:34 +02:00

Added custom labels to email variables

This commit is contained in:
Hillel Coren 2015-12-23 16:21:48 +02:00
parent 3f1891fa3b
commit c0409b86fd
4 changed files with 26 additions and 5 deletions

View File

@ -381,7 +381,7 @@ class PaymentController extends BaseController
if ($validator->fails()) {
return Redirect::to('payment/'.$invitationKey)
->withErrors($validator)
->withInput();
->withInput(Request::except('cvv'));
}
if ($accountGateway->update_address) {
@ -422,7 +422,8 @@ class PaymentController extends BaseController
$details['customerReference'] = $token;
} else {
$this->error('Token-No-Ref', $this->paymentService->lastError, $accountGateway);
return Redirect::to('payment/'.$invitationKey)->withInput();
return Redirect::to('payment/'.$invitationKey)
->withInput(Request::except('cvv'));
}
}
}
@ -443,7 +444,8 @@ class PaymentController extends BaseController
$this->error('No-Ref', $response->getMessage(), $accountGateway);
if ($onSite) {
return Redirect::to('payment/'.$invitationKey)->withInput();
return Redirect::to('payment/'.$invitationKey)
->withInput(Request::except('cvv'));
} else {
return Redirect::to('view/'.$invitationKey);
}
@ -472,7 +474,7 @@ class PaymentController extends BaseController
} catch (\Exception $e) {
$this->error('Uncaught', false, $accountGateway, $e);
if ($onSite) {
return Redirect::to('payment/'.$invitationKey)->withInput();
return Redirect::to('payment/'.$invitationKey)->withInput(Request::except('cvv'));
} else {
return Redirect::to('view/'.$invitationKey);
}

View File

@ -240,6 +240,10 @@ class ContactMailer extends Mailer
'$viewButton' => HTML::emailViewButton($invitation->getLink(), $invoice->getEntityType()),
'$paymentLink' => $invitation->getLink('payment'),
'$paymentButton' => HTML::emailPaymentButton($invitation->getLink('payment')),
'$customClient1' => $account->custom_client_label1,
'$customClient2' => $account->custom_client_label2,
'$customInvoice1' => $account->custom_invoice_text_label1,
'$customInvoice2' => $account->custom_invoice_text_label2,
];
// Add variables for available payment types

View File

@ -99,6 +99,18 @@
@foreach (\App\Ninja\Mailers\ContactMailer::$variableFields as $field)
<li>${{ $field }}</li>
@endforeach
@if ($account->custom_client_label1)
<li>$customClient1</li>
@endif
@if ($account->custom_client_label2)
<li>$customClient2</li>
@endif
@if ($account->custom_invoice_text_label1)
<li>$customInvoice1</li>
@endif
@if ($account->custom_invoice_text_label2)
<li>$customInvoice1</li>
@endif
@if (count($account->account_gateways) > 1)
@foreach (\App\Models\Gateway::$paymentTypes as $type)
@if ($account->getGatewayByType($type))
@ -198,6 +210,10 @@
'{!! HTML::flatButton('pay_now', '#36c157') !!}',
];
// Add blanks for custom values
keys.push('customClient1', 'customClient2', 'customInvoice1', 'customInvoice2');
vals.push('custom value', 'custom value', 'custom value', 'custom value');
// Add any available payment method links
@foreach (\App\Models\Gateway::$paymentTypes as $type)
{!! "keys.push('" . \App\Models\Gateway::getPaymentTypeName($type).'Link' . "');" !!}

View File

@ -188,7 +188,6 @@
<tr data-bind="event: { mouseover: showActions, mouseout: hideActions }" class="sortable-row">
<td class="hide-border td-icon">
<i style="display:none" data-bind="visible: actionsVisible() &amp;&amp;
$index() < ($parent.invoice_items().length - 1) &amp;&amp;
$parent.invoice_items().length > 1" class="fa fa-sort"></i>
</td>
<td>