1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-13 22:54:25 +01:00

Working on signature feature

This commit is contained in:
Hillel Coren 2016-11-06 13:44:58 +02:00
parent 3ccb33ec21
commit ef44a95902
8 changed files with 30 additions and 11 deletions

View File

@ -249,7 +249,7 @@ class AccountGatewayController extends BaseController
} }
if (!$value && ($field == 'testMode' || $field == 'developerMode')) { if (!$value && ($field == 'testMode' || $field == 'developerMode')) {
// do nothing // do nothing
} elseif ($gatewayId == GATEWAY_CUSTOM && $field == 'text') { } elseif ($gatewayId == GATEWAY_CUSTOM) {
$config->$field = strip_tags($value); $config->$field = strip_tags($value);
} else { } else {
$config->$field = $value; $config->$field = $value;

View File

@ -218,8 +218,7 @@ class InvoiceController extends BaseController
$contact->invitation_viewed = $invitation->viewed_date && $invitation->viewed_date != '0000-00-00 00:00:00' ? $invitation->viewed_date : false; $contact->invitation_viewed = $invitation->viewed_date && $invitation->viewed_date != '0000-00-00 00:00:00' ? $invitation->viewed_date : false;
$contact->invitation_openend = $invitation->opened_date && $invitation->opened_date != '0000-00-00 00:00:00' ? $invitation->opened_date : false; $contact->invitation_openend = $invitation->opened_date && $invitation->opened_date != '0000-00-00 00:00:00' ? $invitation->opened_date : false;
$contact->invitation_status = $contact->email_error ? false : $invitation->getStatus(); $contact->invitation_status = $contact->email_error ? false : $invitation->getStatus();
$contact->invitation_signature_svg = $invitation->signature_base64; $contact->invitation_signature_svg = $invitation->signatureDiv();
$contact->invitation_signature_date = $invitation->signature_date;
} }
} }
} }

View File

@ -134,4 +134,13 @@ class Invitation extends EntityModel
$invoice->markViewed(); $invoice->markViewed();
$client->markLoggedIn(); $client->markLoggedIn();
} }
public function signatureDiv()
{
if ( ! $this->signature_base64) {
return false;
}
return sprintf('<img src="data:image/svg+xml;base64,%s"></img><p/>%s: %s', $this->signature_base64, trans('texts.signed'), Utils::fromSqlDateTime($this->signature_date));
}
} }

View File

@ -821,7 +821,7 @@ class BasePaymentDriver
if ($gatewayTypeId == GATEWAY_TYPE_CUSTOM) { if ($gatewayTypeId == GATEWAY_TYPE_CUSTOM) {
$url = "javascript:showCustomModal();"; $url = "javascript:showCustomModal();";
$label = $this->accountGateway->getConfigField('name'); $label = e($this->accountGateway->getConfigField('name'));
} else { } else {
$url = $this->paymentUrl($gatewayTypeAlias); $url = $this->paymentUrl($gatewayTypeAlias);
$label = trans("texts.{$gatewayTypeAlias}"); $label = trans("texts.{$gatewayTypeAlias}");

View File

@ -2186,8 +2186,10 @@ $LANG = array(
'require_invoice_signature_help' => 'Require client to provide their signature.', 'require_invoice_signature_help' => 'Require client to provide their signature.',
'require_quote_signature' => 'Quote Signature', 'require_quote_signature' => 'Quote Signature',
'require_quote_signature_help' => 'Require client to provide their signature.', 'require_quote_signature_help' => 'Require client to provide their signature.',
'i_agree' => 'I Agree To The Terms & Conditions', 'i_agree' => 'I Agree To The Terms',
'sign_here' => 'Please sign here:', 'sign_here' => 'Please sign here:',
'authorization' => 'Authorization',
'signed' => 'Signed',
); );

View File

@ -65,7 +65,7 @@
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<h3 class="panel-title">{!! trans('texts.authentication') !!}</h3> <h3 class="panel-title">{!! trans('texts.authorization') !!}</h3>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<div role="tabpanel"> <div role="tabpanel">

View File

@ -28,6 +28,13 @@
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;
} }
.signature-wrapper .tooltip-inner {
width: 600px;
max-width: 600px;
padding: 20px;
}
</style> </style>
@stop @stop
@ -125,8 +132,10 @@
<span style="vertical-align:text-top" class="fa fa-info-circle" <span style="vertical-align:text-top" class="fa fa-info-circle"
data-bind="visible: $data.invitation_status, tooltip: {title: $data.invitation_status, html: true}, data-bind="visible: $data.invitation_status, tooltip: {title: $data.invitation_status, html: true},
style: {color: $data.info_color}"></span> style: {color: $data.info_color}"></span>
<span style="vertical-align:text-top" class="fa fa-user-circle" <span class="signature-wrapper">&nbsp;
data-bind="visible: $data.invitation_signature_svg, tooltip: {title: '', html: true}"></span> <span style="vertical-align:text-top;color:#888" class="fa fa-user"
data-bind="visible: $data.invitation_signature_svg, tooltip: {title: $data.invitation_signature_svg, html: true}"></span>
</span>
@endif @endif
</span> </span>
@endif @endif

View File

@ -116,7 +116,7 @@
@if ($showApprove) @if ($showApprove)
{!! Button::success(trans('texts.approve'))->asLinkTo(URL::to('/approve/' . $invitation->invitation_key))->large() !!} {!! Button::success(trans('texts.approve'))->asLinkTo(URL::to('/approve/' . $invitation->invitation_key))->large() !!}
@endif @endif
@elseif ($invoice->client->account->isGatewayConfigured() && !$invoice->isPaid() && !$invoice->is_recurring) @elseif ($invoice->client->account->isGatewayConfigured() && floatval($invoice->balance) && !$invoice->is_recurring)
{!! Button::normal(trans('texts.download_pdf'))->withAttributes(['onclick' => 'onDownloadClick()'])->large() !!}&nbsp;&nbsp; {!! Button::normal(trans('texts.download_pdf'))->withAttributes(['onclick' => 'onDownloadClick()'])->large() !!}&nbsp;&nbsp;
@if (count($paymentTypes) > 1) @if (count($paymentTypes) > 1)
{!! DropdownButton::success(trans('texts.pay_now'))->withContents($paymentTypes)->large() !!} {!! DropdownButton::success(trans('texts.pay_now'))->withContents($paymentTypes)->large() !!}
@ -319,11 +319,11 @@
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title">&nbsp;</h4> <h4 class="modal-title">{{ trans('texts.authorization') }}</h4>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<div class="well"> <div class="well" style="max-height:300px;overflow-y:scroll">
{!! nl2br(e($invoice->terms)) !!} {!! nl2br(e($invoice->terms)) !!}
</div> </div>
@if ($account->showSignature($invoice)) @if ($account->showSignature($invoice))