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

Proposals

This commit is contained in:
Hillel Coren 2018-02-13 09:15:14 +02:00
parent 91e8426e86
commit 59ec838b88
5 changed files with 21 additions and 4 deletions

View File

@ -4,6 +4,7 @@ namespace App\Http\Controllers;
use App\Events\InvoiceInvitationWasViewed;
use App\Events\QuoteInvitationWasViewed;
use App\Models\Account;
use App\Models\Contact;
use App\Models\Document;
use App\Models\Gateway;
@ -835,6 +836,16 @@ class ClientPortalController extends BaseController
}, 200);
}
/*
public function getProposalDocument($accountKey, $publicId)
{
$account = Account::whereAccountKey($accountKey)->firstOrFail();
$document = Document::whereAccountId($account->id)->wherePublicId($publicId)->firstOrFail();
return DocumentController::getDownloadResponse($document);
}
*/
public function getDocument($invitationKey, $publicId)
{
if (! $invitation = $this->invoiceRepo->findInvoiceByInvitation($invitationKey)) {

View File

@ -168,7 +168,11 @@ class ProposalController extends BaseController
$proposal = $request->entity();
$mpdf = new mPDF();
$mpdf->showImageErrors = true;
$mpdf->WriteHTML($proposal->present()->htmlDocument);
//$mpdf->Output();
$mpdf->Output($proposal->present()->filename, 'D');
}
}

View File

@ -239,9 +239,11 @@
<script type="text/javascript">
$(function() {
grapesjsEditor.on('canvas:drop', function() {
var html = mergeTemplate(grapesjsEditor.getHtml());
grapesjsEditor.setComponents(html);
grapesjsEditor.on('canvas:drop', function(event, block) {
if (! block.attributes || block.attributes.type != 'image') {
var html = mergeTemplate(grapesjsEditor.getHtml());
grapesjsEditor.setComponents(html);
}
});
@if (! $proposal && $templatePublicId)

View File

@ -7,7 +7,6 @@ $(function() {
components: '{!! $entity ? $entity->html : '' !!}',
style: '{!! $entity ? $entity->css : '' !!}',
showDevices: false,
categoryLabel: 'tes',
plugins: ['gjs-preset-newsletter'],
pluginsOpts: {
'gjs-preset-newsletter': {

View File

@ -18,6 +18,7 @@ Route::group(['middleware' => ['lookup:contact', 'auth:client']], function () {
Route::get('view/{invitation_key}', 'ClientPortalController@viewInvoice');
Route::get('proposal/{proposal_invitation_key}/download', 'ClientPortalController@downloadProposal');
Route::get('proposal/{proposal_invitation_key}', 'ClientPortalController@viewProposal');
//Route::get('proposal/document/{account_key}/{public_id}/{filename?}', 'ClientPortalController@getProposalDocument');
Route::get('download/{invitation_key}', 'ClientPortalController@download');
Route::put('sign/{invitation_key}', 'ClientPortalController@sign');
Route::get('view', 'HomeController@viewLogo');