Merge remote-tracking branch 'origin/master'
This commit is contained in:
69
resources/views/customers/profile/edit.blade.php
Normal file
69
resources/views/customers/profile/edit.blade.php
Normal file
@@ -0,0 +1,69 @@
|
||||
@extends('layouts.customer')
|
||||
|
||||
@section('title', trans('general.title.edit', ['type' => trans('auth.profile')]))
|
||||
|
||||
@section('content')
|
||||
<!-- Default box -->
|
||||
<div class="box box-success">
|
||||
{!! Form::model($user, [
|
||||
'method' => 'PATCH',
|
||||
'files' => true,
|
||||
'url' => ['customers/profile/update'],
|
||||
'role' => 'form'
|
||||
]) !!}
|
||||
|
||||
<div class="box-body">
|
||||
{{ Form::textGroup('name', trans('general.name'), 'id-card-o') }}
|
||||
|
||||
{{ Form::emailGroup('email', trans('general.email'), 'envelope') }}
|
||||
|
||||
{{ Form::textGroup('tax_number', trans('general.tax_number'), 'percent', []) }}
|
||||
|
||||
{{ Form::textGroup('phone', trans('general.phone'), 'phone', []) }}
|
||||
|
||||
{{ Form::textareaGroup('address', trans('general.address')) }}
|
||||
|
||||
{{ Form::passwordGroup('password', trans('auth.password.current'), 'key', []) }}
|
||||
|
||||
{{ Form::passwordGroup('password_confirmation', trans('auth.password.current_confirm'), 'key', []) }}
|
||||
|
||||
{{ Form::selectGroup('locale', trans_choice('general.languages', 1), 'flag', language()->allowed()) }}
|
||||
|
||||
{{ Form::fileGroup('picture', trans_choice('general.pictures', 1)) }}
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
|
||||
@permission(['update-customers-profile'])
|
||||
<div class="box-footer">
|
||||
{{ Form::saveButtons('customers') }}
|
||||
</div>
|
||||
<!-- /.box-footer -->
|
||||
@endpermission
|
||||
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script src="{{ asset('public/js/bootstrap-fancyfile.js') }}"></script>
|
||||
@endpush
|
||||
|
||||
@push('css')
|
||||
<link rel="stylesheet" href="{{ asset('public/css/bootstrap-fancyfile.css') }}">
|
||||
@endpush
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$("#locale").select2({
|
||||
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.languages', 1)]) }}"
|
||||
});
|
||||
|
||||
$('#picture').fancyfile({
|
||||
text : '{{ trans('general.form.select.file') }}',
|
||||
style : 'btn-default',
|
||||
placeholder : '<?php echo $user->picture; ?>'
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
@@ -290,7 +290,7 @@
|
||||
modal += ' <input class="form-control" placeholder="{{ trans('general.name') }}" required="required" name="name" type="text" id="name">';
|
||||
modal += ' </div>';
|
||||
modal += ' </div>';
|
||||
modal += ' <div class="form-group col-md-6 required">';
|
||||
modal += ' <div class="form-group col-md-6">';
|
||||
modal += ' <label for="email" class="control-label">{{ trans('general.email') }}</label>';
|
||||
modal += ' <div class="input-group">';
|
||||
modal += ' <div class="input-group-addon"><i class="fa fa-envelope"></i></div>';
|
||||
|
@@ -389,7 +389,7 @@
|
||||
html += ' <h4 class="modal-title" id="emailModalLabel">Overflowing text</h4>';
|
||||
html += ' </div>';
|
||||
html += ' <div class="modal-body">';
|
||||
html += ' N/A';
|
||||
html += ' {{ trans('general.na') }}';
|
||||
html += ' </div>';
|
||||
html += ' <div class="modal-footer">';
|
||||
html += ' <button type="button" class="btn btn-default" data-dismiss="modal">{{ trans('general.cancel') }}</button>';
|
||||
|
@@ -47,7 +47,7 @@
|
||||
<tr>
|
||||
<td><a href="{{ url('expenses/payments/' . $item->id . '/edit') }}">{{ Date::parse($item->paid_at)->format($date_format) }}</a></td>
|
||||
<td>@money($item->amount, $item->currency_code, true)</td>
|
||||
<td class="hidden-xs">{{ !empty($item->vendor->name) ? $item->vendor->name : 'N/A'}}</td>
|
||||
<td class="hidden-xs">{{ !empty($item->vendor->name) ? $item->vendor->name : trans('general.na') }}</td>
|
||||
<td class="hidden-xs">{{ $item->category->name }}</td>
|
||||
<td class="hidden-xs">{{ $item->account->name }}</td>
|
||||
<td class="text-center">
|
||||
|
@@ -10,7 +10,7 @@
|
||||
<div class="box-body">
|
||||
{{ Form::textGroup('name', trans('general.name'), 'id-card-o') }}
|
||||
|
||||
{{ Form::textGroup('email', trans('general.email'), 'envelope') }}
|
||||
{{ Form::textGroup('email', trans('general.email'), 'envelope', []) }}
|
||||
|
||||
{{ Form::textGroup('tax_number', trans('general.tax_number'), 'percent', []) }}
|
||||
|
||||
|
@@ -14,7 +14,7 @@
|
||||
<div class="box-body">
|
||||
{{ Form::textGroup('name', trans('general.name'), 'id-card-o') }}
|
||||
|
||||
{{ Form::textGroup('email', trans('general.email'), 'envelope') }}
|
||||
{{ Form::textGroup('email', trans('general.email'), 'envelope', []) }}
|
||||
|
||||
{{ Form::textGroup('tax_number', trans('general.tax_number'), 'percent', []) }}
|
||||
|
||||
|
@@ -43,7 +43,7 @@
|
||||
@foreach($vendors as $item)
|
||||
<tr>
|
||||
<td><a href="{{ url('expenses/vendors/' . $item->id . '/edit') }}">{{ $item->name }}</a></td>
|
||||
<td class="hidden-xs">{{ $item->email }}</td>
|
||||
<td class="hidden-xs">{{ !empty($item->email) ? $item->email : trans('general.na') }}</td>
|
||||
<td>{{ $item->phone }}</td>
|
||||
<td class="hidden-xs">
|
||||
@if ($item->enabled)
|
||||
|
@@ -10,7 +10,7 @@
|
||||
<div class="box-body">
|
||||
{{ Form::textGroup('name', trans('general.name'), 'id-card-o') }}
|
||||
|
||||
{{ Form::textGroup('email', trans('general.email'), 'envelope') }}
|
||||
{{ Form::textGroup('email', trans('general.email'), 'envelope', []) }}
|
||||
|
||||
{{ Form::textGroup('tax_number', trans('general.tax_number'), 'percent', []) }}
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
$('#create_user').iCheck({
|
||||
checkboxClass: 'icheckbox_square-green',
|
||||
radioClass: 'iradio_square-green',
|
||||
increaseArea: '20%' // optional
|
||||
increaseArea: '20%'
|
||||
});
|
||||
|
||||
$('#create_user').on('ifClicked', function (event) {
|
||||
@@ -76,13 +76,29 @@
|
||||
|
||||
if ($(this).prop('checked')) {
|
||||
$('.col-md-6.password').addClass('hidden');
|
||||
|
||||
$('input[name="email"]').parent().parent().removeClass('has-error');
|
||||
$('input[name="email"]').parent().parent().find('.help-block').remove();
|
||||
} else {
|
||||
var email = $('input[name="email"]').val();
|
||||
|
||||
if (!email) {
|
||||
$('input[name="email"]').parent().parent().addClass('has-error');
|
||||
$('input[name="email"]').parent().after('<p class="help-block">{{ trans('validation.required', ['attribute' => 'email']) }}</p>');
|
||||
$('input[name="email"]').focus();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: '{{ url("auth/users/autocomplete") }}',
|
||||
type: 'GET',
|
||||
dataType: 'JSON',
|
||||
data: {column: 'email', value: $('input[name="email"]').val()},
|
||||
data: {column: 'email', value: email},
|
||||
beforeSend: function() {
|
||||
$('input[name="email"]').parent().parent().removeClass('has-error');
|
||||
$('input[name="email"]').parent().parent().find('.help-block').remove();
|
||||
|
||||
$('.box-footer .btn').attr('disabled', true);
|
||||
},
|
||||
complete: function() {
|
||||
@@ -90,6 +106,14 @@
|
||||
},
|
||||
success: function(json) {
|
||||
if (json['errors']) {
|
||||
if (json['data']) {
|
||||
$('input[name="email"]').parent().parent().addClass('has-error');
|
||||
$('input[name="email"]').parent().after('<p class="help-block">' + json['data'] + '</p>');
|
||||
$('input[name="email"]').focus();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
$('.col-md-6.password').removeClass('hidden');
|
||||
}
|
||||
|
||||
|
@@ -14,7 +14,7 @@
|
||||
<div class="box-body">
|
||||
{{ Form::textGroup('name', trans('general.name'), 'id-card-o') }}
|
||||
|
||||
{{ Form::textGroup('email', trans('general.email'), 'envelope') }}
|
||||
{{ Form::textGroup('email', trans('general.email'), 'envelope', []) }}
|
||||
|
||||
{{ Form::textGroup('tax_number', trans('general.tax_number'), 'percent', []) }}
|
||||
|
||||
|
@@ -43,7 +43,7 @@
|
||||
@foreach($customers as $item)
|
||||
<tr>
|
||||
<td><a href="{{ url('incomes/customers/' . $item->id . '/edit') }}">{{ $item->name }}</a></td>
|
||||
<td class="hidden-xs">{{ $item->email }}</td>
|
||||
<td class="hidden-xs">{{ !empty($item->email) ? $item->email : trans('general.na') }}</td>
|
||||
<td>{{ $item->phone }}</td>
|
||||
<td class="hidden-xs">
|
||||
@if ($item->enabled)
|
||||
|
@@ -291,7 +291,7 @@
|
||||
modal += ' <input class="form-control" placeholder="{{ trans('general.name') }}" required="required" name="name" type="text" id="name">';
|
||||
modal += ' </div>';
|
||||
modal += ' </div>';
|
||||
modal += ' <div class="form-group col-md-6 required">';
|
||||
modal += ' <div class="form-group col-md-6">';
|
||||
modal += ' <label for="email" class="control-label">{{ trans('general.email') }}</label>';
|
||||
modal += ' <div class="input-group">';
|
||||
modal += ' <div class="input-group-addon"><i class="fa fa-envelope"></i></div>';
|
||||
|
@@ -157,13 +157,19 @@
|
||||
@permission('update-incomes-invoices')
|
||||
<li><a href="{{ url('incomes/invoices/' . $invoice->id . '/pay') }}">{{ trans('invoices.mark_paid') }}</a></li>
|
||||
@endpermission
|
||||
@if(empty($invoice->payments()->count()) || (!empty($invoice->payments()->count()) && $invoice->payments()->paid() != $invoice->amount))
|
||||
<li><a href="#" id="button-payment">{{ trans('invoices.add_payment') }}</a></li>
|
||||
@endif
|
||||
<li class="divider"></li>
|
||||
@endif
|
||||
@permission('update-incomes-invoices')
|
||||
<li><a href="{{ url('incomes/invoices/' . $invoice->id . '/sent') }}">{{ trans('invoices.mark_sent') }}</a></li>
|
||||
@endpermission
|
||||
@if($invoice->customer_email)
|
||||
<li><a href="{{ url('incomes/invoices/' . $invoice->id . '/email') }}">{{ trans('invoices.send_mail') }}</a></li>
|
||||
@else
|
||||
<li><a href="javascript:void(0);" class="green-tooltip disabled" data-toggle="tooltip" data-placement="right" title="{{ trans('invoices.messages.email_required') }}"><span class="text-disabled">{{ trans('invoices.send_mail') }}</span></a></li>
|
||||
@endif
|
||||
<li class="divider"></li>
|
||||
<li><a href="{{ url('incomes/invoices/' . $invoice->id . '/pdf') }}">{{ trans('invoices.download_pdf') }}</a></li>
|
||||
<li class="divider"></li>
|
||||
@@ -394,7 +400,7 @@
|
||||
html += ' <h4 class="modal-title" id="emailModalLabel">Overflowing text</h4>';
|
||||
html += ' </div>';
|
||||
html += ' <div class="modal-body">';
|
||||
html += ' N/A';
|
||||
html += ' {{ trans('general.na') }}';
|
||||
html += ' </div>';
|
||||
html += ' <div class="modal-footer">';
|
||||
html += ' <button type="button" class="btn btn-default" data-dismiss="modal">{{ trans('general.cancel') }}</button>';
|
||||
|
@@ -47,7 +47,7 @@
|
||||
<tr>
|
||||
<td><a href="{{ url('incomes/revenues/' . $item->id . '/edit') }}">{{ Date::parse($item->paid_at)->format($date_format) }}</a></td>
|
||||
<td>@money($item->amount, $item->currency_code, true)</td>
|
||||
<td class="hidden-xs">{{ !empty($item->customer->name) ? $item->customer->name : 'N/A'}}</td>
|
||||
<td class="hidden-xs">{{ !empty($item->customer->name) ? $item->customer->name : trans('general.na') }}</td>
|
||||
<td class="hidden-xs">{{ $item->category->name }}</td>
|
||||
<td class="hidden-xs">{{ $item->account->name }}</td>
|
||||
<td class="text-center">
|
||||
|
@@ -31,17 +31,10 @@
|
||||
<li>
|
||||
<!-- inner menu: contains the actual data -->
|
||||
<ul class="menu">
|
||||
@if (count($bills))
|
||||
<li>
|
||||
<a href="{{ url('auth/users/' . $user->id . '/read-bills') }}">
|
||||
<i class="fa fa-shopping-cart text-red"></i> {{ trans_choice('header.notifications.upcoming_bills', count($bills), ['count' => count($bills)]) }}
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
@if (count($invoices))
|
||||
<li>
|
||||
<a href="{{ url('auth/users/' . $user->id . '/read-invoices') }}">
|
||||
<i class="fa fa-money text-green"></i> {{ trans_choice('header.notifications.overdue_invoices', count($invoices), ['count' => count($invoices)]) }}
|
||||
<a href="{{ url('customers/profile/read-invoices') }}">
|
||||
<i class="fa fa-money text-red"></i> {{ trans_choice('header.notifications.overdue_invoices', count($invoices), ['count' => count($invoices)]) }}
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
@@ -92,9 +85,9 @@
|
||||
</li>
|
||||
<!-- Menu Footer-->
|
||||
<li class="user-footer">
|
||||
@permission('read-customers-profile')
|
||||
@permission('update-customers-profile')
|
||||
<div class="pull-left">
|
||||
<a href="{{ url('auth/users/' . $user->id . '/edit') }}" class="btn btn-default btn-flat">{{ trans('auth.profile') }}</a>
|
||||
<a href="{{ url('customers/profile/edit') }}" class="btn btn-default btn-flat">{{ trans('auth.profile') }}</a>
|
||||
</div>
|
||||
@endpermission
|
||||
<div class="pull-right">
|
||||
|
Reference in New Issue
Block a user