From: Vincent Vanwaelscappel Date: Fri, 5 Jan 2024 18:45:25 +0000 (+0100) Subject: wip #6571 @1.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=1bd9b7ede2bf9552e751f837aaeff1fa073fedca;p=fluidbook-toolbox.git wip #6571 @1.5 --- diff --git a/app/Http/Controllers/Admin/Operations/InvoiceOperation.php b/app/Http/Controllers/Admin/Operations/InvoiceOperation.php deleted file mode 100644 index 8116fa317..000000000 --- a/app/Http/Controllers/Admin/Operations/InvoiceOperation.php +++ /dev/null @@ -1,23 +0,0 @@ -crud->addButtonFromView('line', 'invoice', 'invoice', 'end'); - } - - protected function invoiceItem($id) - { - - } -} diff --git a/app/Models/FluidbookPublication.php b/app/Models/FluidbookPublication.php index 0fee1c895..026748001 100644 --- a/app/Models/FluidbookPublication.php +++ b/app/Models/FluidbookPublication.php @@ -103,7 +103,6 @@ class FluidbookPublication extends ToolboxStatusModel EditOperation::class, ChangeownerOperation::class, ChangestatusOperation::class, - InvoiceOperation::class, // Services SocialImageOperation::class, ExportPdfOperation::class, diff --git a/public/packages/fluidbook/toolbox/js/contextdownload.js b/public/packages/fluidbook/toolbox/js/contextdownload.js index fcd9d5e0e..8a22b888c 100644 --- a/public/packages/fluidbook/toolbox/js/contextdownload.js +++ b/public/packages/fluidbook/toolbox/js/contextdownload.js @@ -8,11 +8,11 @@ $(function () { var items = {}; var confirm = $($trigger).data('context-confirm'); var disabledOption = $($trigger).data('context-disabled-action'); + var callbackFunc = $($trigger).data('context-callback') var actions = {}; $.each(rawActions, function (key, action) { - console.log(action); if (action != sep) { if (typeof action === 'string') { action = {'label': action}; @@ -27,14 +27,14 @@ $(function () { action.disabled = action.disabled || (key == disabledOption); action.isHtmlName = true; } - actions[key+""] = action; + actions[key + ""] = action; }); $.each(actions, function (key, action) { if (action !== sep) { - items[key+""] = {name: action.label, isHtmlName: action.isHtmlName, disabled: action.disabled,}; + items[key + ""] = {name: action.label, isHtmlName: action.isHtmlName, disabled: action.disabled,}; } else { - items[key+""] = action; + items[key + ""] = action; } }); @@ -44,6 +44,12 @@ $(function () { return { callback: function (key, options) { + if (callbackFunc !== undefined && callbackFunc !== null) { + if (!window[callbackFunc]($($trigger), key)) { + return false; + } + } + var ok = function () { var target = actions[key].target; var url = actions[key].url; diff --git a/resources/views/columns/fluidbook_status.blade.php b/resources/views/columns/fluidbook_status.blade.php index dc03a9c7d..f0733e1c0 100644 --- a/resources/views/columns/fluidbook_status.blade.php +++ b/resources/views/columns/fluidbook_status.blade.php @@ -7,19 +7,42 @@ @can('fluidbook-publication:admin') @if($entry->allowsEdit()) getOption('name')}}-{{$column['name']}}="{{$values}}"> - {{$v}} + {{$v}} @else + {{$v}} + @endif + + @endcan + + @cannot('fluidbook-publication:admin') {{$v}} + @endcannot + + + + @if(!isset($crud->seenStatusChange)) + @php + $crud->seenStatusChange=true; + + @endphp + + @endif - -@endcan -@cannot('fluidbook-publication:admin') - {{$v}} -@endcannot diff --git a/resources/views/vendor/backpack/crud/buttons/invoice.blade.php b/resources/views/vendor/backpack/crud/buttons/invoice.blade.php index b589a84a1..e7a144eef 100644 --- a/resources/views/vendor/backpack/crud/buttons/invoice.blade.php +++ b/resources/views/vendor/backpack/crud/buttons/invoice.blade.php @@ -1,60 +1,72 @@ {{-- __('!! Paramètres des fluidbooks') --}} @if($entry->status<3 && $entry->status>0 && $entry->canAdmin(backpack_user())) + @if(!isset($crud->seenInvoice)) + @php + $crud->seenInvoice=true; + // $crud->ajaxOwnerList=\Cubist\Backpack\Magic\Fields\SelectFromArray::hashOptions($column['options']); + @endphp + + + @endif + + {{__('Facturer')}} @endif - - -@if(!isset($crud->seenInvoice)) - @php - $crud->seenInvoice=true; - // $crud->ajaxOwnerList=\Cubist\Backpack\Magic\Fields\SelectFromArray::hashOptions($column['options']); - @endphp - - -@endif