]> _ Git - fluidbook-toolbox.git/commitdiff
wip #5627 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 5 Dec 2022 16:01:02 +0000 (17:01 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 5 Dec 2022 16:01:02 +0000 (17:01 +0100)
app/Http/Controllers/Admin/TeamPayController.php [new file with mode: 0644]
resources/linkeditor/js/form.js [new file with mode: 0644]
resources/linkeditor/style/inc/_form.sass [new file with mode: 0644]
resources/views/team/pay.blade.php [new file with mode: 0644]
routes/web.php

diff --git a/app/Http/Controllers/Admin/TeamPayController.php b/app/Http/Controllers/Admin/TeamPayController.php
new file mode 100644 (file)
index 0000000..fc368ce
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+
+
+namespace App\Http\Controllers\Admin;
+
+
+use App\Http\Controllers\Admin\Operations\Tools\Excel2JSON;
+use App\Http\Controllers\Controller;
+use App\Http\Controllers\Admin\Operations\Tools\SASSCompiler;
+use Cubist\Util\Files\Files;
+
+class TeamPayController extends Controller
+{
+
+    protected function index()
+    {
+        return view('team.pay', ['slips' => $this->getSlips()]);
+    }
+
+    protected function getSlips()
+    {
+        $res = [];
+        $id = backpack_user()->oxygene;
+        if (!$id) {
+            return $res;
+        }
+        $path = resource_path('cubedesigners-oxygene');
+        `cd $path;git pull`;
+        $slipsRoot = $path . '/PAIE/CUBE.$SO/BulletinsPDF';
+        $iterator = Files::getRecursiveDirectoryIterator($slipsRoot);
+        foreach ($iterator as $item) {
+            /** @var $item \SplFileInfo */
+            $n = $item->getFilename();
+            if ($item->getExtension() === 'pdf' && str_starts_with($n, $id)) {
+                $year = substr($n, 4, 4);
+                $month = substr($n, 8, 2);
+                $res[$year . $month] = ['path' => $item->getPathname(), 'year' => $year, 'month' => $month];
+            }
+        }
+        ksort($res);
+        return $res;
+
+    }
+
+
+}
diff --git a/resources/linkeditor/js/form.js b/resources/linkeditor/js/form.js
new file mode 100644 (file)
index 0000000..326ef62
--- /dev/null
@@ -0,0 +1,2 @@
+window.$ = window.jQuery = require('jquery');
+window.key = require('keymaster-reloaded');
diff --git a/resources/linkeditor/style/inc/_form.sass b/resources/linkeditor/style/inc/_form.sass
new file mode 100644 (file)
index 0000000..1cf7686
--- /dev/null
@@ -0,0 +1,32 @@
+.select2-hidden-accessible
+    position: fixed !important
+
+#linkeditor-form-templates
+    display: block
+    position: absolute
+    pointer-events: none
+    opacity: 0
+    top: -600px
+    left: -600px
+
+
+.linkeditor-linktype
+    &::before
+        display: inline-block
+        width: 12px
+        height: 12px
+        border-radius: 2px
+        margin: 2px 10px 0 0
+        content: ""
+        vertical-align: top
+        position: relative
+
+
+#linkeditor-panel-form
+    height: 100%
+    width: 100%
+    overflow: hidden
+    iframe
+        border: 0
+        width: 100%
+        height: 100%
diff --git a/resources/views/team/pay.blade.php b/resources/views/team/pay.blade.php
new file mode 100644 (file)
index 0000000..483bf78
--- /dev/null
@@ -0,0 +1,39 @@
+@extends(backpack_view('blank'))
+
+@section('content')
+    <style>
+        .table td, .table th {
+            vertical-align: middle;
+        }
+    </style>
+    <h2 style="margin-top: 50px">{{__('Bulletins de salaire')}}</h2>
+    <table id="crudTable" style="max-width: 400px"
+           class="bg-white table table-striped table-hover nowrap rounded shadow-xs border-xs mt-2 dataTable dtr-inline">
+        <thead>
+        <tr role="row">
+            <th></th>
+            <th>{{__('Année')}}</th>
+            <th>{{__('Mois')}}</th>
+            <th>{{__('Télécharger')}}</th>
+            <th></th>
+        </tr>
+        </thead>
+        <tbody>
+        @foreach($slips as $id=>$slip)
+            <tr role="row">
+                <td></td>
+                <td><span>{{$slip['year']}}</span></td>
+                <td><span>{{$slip['month']}}</span></td>
+                <td><a class="btn btn-link" href="{{url('team-pay/'.$slip['year'].'/'.$slip['month'])}}"
+                       download="{{$slip['year'].'-'.$slip['month'].'.pdf'}}"><i
+                            class="la la-arrow-circle-down"></i> {{__('Télécharger')}}</a>
+                </td>
+                <td></td>
+            </tr>
+        @endforeach
+
+        </tbody>
+    </table>
+@endsection
+
+
index 2edd7807a2b0e932777d44273ca1f1369188c190..958c0e0bc1007d48eb946147ef0544dd2d88209a 100644 (file)
@@ -11,6 +11,9 @@ Route::group([
     'namespace' => '\App\Http\Controllers\Admin',
 ], function () { // custom admin routes
     Route::any('tools/{tool}/{args?}', 'ToolsController@index')->where(['args' => '.*']);
+    Route::any('team-pay', 'TeamPayController@index');
+    Route::any('team-pay/{year}/{$month}', 'TeamPayController@download');
+    Route::any('team-pay/{year}/fiscal', 'TeamPayController@downloadFiscal');
     Route::any('opentools/{tool}/{args?}', 'OpenToolsController@index')->where(['args' => '.*'])->withoutMiddleware([CheckIfAdmin::class, VerifyCsrfToken::class]);
     Route::any('maintenance/{function}/{args?}', 'MaintenanceController@index')->where(['args' => '.*']);
     Route::any('openmaintenance/{function}/{args?}', 'OpenMaintenanceController@index')->where(['args' => '.*'])->withoutMiddleware([CheckIfAdmin::class]);