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

Hide draft invoices from the client portal

This commit is contained in:
Hillel Coren 2016-12-05 10:32:18 +02:00
parent 78a2a66729
commit 455e4ac936
6 changed files with 28 additions and 16 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -185,5 +185,13 @@ table td {
border-top-left-radius: 3px;
}
.dt-right,
.dt-left {
margin-top: 16px;
}
.pagination>ul {
margin: 0px;
}
/* hide table sorting indicators */
table.data-table thead .sorting { background: url('') no-repeat center right; }

View File

@ -184,6 +184,8 @@
->render('datatable') !!}
</div>
<p>&nbsp;</p>
</div>
@stop

View File

@ -557,7 +557,7 @@
@if ($invoice->isSent())
{!! Button::success(trans("texts.save_{$entityType}"))->withAttributes(array('id' => 'saveButton', 'onclick' => 'onSaveClick()'))->appendIcon(Icon::create('floppy-disk')) !!}
@else
{!! Button::normal(trans("texts.save_draft"))->withAttributes(array('id' => 'saveButton', 'onclick' => 'onSaveDraftClick()'))->appendIcon(Icon::create('floppy-disk')) !!}
{!! Button::normal(trans("texts.save_draft"))->withAttributes(array('id' => 'draftButton', 'onclick' => 'onSaveDraftClick()'))->appendIcon(Icon::create('floppy-disk')) !!}
{!! Button::success(trans("texts.mark_sent"))->withAttributes(array('id' => 'saveButton', 'onclick' => 'onMarkSentClick()'))->appendIcon(Icon::create('globe')) !!}
@endif
{!! Button::info(trans("texts.email_{$entityType}"))->withAttributes(array('id' => 'emailButton', 'onclick' => 'onEmailClick()'))->appendIcon(Icon::create('send')) !!}
@ -1306,7 +1306,10 @@
submitAction('');
}, text, title);
return;
}
} else {
model.invoice().is_public(true);
onSaveClick();
}
}
function onSaveClick() {
@ -1400,13 +1403,13 @@
if ($('#saveButton').is(':disabled')) {
return false;
}
$('#saveButton, #emailButton').attr('disabled', true);
$('#saveButton, #emailButton, #draftButton').attr('disabled', true);
// if save fails ensure user can try again
$.post('{{ url($url) }}', $('.main-form').serialize(), function(data) {
NINJA.formIsChanged = false;
location.href = data;
}).fail(function(data) {
$('#saveButton, #emailButton').attr('disabled', false);
$('#saveButton, #emailButton, #draftButton').attr('disabled', false);
var error = firstJSONError(data.responseJSON) || data.statusText;
swal("{!! trans('texts.invoice_save_error') !!}", error);
});

View File

@ -1,17 +1,17 @@
@extends('public.header')
@section('content')
<style type="text/css">
table.dataTable thead > tr > th, table.invoice-table thead > tr > th {
background-color: {{ $color }} !important;
}
.pagination>.active>a,
.pagination>.active>span,
.pagination>.active>a:hover,
.pagination>.active>span:hover,
.pagination>.active>a:focus,
.pagination>.active>a,
.pagination>.active>span,
.pagination>.active>a:hover,
.pagination>.active>span:hover,
.pagination>.active>a:focus,
.pagination>.active>span:focus {
background-color: {{ $color }};
border-color: {{ $color }};
@ -44,10 +44,9 @@
{!! Datatable::table()
->addColumn($columns)
->setUrl(route('api.client.' . $entityType . 's'))
->setUrl(route('api.client.' . $entityType . 's'))
->setOptions('sPaginationType', 'bootstrap')
->render('datatable') !!}
</div>
@if($entityType == ENTITY_RECURRING_INVOICE)
@ -66,6 +65,6 @@
@endif
<p>&nbsp;</p>
<p>&nbsp;</p>
@stop
@stop