mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Fixes for documents
This commit is contained in:
parent
f3a94904ac
commit
ae16eb66e5
@ -189,12 +189,11 @@ class DocumentController extends BaseController
|
||||
*/
|
||||
$documents->each(function ($document, $key) use ($action) {
|
||||
if (auth()->user()->can('edit', $document)) {
|
||||
$this->{$action}($document);
|
||||
$this->document_repo->{$action}($document);
|
||||
}
|
||||
});
|
||||
|
||||
/* Need to understand which permission are required for the given bulk action ie. view / edit */
|
||||
|
||||
return $this->listResponse(Document::withTrashed()->whereIn('id', $this->transformKeys($ids))->company());
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ use App\Utils\Ninja;
|
||||
*/
|
||||
class DocumentRepository extends BaseRepository
|
||||
{
|
||||
|
||||
public function delete($document)
|
||||
{
|
||||
$document->deleteFile();
|
||||
@ -27,14 +28,18 @@ class DocumentRepository extends BaseRepository
|
||||
|
||||
public function restore($document)
|
||||
{
|
||||
if (! $document->trashed()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$document->restore();
|
||||
|
||||
// if (class_exists($className)) {
|
||||
// event(new $className($document, $document->company, Ninja::eventVars()));
|
||||
return;
|
||||
// if (! $document->trashed()) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
// $document->restore();
|
||||
|
||||
}
|
||||
|
||||
public function archive($document)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
@keydown.window.escape="sidebarOpen = false"
|
||||
id="main-sidebar">
|
||||
|
||||
@if($settings->enable_client_portal)
|
||||
@if($settings && $settings->enable_client_portal)
|
||||
<!-- Off-canvas menu for mobile -->
|
||||
@include('portal.ninja2020.components.general.sidebar.mobile')
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
@endif
|
||||
|
||||
<div class="flex flex-col w-0 flex-1 overflow-hidden">
|
||||
@if($settings->enable_client_portal)
|
||||
@if($settings && $settings->enable_client_portal)
|
||||
@include('portal.ninja2020.components.general.sidebar.header')
|
||||
@endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user