Merge pull request #748 from cuneytsenturk/master
Attachment stylesheet
This commit is contained in:
commit
d05caa7152
@ -28,6 +28,55 @@ class Uploads extends Controller
|
|||||||
return response()->file($path);
|
return response()->file($path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the specified resource.
|
||||||
|
*
|
||||||
|
* @param $id
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function show($id, Request $request)
|
||||||
|
{
|
||||||
|
$file = false;
|
||||||
|
$options = false;
|
||||||
|
$column_name = 'attachment';
|
||||||
|
|
||||||
|
if ($request->has('column_name')) {
|
||||||
|
$column_name = $request->get('column_name');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($request->has('page')) {
|
||||||
|
$options = [
|
||||||
|
'page' => $request->get('page'),
|
||||||
|
'key' => $request->get('key'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
$media = Media::find($id);
|
||||||
|
|
||||||
|
// Get file path
|
||||||
|
if (!$path = $this->getPath($media)) {
|
||||||
|
return response()->json([
|
||||||
|
'success' => false,
|
||||||
|
'error' => true,
|
||||||
|
'data' => [],
|
||||||
|
'message' => 'null',
|
||||||
|
'html' => '',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$file = $media;
|
||||||
|
|
||||||
|
$html = view('partials.media.file', compact('file', 'column_name', 'options'))->render();
|
||||||
|
|
||||||
|
return response()->json([
|
||||||
|
'success' => true,
|
||||||
|
'error' => false,
|
||||||
|
'data' => [],
|
||||||
|
'message' => 'null',
|
||||||
|
'html' => $html,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Download the specified resource.
|
* Download the specified resource.
|
||||||
*
|
*
|
||||||
|
62
app/Listeners/Updates/V13/Version1311.php
Normal file
62
app/Listeners/Updates/V13/Version1311.php
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Listeners\Updates\V13;
|
||||||
|
|
||||||
|
use App\Events\UpdateFinished;
|
||||||
|
use App\Listeners\Updates\Listener;
|
||||||
|
use App\Models\Auth\Role;
|
||||||
|
use App\Models\Auth\Permission;
|
||||||
|
use Artisan;
|
||||||
|
|
||||||
|
class Version1311 extends Listener
|
||||||
|
{
|
||||||
|
const ALIAS = 'core';
|
||||||
|
|
||||||
|
const VERSION = '1.3.11';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle the event.
|
||||||
|
*
|
||||||
|
* @param $event
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function handle(UpdateFinished $event)
|
||||||
|
{
|
||||||
|
// Check if should listen
|
||||||
|
if (!$this->check($event)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->updatePermissions();
|
||||||
|
|
||||||
|
// Update database
|
||||||
|
Artisan::call('migrate', ['--force' => true]);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function updatePermissions()
|
||||||
|
{
|
||||||
|
$permissions = [];
|
||||||
|
|
||||||
|
// Common Uploads
|
||||||
|
$permissions[] = Permission::firstOrCreate([
|
||||||
|
'name' => 'read-common-uploads',
|
||||||
|
'display_name' => 'Read Common Uploads',
|
||||||
|
'description' => 'Read Common Uploads',
|
||||||
|
]);
|
||||||
|
|
||||||
|
// Attach permission to roles
|
||||||
|
$roles = Role::all();
|
||||||
|
|
||||||
|
foreach ($roles as $role) {
|
||||||
|
$allowed = ['admin', 'manager'];
|
||||||
|
|
||||||
|
if (!in_array($role->name, $allowed)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($permissions as $permission) {
|
||||||
|
$role->attachPermission($permission);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -33,6 +33,7 @@ class EventServiceProvider extends ServiceProvider
|
|||||||
'App\Listeners\Updates\V13\Version135',
|
'App\Listeners\Updates\V13\Version135',
|
||||||
'App\Listeners\Updates\V13\Version138',
|
'App\Listeners\Updates\V13\Version138',
|
||||||
'App\Listeners\Updates\V13\Version139',
|
'App\Listeners\Updates\V13\Version139',
|
||||||
|
'App\Listeners\Updates\V13\Version1311',
|
||||||
],
|
],
|
||||||
'Illuminate\Auth\Events\Login' => [
|
'Illuminate\Auth\Events\Login' => [
|
||||||
'App\Listeners\Auth\Login',
|
'App\Listeners\Auth\Login',
|
||||||
|
@ -36,7 +36,7 @@ class Roles extends Seeder
|
|||||||
'common-companies' => 'c,r,u,d',
|
'common-companies' => 'c,r,u,d',
|
||||||
'common-import' => 'c',
|
'common-import' => 'c',
|
||||||
'common-items' => 'c,r,u,d',
|
'common-items' => 'c,r,u,d',
|
||||||
'common-uploads' => 'd',
|
'common-uploads' => 'r,d',
|
||||||
'common-notifications' => 'c,r,u,d',
|
'common-notifications' => 'c,r,u,d',
|
||||||
'incomes-invoices' => 'c,r,u,d',
|
'incomes-invoices' => 'c,r,u,d',
|
||||||
'incomes-revenues' => 'c,r,u,d',
|
'incomes-revenues' => 'c,r,u,d',
|
||||||
@ -76,6 +76,7 @@ class Roles extends Seeder
|
|||||||
'common-companies' => 'c,r,u,d',
|
'common-companies' => 'c,r,u,d',
|
||||||
'common-import' => 'c',
|
'common-import' => 'c',
|
||||||
'common-items' => 'c,r,u,d',
|
'common-items' => 'c,r,u,d',
|
||||||
|
'common-uploads' => 'r',
|
||||||
'common-notifications' => 'c,r,u,d',
|
'common-notifications' => 'c,r,u,d',
|
||||||
'incomes-invoices' => 'c,r,u,d',
|
'incomes-invoices' => 'c,r,u,d',
|
||||||
'incomes-revenues' => 'c,r,u,d',
|
'incomes-revenues' => 'c,r,u,d',
|
||||||
|
11
public/css/app.css
vendored
11
public/css/app.css
vendored
@ -933,3 +933,14 @@ input[type="number"] {
|
|||||||
.table-report {
|
.table-report {
|
||||||
overflow-x: auto !important;
|
overflow-x: auto !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mailbox-attachment-file-name {
|
||||||
|
white-space: nowrap;
|
||||||
|
width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mailbox-attachment-download {
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
@ -86,31 +86,30 @@
|
|||||||
text : '{{ trans('general.form.select.file') }}',
|
text : '{{ trans('general.form.select.file') }}',
|
||||||
style : 'btn-default',
|
style : 'btn-default',
|
||||||
@if($user->picture)
|
@if($user->picture)
|
||||||
placeholder : '<?php echo $user->picture->basename; ?>'
|
placeholder : '{{ $user->picture->basename }}'
|
||||||
@else
|
@else
|
||||||
placeholder : '{{ trans('general.form.no_file_selected') }}'
|
placeholder : '{{ trans('general.form.no_file_selected') }}'
|
||||||
@endif
|
@endif
|
||||||
});
|
});
|
||||||
|
|
||||||
@if($user->picture)
|
@if($user->picture)
|
||||||
picture_html = '<span class="picture">';
|
$.ajax({
|
||||||
picture_html += ' <a href="{{ url('uploads/' . $user->picture->id . '/download') }}">';
|
url: '{{ url('uploads/' . $user->picture->id . '/show') }}',
|
||||||
picture_html += ' <span id="download-picture" class="text-primary">';
|
type: 'GET',
|
||||||
picture_html += ' <i class="fa fa-file-{{ $user->picture->aggregate_type }}-o"></i> {{ $user->picture->basename }}';
|
data: {column_name: 'picture'},
|
||||||
picture_html += ' </span>';
|
dataType: 'JSON',
|
||||||
picture_html += ' </a>';
|
success: function(json) {
|
||||||
picture_html += ' {!! Form::open(['id' => 'picture-' . $user->picture->id, 'method' => 'DELETE', 'url' => [url('uploads/' . $user->picture->id)], 'style' => 'display:inline']) !!}';
|
if (json['success']) {
|
||||||
picture_html += ' <a id="remove-picture" href="javascript:void();">';
|
$('.fancy-file').after(json['html']);
|
||||||
picture_html += ' <span class="text-danger"><i class="fa fa fa-times"></i></span>';
|
}
|
||||||
picture_html += ' </a>';
|
}
|
||||||
picture_html += ' {!! Form::close() !!}';
|
});
|
||||||
picture_html += '</span>';
|
|
||||||
|
@permission('delete-common-uploads')
|
||||||
$('.fancy-file .fake-file').append(picture_html);
|
$(document).on('click', '#remove-picture', function (e) {
|
||||||
|
confirmDelete("#picture-{!! $user->picture->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $user->picture->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
|
||||||
$(document).on('click', '#remove-picture', function (e) {
|
});
|
||||||
confirmDelete("#picture-{!! $user->picture->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $user->picture->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
|
@endpermission
|
||||||
});
|
|
||||||
@endif
|
@endif
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
@ -63,31 +63,30 @@
|
|||||||
text : '{{ trans('general.form.select.file') }}',
|
text : '{{ trans('general.form.select.file') }}',
|
||||||
style : 'btn-default',
|
style : 'btn-default',
|
||||||
@if($company->company_logo)
|
@if($company->company_logo)
|
||||||
placeholder : '<?php echo $company->company_logo->basename; ?>'
|
placeholder : '{{ $company->company_logo->basename }}'
|
||||||
@else
|
@else
|
||||||
placeholder : '{{ trans('general.form.no_file_selected') }}'
|
placeholder : '{{ trans('general.form.no_file_selected') }}'
|
||||||
@endif
|
@endif
|
||||||
});
|
});
|
||||||
|
|
||||||
@if($company->company_logo)
|
@if($company->company_logo)
|
||||||
attachment_html = '<span class="attachment">';
|
$.ajax({
|
||||||
attachment_html += ' <a href="{{ url('uploads/' . $company->company_logo->id . '/download') }}">';
|
url: '{{ url('uploads/' . $company->company_logo->id . '/show') }}',
|
||||||
attachment_html += ' <span id="download-attachment" class="text-primary">';
|
type: 'GET',
|
||||||
attachment_html += ' <i class="fa fa-file-{{ $company->company_logo->aggregate_type }}-o"></i> {{ $company->company_logo->basename }}';
|
data: {column_name: 'attachment'},
|
||||||
attachment_html += ' </span>';
|
dataType: 'JSON',
|
||||||
attachment_html += ' </a>';
|
success: function(json) {
|
||||||
attachment_html += ' {!! Form::open(['id' => 'attachment-' . $company->company_logo->id, 'method' => 'DELETE', 'url' => [url('uploads/' . $company->company_logo->id)], 'style' => 'display:inline']) !!}';
|
if (json['success']) {
|
||||||
attachment_html += ' <a id="remove-attachment" href="javascript:void();">';
|
$('.fancy-file').after(json['html']);
|
||||||
attachment_html += ' <span class="text-danger"><i class="fa fa fa-times"></i></span>';
|
}
|
||||||
attachment_html += ' </a>';
|
}
|
||||||
attachment_html += ' {!! Form::close() !!}';
|
});
|
||||||
attachment_html += '</span>';
|
|
||||||
|
|
||||||
$('.fancy-file .fake-file').append(attachment_html);
|
@permission('delete-common-uploads')
|
||||||
|
$(document).on('click', '#remove-attachment', function (e) {
|
||||||
$(document).on('click', '#remove-attachment', function (e) {
|
confirmDelete("#attachment-{!! $company->company_logo->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $company->company_logo->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
|
||||||
confirmDelete("#attachment-{!! $company->company_logo->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $company->company_logo->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
|
});
|
||||||
});
|
@endpermission
|
||||||
@endif
|
@endif
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -110,31 +110,30 @@
|
|||||||
text : '{{ trans('general.form.select.file') }}',
|
text : '{{ trans('general.form.select.file') }}',
|
||||||
style : 'btn-default',
|
style : 'btn-default',
|
||||||
@if($item->picture)
|
@if($item->picture)
|
||||||
placeholder : '<?php echo $item->picture->basename; ?>'
|
placeholder : '{{ $item->picture->basename }}'
|
||||||
@else
|
@else
|
||||||
placeholder : '{{ trans('general.form.no_file_selected') }}'
|
placeholder : '{{ trans('general.form.no_file_selected') }}'
|
||||||
@endif
|
@endif
|
||||||
});
|
});
|
||||||
|
|
||||||
@if($item->picture)
|
@if($item->picture)
|
||||||
picture_html = '<span class="picture">';
|
$.ajax({
|
||||||
picture_html += ' <a href="{{ url('uploads/' . $item->picture->id . '/download') }}">';
|
url: '{{ url('uploads/' . $item->picture->id . '/show') }}',
|
||||||
picture_html += ' <span id="download-picture" class="text-primary">';
|
type: 'GET',
|
||||||
picture_html += ' <i class="fa fa-file-{{ $item->picture->aggregate_type }}-o"></i> {{ $item->picture->basename }}';
|
data: {column_name: 'picture'},
|
||||||
picture_html += ' </span>';
|
dataType: 'JSON',
|
||||||
picture_html += ' </a>';
|
success: function(json) {
|
||||||
picture_html += ' {!! Form::open(['id' => 'picture-' . $item->picture->id, 'method' => 'DELETE', 'url' => [url('uploads/' . $item->picture->id)], 'style' => 'display:inline']) !!}';
|
if (json['success']) {
|
||||||
picture_html += ' <a id="remove-picture" href="javascript:void();">';
|
$('.fancy-file').after(json['html']);
|
||||||
picture_html += ' <span class="text-danger"><i class="fa fa fa-times"></i></span>';
|
}
|
||||||
picture_html += ' </a>';
|
}
|
||||||
picture_html += ' {!! Form::close() !!}';
|
});
|
||||||
picture_html += '</span>';
|
|
||||||
|
@permission('delete-common-uploads')
|
||||||
$('.fancy-file .fake-file').append(picture_html);
|
$(document).on('click', '#remove-picture', function (e) {
|
||||||
|
confirmDelete("#picture-{!! $item->picture->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $item->picture->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
|
||||||
$(document).on('click', '#remove-picture', function (e) {
|
});
|
||||||
confirmDelete("#picture-{!! $item->picture->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $item->picture->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
|
@endpermission
|
||||||
});
|
|
||||||
@endif
|
@endif
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -64,31 +64,30 @@
|
|||||||
text : '{{ trans('general.form.select.file') }}',
|
text : '{{ trans('general.form.select.file') }}',
|
||||||
style : 'btn-default',
|
style : 'btn-default',
|
||||||
@if($user->picture)
|
@if($user->picture)
|
||||||
placeholder : '<?php echo $user->picture->basename; ?>'
|
placeholder : '{{ $user->picture->basename }}'
|
||||||
@else
|
@else
|
||||||
placeholder : '{{ trans('general.form.no_file_selected') }}'
|
placeholder : '{{ trans('general.form.no_file_selected') }}'
|
||||||
@endif
|
@endif
|
||||||
});
|
});
|
||||||
|
|
||||||
@if($user->picture)
|
@if($user->picture)
|
||||||
picture_html = '<span class="picture">';
|
$.ajax({
|
||||||
picture_html += ' <a href="{{ url('uploads/' . $user->picture->id . '/download') }}">';
|
url: '{{ url('uploads/' . $user->picture->id . '/show') }}',
|
||||||
picture_html += ' <span id="download-picture" class="text-primary">';
|
type: 'GET',
|
||||||
picture_html += ' <i class="fa fa-file-{{ $user->picture->aggregate_type }}-o"></i> {{ $user->picture->basename }}';
|
data: {column_name: 'picture'},
|
||||||
picture_html += ' </span>';
|
dataType: 'JSON',
|
||||||
picture_html += ' </a>';
|
success: function(json) {
|
||||||
picture_html += ' {!! Form::open(['id' => 'picture-' . $user->picture->id, 'method' => 'DELETE', 'url' => [url('uploads/' . $user->picture->id)], 'style' => 'display:inline']) !!}';
|
if (json['success']) {
|
||||||
picture_html += ' <a id="remove-picture" href="javascript:void();">';
|
$('.fancy-file').after(json['html']);
|
||||||
picture_html += ' <span class="text-danger"><i class="fa fa fa-times"></i></span>';
|
}
|
||||||
picture_html += ' </a>';
|
}
|
||||||
picture_html += ' {!! Form::close() !!}';
|
});
|
||||||
picture_html += '</span>';
|
|
||||||
|
|
||||||
$('.fancy-file .fake-file').append(picture_html);
|
@permission('delete-common-uploads')
|
||||||
|
$(document).on('click', '#remove-picture', function (e) {
|
||||||
$(document).on('click', '#remove-picture', function (e) {
|
confirmDelete("#picture-{!! $user->picture->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $user->picture->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
|
||||||
confirmDelete("#picture-{!! $user->picture->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $user->picture->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
|
});
|
||||||
});
|
@endpermission
|
||||||
@endif
|
@endif
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -257,27 +257,24 @@
|
|||||||
text : '{{ trans('general.form.select.file') }}',
|
text : '{{ trans('general.form.select.file') }}',
|
||||||
style : 'btn-default',
|
style : 'btn-default',
|
||||||
@if($bill->attachment)
|
@if($bill->attachment)
|
||||||
placeholder : '<?php echo $bill->attachment->basename; ?>'
|
placeholder : '{{ $bill->attachment->basename }}'
|
||||||
@else
|
@else
|
||||||
placeholder : '{{ trans('general.form.no_file_selected') }}'
|
placeholder : '{{ trans('general.form.no_file_selected') }}'
|
||||||
@endif
|
@endif
|
||||||
});
|
});
|
||||||
|
|
||||||
@if($bill->attachment)
|
@if($bill->attachment)
|
||||||
attachment_html = '<span class="attachment">';
|
$.ajax({
|
||||||
attachment_html += ' <a href="{{ url('uploads/' . $bill->attachment->id . '/download') }}">';
|
url: '{{ url('uploads/' . $bill->attachment->id . '/show') }}',
|
||||||
attachment_html += ' <span id="download-attachment" class="text-primary">';
|
type: 'GET',
|
||||||
attachment_html += ' <i class="fa fa-file-{{ $bill->attachment->aggregate_type }}-o"></i> {{ $bill->attachment->basename }}';
|
data: {column_name: 'attachment'},
|
||||||
attachment_html += ' </span>';
|
dataType: 'JSON',
|
||||||
attachment_html += ' </a>';
|
success: function(json) {
|
||||||
attachment_html += ' {!! Form::open(['id' => 'attachment-' . $bill->attachment->id, 'method' => 'DELETE', 'url' => [url('uploads/' . $bill->attachment->id)], 'style' => 'display:inline']) !!}';
|
if (json['success']) {
|
||||||
attachment_html += ' <a id="remove-attachment" href="javascript:void();">';
|
$('.fancy-file').after(json['html']);
|
||||||
attachment_html += ' <span class="text-danger"><i class="fa fa fa-times"></i></span>';
|
}
|
||||||
attachment_html += ' </a>';
|
}
|
||||||
attachment_html += ' {!! Form::close() !!}';
|
});
|
||||||
attachment_html += '</span>';
|
|
||||||
|
|
||||||
$('.fancy-file .fake-file').append(attachment_html);
|
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@if(old('item'))
|
@if(old('item'))
|
||||||
@ -285,11 +282,13 @@
|
|||||||
@endif
|
@endif
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@permission('delete-common-uploads')
|
||||||
@if($bill->attachment)
|
@if($bill->attachment)
|
||||||
$(document).on('click', '#remove-attachment', function (e) {
|
$(document).on('click', '#remove-attachment', function (e) {
|
||||||
confirmDelete("#attachment-{!! $bill->attachment->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $bill->attachment->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
|
confirmDelete("#attachment-{!! $bill->attachment->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $bill->attachment->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
|
||||||
});
|
});
|
||||||
@endif
|
@endif
|
||||||
|
@endpermission
|
||||||
|
|
||||||
$(document).on('click', '#button-add-item', function (e) {
|
$(document).on('click', '#button-add-item', function (e) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
@ -311,23 +311,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
@if($bill->attachment)
|
@if($bill->attachment)
|
||||||
<span class="attachment">
|
@php $file = $bill->attachment; @endphp
|
||||||
<a href="{{ url('uploads/' . $bill->attachment->id . '/download') }}">
|
@include('partials.media.file')
|
||||||
<span id="download-attachment" class="text-primary">
|
|
||||||
<i class="fa fa-file-{{ $bill->attachment->aggregate_type }}-o"></i> {{ $bill->attachment->basename }}
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
{!! Form::open([
|
|
||||||
'id' => 'attachment-' . $bill->attachment->id,
|
|
||||||
'method' => 'DELETE',
|
|
||||||
'url' => [url('uploads/' . $bill->attachment->id)],
|
|
||||||
'style' => 'display:inline'
|
|
||||||
]) !!}
|
|
||||||
<a id="remove-attachment" href="javascript:void();">
|
|
||||||
<span class="text-danger"><i class="fa fa fa-times"></i></span>
|
|
||||||
</a>
|
|
||||||
{!! Form::close() !!}
|
|
||||||
</span>
|
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -446,11 +431,13 @@
|
|||||||
|
|
||||||
@push('scripts')
|
@push('scripts')
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
@permission('delete-common-uploads')
|
||||||
@if($bill->attachment)
|
@if($bill->attachment)
|
||||||
$(document).on('click', '#remove-attachment', function (e) {
|
$(document).on('click', '#remove-attachment', function (e) {
|
||||||
confirmDelete("#attachment-{!! $bill->attachment->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $bill->attachment->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
|
confirmDelete("#attachment-{!! $bill->attachment->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $bill->attachment->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
|
||||||
});
|
});
|
||||||
@endif
|
@endif
|
||||||
|
@endpermission
|
||||||
|
|
||||||
$(document).on('click', '#button-payment', function (e) {
|
$(document).on('click', '#button-payment', function (e) {
|
||||||
$('#modal-add-payment').remove();
|
$('#modal-add-payment').remove();
|
||||||
|
@ -137,31 +137,30 @@
|
|||||||
text : '{{ trans('general.form.select.file') }}',
|
text : '{{ trans('general.form.select.file') }}',
|
||||||
style : 'btn-default',
|
style : 'btn-default',
|
||||||
@if($payment->attachment)
|
@if($payment->attachment)
|
||||||
placeholder : '<?php echo $payment->attachment->basename; ?>'
|
placeholder : '{{ $payment->attachment->basename }}'
|
||||||
@else
|
@else
|
||||||
placeholder : '{{ trans('general.form.no_file_selected') }}'
|
placeholder : '{{ trans('general.form.no_file_selected') }}'
|
||||||
@endif
|
@endif
|
||||||
});
|
});
|
||||||
|
|
||||||
@if($payment->attachment)
|
@if($payment->attachment)
|
||||||
attachment_html = '<span class="attachment">';
|
$.ajax({
|
||||||
attachment_html += ' <a href="{{ url('uploads/' . $payment->attachment->id . '/download') }}">';
|
url: '{{ url('uploads/' . $payment->attachment->id . '/show') }}',
|
||||||
attachment_html += ' <span id="download-attachment" class="text-primary">';
|
type: 'GET',
|
||||||
attachment_html += ' <i class="fa fa-file-{{ $payment->attachment->aggregate_type }}-o"></i> {{ $payment->attachment->basename }}';
|
data: {column_name: 'attachment'},
|
||||||
attachment_html += ' </span>';
|
dataType: 'JSON',
|
||||||
attachment_html += ' </a>';
|
success: function(json) {
|
||||||
attachment_html += ' {!! Form::open(['id' => 'attachment-' . $payment->attachment->id, 'method' => 'DELETE', 'url' => [url('uploads/' . $payment->attachment->id)], 'style' => 'display:inline']) !!}';
|
if (json['success']) {
|
||||||
attachment_html += ' <a id="remove-attachment" href="javascript:void();">';
|
$('.fancy-file').after(json['html']);
|
||||||
attachment_html += ' <span class="text-danger"><i class="fa fa fa-times"></i></span>';
|
}
|
||||||
attachment_html += ' </a>';
|
}
|
||||||
attachment_html += ' {!! Form::close() !!}';
|
});
|
||||||
attachment_html += '</span>';
|
|
||||||
|
|
||||||
$('.fancy-file .fake-file').append(attachment_html);
|
@permission('delete-common-uploads')
|
||||||
|
$(document).on('click', '#remove-attachment', function (e) {
|
||||||
$(document).on('click', '#remove-attachment', function (e) {
|
confirmDelete("#attachment-{!! $payment->attachment->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $payment->attachment->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
|
||||||
confirmDelete("#attachment-{!! $payment->attachment->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $payment->attachment->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
|
});
|
||||||
});
|
@endpermission
|
||||||
@endif
|
@endif
|
||||||
});
|
});
|
||||||
|
|
||||||
|
29
resources/views/expenses/vendors/edit.blade.php
vendored
29
resources/views/expenses/vendors/edit.blade.php
vendored
@ -69,31 +69,30 @@
|
|||||||
text : '{{ trans('general.form.select.file') }}',
|
text : '{{ trans('general.form.select.file') }}',
|
||||||
style : 'btn-default',
|
style : 'btn-default',
|
||||||
@if($vendor->logo)
|
@if($vendor->logo)
|
||||||
placeholder : '<?php echo $vendor->logo->basename; ?>'
|
placeholder : '{{ $vendor->logo->basename }}'
|
||||||
@else
|
@else
|
||||||
placeholder : '{{ trans('general.form.no_file_selected') }}'
|
placeholder : '{{ trans('general.form.no_file_selected') }}'
|
||||||
@endif
|
@endif
|
||||||
});
|
});
|
||||||
|
|
||||||
@if($vendor->logo)
|
@if($vendor->logo)
|
||||||
logo_html = '<span class="logo">';
|
$.ajax({
|
||||||
logo_html += ' <a href="{{ url('uploads/' . $vendor->logo->id . '/download') }}">';
|
url: '{{ url('uploads/' . $vendor->logo->id . '/show') }}',
|
||||||
logo_html += ' <span id="download-logo" class="text-primary">';
|
type: 'GET',
|
||||||
logo_html += ' <i class="fa fa-file-{{ $vendor->logo->aggregate_type }}-o"></i> {{ $vendor->logo->basename }}';
|
data: {column_name: 'logo'},
|
||||||
logo_html += ' </span>';
|
dataType: 'JSON',
|
||||||
logo_html += ' </a>';
|
success: function(json) {
|
||||||
logo_html += ' {!! Form::open(['id' => 'logo-' . $vendor->logo->id, 'method' => 'DELETE', 'url' => [url('uploads/' . $vendor->logo->id)], 'style' => 'display:inline']) !!}';
|
if (json['success']) {
|
||||||
logo_html += ' <a id="remove-logo" href="javascript:void();">';
|
$('.fancy-file').after(json['html']);
|
||||||
logo_html += ' <span class="text-danger"><i class="fa fa fa-times"></i></span>';
|
}
|
||||||
logo_html += ' </a>';
|
}
|
||||||
logo_html += ' {!! Form::close() !!}';
|
});
|
||||||
logo_html += '</span>';
|
|
||||||
|
|
||||||
$('.fancy-file .fake-file').append(logo_html);
|
|
||||||
|
|
||||||
|
@permission('delete-common-uploads')
|
||||||
$(document).on('click', '#remove-logo', function (e) {
|
$(document).on('click', '#remove-logo', function (e) {
|
||||||
confirmDelete("#logo-{!! $vendor->logo->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $vendor->logo->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
|
confirmDelete("#logo-{!! $vendor->logo->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $vendor->logo->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
|
||||||
});
|
});
|
||||||
|
@endpermission
|
||||||
@endif
|
@endif
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -257,27 +257,24 @@
|
|||||||
text : '{{ trans('general.form.select.file') }}',
|
text : '{{ trans('general.form.select.file') }}',
|
||||||
style : 'btn-default',
|
style : 'btn-default',
|
||||||
@if($invoice->attachment)
|
@if($invoice->attachment)
|
||||||
placeholder : '<?php echo $invoice->attachment->basename; ?>'
|
placeholder : '{{ $invoice->attachment->basename }}'
|
||||||
@else
|
@else
|
||||||
placeholder : '{{ trans('general.form.no_file_selected') }}'
|
placeholder : '{{ trans('general.form.no_file_selected') }}'
|
||||||
@endif
|
@endif
|
||||||
});
|
});
|
||||||
|
|
||||||
@if($invoice->attachment)
|
@if($invoice->attachment)
|
||||||
attachment_html = '<span class="attachment">';
|
$.ajax({
|
||||||
attachment_html += ' <a href="{{ url('uploads/' . $invoice->attachment->id . '/download') }}">';
|
url: '{{ url('uploads/' . $invoice->attachment->id . '/show') }}',
|
||||||
attachment_html += ' <span id="download-attachment" class="text-primary">';
|
type: 'GET',
|
||||||
attachment_html += ' <i class="fa fa-file-{{ $invoice->attachment->aggregate_type }}-o"></i> {{ $invoice->attachment->basename }}';
|
data: {column_name: 'attachment'},
|
||||||
attachment_html += ' </span>';
|
dataType: 'JSON',
|
||||||
attachment_html += ' </a>';
|
success: function(json) {
|
||||||
attachment_html += ' {!! Form::open(['id' => 'attachment-' . $invoice->attachment->id, 'method' => 'DELETE', 'url' => [url('uploads/' . $invoice->attachment->id)], 'style' => 'display:inline']) !!}';
|
if (json['success']) {
|
||||||
attachment_html += ' <a id="remove-attachment" href="javascript:void();">';
|
$('.fancy-file').after(json['html']);
|
||||||
attachment_html += ' <span class="text-danger"><i class="fa fa fa-times"></i></span>';
|
}
|
||||||
attachment_html += ' </a>';
|
}
|
||||||
attachment_html += ' {!! Form::close() !!}';
|
});
|
||||||
attachment_html += '</span>';
|
|
||||||
|
|
||||||
$('.fancy-file .fake-file').append(attachment_html);
|
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@if(old('item'))
|
@if(old('item'))
|
||||||
@ -285,11 +282,13 @@
|
|||||||
@endif
|
@endif
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@permission('delete-common-uploads')
|
||||||
@if($invoice->attachment)
|
@if($invoice->attachment)
|
||||||
$(document).on('click', '#remove-attachment', function (e) {
|
$(document).on('click', '#remove-attachment', function (e) {
|
||||||
confirmDelete("#attachment-{!! $invoice->attachment->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $invoice->attachment->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
|
confirmDelete("#attachment-{!! $invoice->attachment->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $invoice->attachment->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
|
||||||
});
|
});
|
||||||
@endif
|
@endif
|
||||||
|
@endpermission
|
||||||
|
|
||||||
$(document).on('click', '#button-add-item', function (e) {
|
$(document).on('click', '#button-add-item', function (e) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
@ -339,23 +339,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
@if($invoice->attachment)
|
@if($invoice->attachment)
|
||||||
<span class="attachment">
|
@php $file = $invoice->attachment; @endphp
|
||||||
<a href="{{ url('uploads/' . $invoice->attachment->id . '/download') }}">
|
@include('partials.media.file')
|
||||||
<span id="download-attachment" class="text-primary">
|
|
||||||
<i class="fa fa-file-{{ $invoice->attachment->aggregate_type }}-o"></i> {{ $invoice->attachment->basename }}
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
{!! Form::open([
|
|
||||||
'id' => 'attachment-' . $invoice->attachment->id,
|
|
||||||
'method' => 'DELETE',
|
|
||||||
'url' => [url('uploads/' . $invoice->attachment->id)],
|
|
||||||
'style' => 'display:inline'
|
|
||||||
]) !!}
|
|
||||||
<a id="remove-attachment" href="javascript:void();">
|
|
||||||
<span class="text-danger"><i class="fa fa fa-times"></i></span>
|
|
||||||
</a>
|
|
||||||
{!! Form::close() !!}
|
|
||||||
</span>
|
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -474,11 +459,13 @@
|
|||||||
|
|
||||||
@push('scripts')
|
@push('scripts')
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
@permission('delete-common-uploads')
|
||||||
@if($invoice->attachment)
|
@if($invoice->attachment)
|
||||||
$(document).on('click', '#remove-attachment', function (e) {
|
$(document).on('click', '#remove-attachment', function (e) {
|
||||||
confirmDelete("#attachment-{!! $invoice->attachment->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $invoice->attachment->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
|
confirmDelete("#attachment-{!! $invoice->attachment->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $invoice->attachment->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
|
||||||
});
|
});
|
||||||
@endif
|
@endif
|
||||||
|
@endpermission
|
||||||
|
|
||||||
$(document).on('click', '#button-payment', function (e) {
|
$(document).on('click', '#button-payment', function (e) {
|
||||||
$('#modal-add-payment').remove();
|
$('#modal-add-payment').remove();
|
||||||
|
@ -137,32 +137,31 @@
|
|||||||
text : '{{ trans('general.form.select.file') }}',
|
text : '{{ trans('general.form.select.file') }}',
|
||||||
style : 'btn-default',
|
style : 'btn-default',
|
||||||
@if($revenue->attachment)
|
@if($revenue->attachment)
|
||||||
placeholder : '<?php echo $revenue->attachment->basename; ?>'
|
placeholder : '{{ $revenue->attachment->basename }}'
|
||||||
@else
|
@else
|
||||||
placeholder : '{{ trans('general.form.no_file_selected') }}'
|
placeholder : '{{ trans('general.form.no_file_selected') }}'
|
||||||
@endif
|
@endif
|
||||||
});
|
});
|
||||||
|
|
||||||
@if($revenue->attachment)
|
@if($revenue->attachment)
|
||||||
attachment_html = '<span class="attachment">';
|
$.ajax({
|
||||||
attachment_html += ' <a href="{{ url('uploads/' . $revenue->attachment->id . '/download') }}">';
|
url: '{{ url('uploads/' . $revenue->attachment->id . '/show') }}',
|
||||||
attachment_html += ' <span id="download-attachment" class="text-primary">';
|
type: 'GET',
|
||||||
attachment_html += ' <i class="fa fa-file-{{ $revenue->attachment->aggregate_type }}-o"></i> {{ $revenue->attachment->basename }}';
|
data: {column_name: 'attachment'},
|
||||||
attachment_html += ' </span>';
|
dataType: 'JSON',
|
||||||
attachment_html += ' </a>';
|
success: function(json) {
|
||||||
attachment_html += ' {!! Form::open(['id' => 'attachment-' . $revenue->attachment->id, 'method' => 'DELETE', 'url' => [url('uploads/' . $revenue->attachment->id)], 'style' => 'display:inline']) !!}';
|
if (json['success']) {
|
||||||
attachment_html += ' <a id="remove-attachment" href="javascript:void();">';
|
$('.fancy-file').after(json['html']);
|
||||||
attachment_html += ' <span class="text-danger"><i class="fa fa fa-times"></i></span>';
|
}
|
||||||
attachment_html += ' </a>';
|
}
|
||||||
attachment_html += ' {!! Form::close() !!}';
|
});
|
||||||
attachment_html += '</span>';
|
|
||||||
|
|
||||||
$('.fancy-file .fake-file').append(attachment_html);
|
@permission('delete-common-uploads')
|
||||||
|
$(document).on('click', '#remove-attachment', function (e) {
|
||||||
$(document).on('click', '#remove-attachment', function (e) {
|
confirmDelete("#attachment-{!! $revenue->attachment->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $revenue->attachment->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
|
||||||
confirmDelete("#attachment-{!! $revenue->attachment->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $revenue->attachment->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
|
});
|
||||||
});
|
|
||||||
@endif
|
@endif
|
||||||
|
@endpermission
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('change', '#account_id', function (e) {
|
$(document).on('change', '#account_id', function (e) {
|
||||||
|
53
resources/views/partials/media/file.blade.php
Normal file
53
resources/views/partials/media/file.blade.php
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
@php
|
||||||
|
$column_name = !empty($column_name) ? $column_name : 'attachment';
|
||||||
|
$options = !empty($options) ? $options : false;
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
<ul class="mailbox-attachments clearfix margin-top">
|
||||||
|
<li>
|
||||||
|
@if ($file->aggregate_type != 'image')
|
||||||
|
<span class="mailbox-attachment-icon">
|
||||||
|
<i class="fa fa-file-{{ $file->aggregate_type }}-o"></i>
|
||||||
|
</span>
|
||||||
|
@else
|
||||||
|
<span class="mailbox-attachment-icon has-img">
|
||||||
|
<img src="{{ url('uploads/' . $file->id) }}" alt="{{ $file->basename }}">
|
||||||
|
</span>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<div class="mailbox-attachment-info">
|
||||||
|
<a href="javascript:void();" class="mailbox-attachment-name">
|
||||||
|
<p class="mailbox-attachment-file-name">
|
||||||
|
<i class="fa fa-paperclip"></i> {{ $file->basename }}
|
||||||
|
</p>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<span class="mailbox-attachment-size">
|
||||||
|
{{ $file->readableSize() }}
|
||||||
|
|
||||||
|
@permission('delete-common-uploads')
|
||||||
|
{!! Form::open([
|
||||||
|
'id' => $column_name. '-' . $file->id,
|
||||||
|
'method' => 'DELETE',
|
||||||
|
'url' => [url('uploads/' . $file->id)],
|
||||||
|
'style' => 'display:inline'
|
||||||
|
]) !!}
|
||||||
|
<a href="javascript:void();" id="remove-{{ $column_name }}" class="btn btn-danger btn-xs pull-right mailbox-attachment-remove">
|
||||||
|
<i class="fa fa fa-times"></i>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
@if ($options)
|
||||||
|
<input type="hidden" name="page" value="{{ $options['page'] }}" />
|
||||||
|
<input type="hidden" name="key" value="{{ $options['key'] }}" />
|
||||||
|
<input type="hidden" name="value" value="{{ $file->id }}" />
|
||||||
|
@endif
|
||||||
|
{!! Form::close() !!}
|
||||||
|
@endpermission
|
||||||
|
|
||||||
|
<a href="{{ url('uploads/' . $file->id . '/download') }}" class="btn btn-info btn-xs pull-right mailbox-attachment-download">
|
||||||
|
<i class="fa fa-cloud-download"></i>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
55
resources/views/partials/media/files.blade.php
Normal file
55
resources/views/partials/media/files.blade.php
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
@php
|
||||||
|
$column_name = !empty($column_name) ? $column_name : 'attachment';
|
||||||
|
$options = !empty($options) ? $options : false;
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
<ul class="mailbox-attachments clearfix margin-top">
|
||||||
|
@foreach ($files as $file)
|
||||||
|
<li>
|
||||||
|
@if ($file->aggregate_type != 'image')
|
||||||
|
<span class="mailbox-attachment-icon">
|
||||||
|
<i class="fa fa-file-{{ $file->aggregate_type }}-o"></i>
|
||||||
|
</span>
|
||||||
|
@else
|
||||||
|
<span class="mailbox-attachment-icon has-img">
|
||||||
|
<img src="{{ url('uploads/' . $file->id) }}" alt="{{ $file->basename }}">
|
||||||
|
</span>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<div class="mailbox-attachment-info">
|
||||||
|
<a href="javascript:void();" class="mailbox-attachment-name">
|
||||||
|
<p class="mailbox-attachment-file-name">
|
||||||
|
<i class="fa fa-paperclip"></i> {{ $file->basename }}
|
||||||
|
</p>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<span class="mailbox-attachment-size">
|
||||||
|
{{ $file->readableSize() }}
|
||||||
|
|
||||||
|
@permission('delete-common-uploads')
|
||||||
|
{!! Form::open([
|
||||||
|
'id' => 'attachment-' . $file->id,
|
||||||
|
'method' => 'DELETE',
|
||||||
|
'url' => [url('uploads/' . $file->id)],
|
||||||
|
'style' => 'display:inline'
|
||||||
|
]) !!}
|
||||||
|
<a href="javascript:void();" id="remove-attachment" class="btn btn-danger btn-xs pull-right mailbox-attachment-remove">
|
||||||
|
<i class="fa fa fa-times"></i>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
@if ($options)
|
||||||
|
<input type="hidden" name="page" value="{{ $options['page'] }}" />
|
||||||
|
<input type="hidden" name="key" value="{{ $options['key'] }}" />
|
||||||
|
<input type="hidden" name="value" value="{{ $file->id }}" />
|
||||||
|
@endif
|
||||||
|
{!! Form::close() !!}
|
||||||
|
@endpermission
|
||||||
|
|
||||||
|
<a href="{{ url('uploads/' . $file->id . '/download') }}" class="btn btn-info btn-xs pull-right mailbox-attachment-download">
|
||||||
|
<i class="fa fa-cloud-download"></i>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
@endforeach
|
||||||
|
</ul>
|
@ -246,27 +246,23 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
@if($setting['company_logo'])
|
@if($setting['company_logo'])
|
||||||
company_logo_html = '<span class="company_logo">';
|
$.ajax({
|
||||||
company_logo_html += ' <a href="{{ url('uploads/' . $setting['company_logo']->id . '/download') }}">';
|
url: '{{ url('uploads/' . $setting['company_logo']->id . '/show') }}',
|
||||||
company_logo_html += ' <span id="download-company_logo" class="text-primary">';
|
type: 'GET',
|
||||||
company_logo_html += ' <i class="fa fa-file-{{ $setting['company_logo']->aggregate_type }}-o"></i> {{ $setting['company_logo']->basename }}';
|
data: {column_name: 'company_logo', page: 'setting', key: 'general.company_logo'},
|
||||||
company_logo_html += ' </span>';
|
dataType: 'JSON',
|
||||||
company_logo_html += ' </a>';
|
success: function(json) {
|
||||||
company_logo_html += ' {!! Form::open(['id' => 'company_logo-' . $setting['company_logo']->id, 'method' => 'DELETE', 'url' => [url('uploads/' . $setting['company_logo']->id)], 'style' => 'display:inline']) !!}';
|
if (json['success']) {
|
||||||
company_logo_html += ' <a id="remove-company_logo" href="javascript:void();">';
|
$('#company .fancy-file').after(json['html']);
|
||||||
company_logo_html += ' <span class="text-danger"><i class="fa fa fa-times"></i></span>';
|
}
|
||||||
company_logo_html += ' </a>';
|
}
|
||||||
company_logo_html += ' <input type="hidden" name="page" value="setting" />';
|
});
|
||||||
company_logo_html += ' <input type="hidden" name="key" value="general.company_logo" />';
|
|
||||||
company_logo_html += ' <input type="hidden" name="value" value="{{ $setting['company_logo']->id }}" />';
|
@permission('delete-common-uploads')
|
||||||
company_logo_html += ' {!! Form::close() !!}';
|
$(document).on('click', '#remove-company_logo', function (e) {
|
||||||
company_logo_html += '</span>';
|
confirmDelete("#company_logo-{!! $setting['company_logo']->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $setting['company_logo']->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
|
||||||
|
});
|
||||||
$('#company .fancy-file .fake-file').append(company_logo_html);
|
@endpermission
|
||||||
|
|
||||||
$(document).on('click', '#remove-company_logo', function (e) {
|
|
||||||
confirmDelete("#company_logo-{!! $setting['company_logo']->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $setting['company_logo']->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
|
|
||||||
});
|
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
var invoice_file = false;
|
var invoice_file = false;
|
||||||
@ -286,27 +282,23 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
@if($setting['invoice_logo'])
|
@if($setting['invoice_logo'])
|
||||||
invoice_logo_html = '<span class="invoice_logo">';
|
$.ajax({
|
||||||
invoice_logo_html += ' <a href="{{ url('uploads/' . $setting['invoice_logo']->id . '/download') }}">';
|
url: '{{ url('uploads/' . $setting['invoice_logo']->id . '/show') }}',
|
||||||
invoice_logo_html += ' <span id="download-invoice_logo" class="text-primary">';
|
type: 'GET',
|
||||||
invoice_logo_html += ' <i class="fa fa-file-{{ $setting['invoice_logo']->aggregate_type }}-o"></i> {{ $setting['invoice_logo']->basename }}';
|
data: {column_name: 'invoice_logo', page: 'setting', key: 'general.invoice_logo'},
|
||||||
invoice_logo_html += ' </span>';
|
dataType: 'JSON',
|
||||||
invoice_logo_html += ' </a>';
|
success: function(json) {
|
||||||
invoice_logo_html += ' {!! Form::open(['id' => 'invoice_logo-' . $setting['invoice_logo']->id, 'method' => 'DELETE', 'url' => [url('uploads/' . $setting['invoice_logo']->id)], 'style' => 'display:inline']) !!}';
|
if (json['success']) {
|
||||||
invoice_logo_html += ' <a id="remove-invoice_logo" href="javascript:void();">';
|
$(target + ' .fancy-file').after(json['html']);
|
||||||
invoice_logo_html += ' <span class="text-danger"><i class="fa fa fa-times"></i></span>';
|
}
|
||||||
invoice_logo_html += ' </a>';
|
}
|
||||||
invoice_logo_html += ' <input type="hidden" name="page" value="setting" />';
|
});
|
||||||
invoice_logo_html += ' <input type="hidden" name="key" value="general.invoice_logo" />';
|
|
||||||
invoice_logo_html += ' <input type="hidden" name="value" value="{{ $setting['invoice_logo']->id }}" />';
|
|
||||||
invoice_logo_html += ' {!! Form::close() !!}';
|
|
||||||
invoice_logo_html += '</span>';
|
|
||||||
|
|
||||||
$(target + ' .fancy-file .fake-file').append(invoice_logo_html);
|
|
||||||
|
|
||||||
|
@permission('delete-common-uploads')
|
||||||
$(document).on('click', '#remove-invoice_logo', function (e) {
|
$(document).on('click', '#remove-invoice_logo', function (e) {
|
||||||
confirmDelete("#invoice_logo-{!! $setting['invoice_logo']->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $setting['invoice_logo']->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
|
confirmDelete("#invoice_logo-{!! $setting['invoice_logo']->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $setting['invoice_logo']->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
|
||||||
});
|
});
|
||||||
|
@endpermission
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
invoice_file = true;
|
invoice_file = true;
|
||||||
|
@ -116,27 +116,23 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
@if($company->company_logo)
|
@if($company->company_logo)
|
||||||
company_logo_html = '<span class="company_logo">';
|
$.ajax({
|
||||||
company_logo_html += ' <a href="{{ url('uploads/' . $company->company_logo->id . '/download') }}">';
|
url: '{{ url('uploads/' . $company->company_logo->id . '/show') }}',
|
||||||
company_logo_html += ' <span id="download-company_logo" class="text-primary">';
|
type: 'GET',
|
||||||
company_logo_html += ' <i class="fa fa-file-{{ $company->company_logo->aggregate_type }}-o"></i> {{ $company->company_logo->basename }}';
|
data: {column_name: 'company_logo', page: 'setting', key: 'general.company_logo'},
|
||||||
company_logo_html += ' </span>';
|
dataType: 'JSON',
|
||||||
company_logo_html += ' </a>';
|
success: function(json) {
|
||||||
company_logo_html += ' {!! Form::open(['id' => 'company_logo-' . $company->company_logo->id, 'method' => 'DELETE', 'url' => [url('uploads/' . $company->company_logo->id)], 'style' => 'display:inline']) !!}';
|
if (json['success']) {
|
||||||
company_logo_html += ' <a id="remove-company_logo" href="javascript:void();">';
|
$('.form-group.col-md-6 .fancy-file').after(json['html']);
|
||||||
company_logo_html += ' <span class="text-danger"><i class="fa fa fa-times"></i></span>';
|
}
|
||||||
company_logo_html += ' </a>';
|
}
|
||||||
company_logo_html += ' <input type="hidden" name="page" value="setting" />';
|
});
|
||||||
company_logo_html += ' <input type="hidden" name="key" value="general.company_logo" />';
|
|
||||||
company_logo_html += ' <input type="hidden" name="value" value="{{ $company->company_logo->id }}" />';
|
|
||||||
company_logo_html += ' {!! Form::close() !!}';
|
|
||||||
company_logo_html += '</span>';
|
|
||||||
|
|
||||||
$('.form-group.col-md-6 .fancy-file .fake-file').append(company_logo_html);
|
|
||||||
|
|
||||||
|
@permission('delete-common-uploads')
|
||||||
$(document).on('click', '#remove-company_logo', function (e) {
|
$(document).on('click', '#remove-company_logo', function (e) {
|
||||||
confirmDelete("#company_logo-{!! $company->company_logo->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $company->company_logo->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
|
confirmDelete("#company_logo-{!! $company->company_logo->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $company->company_logo->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
|
||||||
});
|
});
|
||||||
|
@endpermission
|
||||||
@endif
|
@endif
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -4,6 +4,7 @@ Route::group(['middleware' => 'language'], function () {
|
|||||||
Route::group(['middleware' => 'auth'], function () {
|
Route::group(['middleware' => 'auth'], function () {
|
||||||
Route::group(['prefix' => 'uploads'], function () {
|
Route::group(['prefix' => 'uploads'], function () {
|
||||||
Route::get('{id}', 'Common\Uploads@get');
|
Route::get('{id}', 'Common\Uploads@get');
|
||||||
|
Route::get('{id}/show', 'Common\Uploads@show');
|
||||||
Route::get('{id}/download', 'Common\Uploads@download');
|
Route::get('{id}/download', 'Common\Uploads@download');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user