Compare commits
366 Commits
master
...
7913576f1a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7913576f1a | ||
|
|
d88b8c8a70 | ||
|
|
f2a87f4d12 | ||
|
|
c338a8afc7 | ||
|
|
29c21367d7 | ||
|
|
09b6c3cf28 | ||
|
|
a34905f34e | ||
|
|
8d8528f6fb | ||
|
|
e69487f73e | ||
|
|
a2da0a8a12 | ||
|
|
b7634e07c0 | ||
|
|
ece0b433fd | ||
|
|
c94d815e5a | ||
|
|
0d0e7c4652 | ||
|
|
0e9d758e6b | ||
|
|
883d2d634d | ||
|
|
1503f21b3b | ||
|
|
17fa80b96b | ||
|
|
92c9975e81 | ||
|
|
b214d8dc74 | ||
|
|
08fc49cb61 | ||
|
|
0f32386406 | ||
|
|
4023fd9ee4 | ||
|
|
1e32fd7cf1 | ||
|
|
870fc6c806 | ||
|
|
045641e687 | ||
|
|
38e477ee5f | ||
|
|
561cd2248c | ||
|
|
0a538ee1a2 | ||
|
|
e490c27837 | ||
|
|
e92f38f6c3 | ||
|
|
296dc4fde2 | ||
|
|
e4e2126ada | ||
|
|
44391e817c | ||
|
|
5359375210 | ||
|
|
c15a6e380f | ||
|
|
3acb69abe4 | ||
|
|
00fc978217 | ||
|
|
7a33245c1e | ||
|
|
927be4ea77 | ||
|
|
b0b87db86d | ||
|
|
53448d7907 | ||
|
|
e920157c0b | ||
|
|
8f905ce1eb | ||
|
|
b95da54240 | ||
|
|
e6ad147790 | ||
|
|
5fc8d3dc57 | ||
|
|
4caf069011 | ||
|
|
d0e97ccd08 | ||
|
|
38ce69b525 | ||
|
|
b67e91d228 | ||
|
|
94f84a7a85 | ||
|
|
54ab6b0231 | ||
|
|
9e30118088 | ||
|
|
6c88e43b74 | ||
|
|
5c20e6d5d0 | ||
|
|
79af996c63 | ||
|
|
c0c4146c9c | ||
|
|
84bc5f2e67 | ||
|
|
72f5da4555 | ||
|
|
349204307f | ||
|
|
36459de793 | ||
|
|
d432827bab | ||
|
|
930695166d | ||
|
|
8c39035cdc | ||
|
|
6a1d8ba80a | ||
|
|
6f8340b90b | ||
|
|
c5f06a608c | ||
|
|
50111787aa | ||
|
|
b80c2a8d41 | ||
|
|
2eea4ec73d | ||
|
|
88a57a9c32 | ||
|
|
7e5b1fea89 | ||
|
|
c053221662 | ||
|
|
25b8fc40c5 | ||
|
|
d33dd6e755 | ||
|
|
04f92c9695 | ||
|
|
7c8546e450 | ||
|
|
585d42264f | ||
|
|
9f4ef99ce2 | ||
|
|
501f3a5ab9 | ||
|
|
0ff39c1401 | ||
|
|
71ecb13af0 | ||
|
|
7561a8e8ba | ||
|
|
bbf4bc4232 | ||
|
|
5d5ea92127 | ||
|
|
a84995e0ce | ||
|
|
fcc564b6d8 | ||
|
|
be468304c9 | ||
|
|
b812a78f9f | ||
|
|
0ec0b8e85b | ||
|
|
9d520abfcf | ||
|
|
174c4ca0e2 | ||
|
|
216c408596 | ||
|
|
3cdb30a0dc | ||
|
|
5bcf265cda | ||
|
|
7ec1d3e89b | ||
|
|
741f389620 | ||
|
|
37f1ebbb59 | ||
|
|
81974d38ab | ||
|
|
cc9672ddca | ||
|
|
12903b6029 | ||
|
|
e6b15e2438 | ||
|
|
002644cb97 | ||
|
|
dfe7625995 | ||
|
|
53feef282f | ||
|
|
69478e3c74 | ||
|
|
ab8ab8eba1 | ||
|
|
de5f3d665d | ||
|
|
afaf0cc629 | ||
|
|
419a4c2b9a | ||
|
|
d750cdced7 | ||
|
|
01f9c9ae7c | ||
|
|
043b7d7215 | ||
|
|
f85df32c67 | ||
|
|
6f2a985edc | ||
|
|
5f1ff26196 | ||
|
|
ddb4520621 | ||
|
|
c619f540f8 | ||
|
|
39c80ce6d1 | ||
|
|
297dcc62d2 | ||
|
|
b011f40b2f | ||
|
|
fdbf819bf5 | ||
|
|
f4738377c7 | ||
|
|
99bdf09be7 | ||
|
|
b283363543 | ||
|
|
6649c32501 | ||
|
|
bc1cf1190b | ||
|
|
3dc6c70c4d | ||
|
|
6e4f93dd65 | ||
|
|
ba8f87cff4 | ||
|
|
efb3fe9670 | ||
|
|
23e6ca35ca | ||
|
|
695d23a139 | ||
|
|
3943fc033f | ||
|
|
bb77a199eb | ||
|
|
808e60e41b | ||
|
|
260eccc1f1 | ||
|
|
abed17b3f0 | ||
|
|
3ad83b870a | ||
|
|
241b255b1c | ||
|
|
d2ec87c374 | ||
|
|
24b86652aa | ||
|
|
923f988aba | ||
|
|
0778fdc10a | ||
|
|
900aa413a2 | ||
|
|
820a200e88 | ||
|
|
186e3de863 | ||
|
|
7722b73be9 | ||
|
|
685160ddf5 | ||
|
|
7449229ff7 | ||
|
|
c5ae71544a | ||
|
|
926996166b | ||
|
|
fd8e89e33c | ||
|
|
503efc6f25 | ||
|
|
e8ae460bab | ||
|
|
bb1e1a6b18 | ||
|
|
02b2d3e410 | ||
|
|
72870680cf | ||
|
|
f3289334f3 | ||
|
|
12e5dbb721 | ||
|
|
b42ae14428 | ||
|
|
ea5350a0a6 | ||
|
|
90d78bc3e3 | ||
|
|
a85e5f2921 | ||
|
|
5e6af2e5f8 | ||
|
|
11aaaa024c | ||
|
|
fd1ab5cf04 | ||
|
|
a03befbf44 | ||
|
|
ce7755ffe3 | ||
|
|
17792fce40 | ||
|
|
9698ba54d0 | ||
|
|
ae39681cb0 | ||
|
|
9895266798 | ||
|
|
c1a9c21e52 | ||
|
|
3a18679a1c | ||
|
|
6ef31f286e | ||
|
|
52193994a3 | ||
|
|
71c0489862 | ||
|
|
d33b5eea52 | ||
|
|
782809829b | ||
|
|
ebe7ba5f6c | ||
|
|
dae8156164 | ||
|
|
1880b25407 | ||
|
|
5819f51f79 | ||
|
|
01f56204b7 | ||
|
|
eadea3958d | ||
|
|
719e4481d7 | ||
|
|
eae2cdf345 | ||
|
|
ab145dd60f | ||
|
|
8054bffb43 | ||
|
|
d50ecd674e | ||
|
|
1703082b3e | ||
|
|
35310b049e | ||
|
|
4801ff4338 | ||
|
|
b2987e5eed | ||
|
|
8b334bc8ed | ||
|
|
79c717ae6c | ||
|
|
8abf391a53 | ||
|
|
cc2798a78e | ||
|
|
ce9f613b66 | ||
|
|
3370b8061c | ||
|
|
8c898bf63b | ||
|
|
fedf463f15 | ||
|
|
73508f6b46 | ||
|
|
c79facd0ca | ||
|
|
3ba5a833b2 | ||
|
|
c77db883c2 | ||
|
|
904110d10f | ||
|
|
3c8fab27da | ||
|
|
ee0954931f | ||
|
|
d399b72120 | ||
|
|
6fc6451f6f | ||
|
|
f3e9ccaa46 | ||
|
|
1fc860715f | ||
|
|
6837954fc9 | ||
|
|
483aa59750 | ||
|
|
f460865a57 | ||
|
|
4d31b1682c | ||
|
|
ee148a27ed | ||
|
|
79e5a6388a | ||
|
|
165262abfa | ||
|
|
2f77b5fc23 | ||
|
|
8afb3467f8 | ||
|
|
e3c60e7cde | ||
|
|
7187a312eb | ||
|
|
e208dc910b | ||
|
|
d4bb94a487 | ||
|
|
e77ed62066 | ||
|
|
8dddd4d99b | ||
|
|
edf43ff270 | ||
|
|
36c6402f04 | ||
|
|
8ba8d9a276 | ||
|
|
cdce15a29f | ||
|
|
c12b45f8ad | ||
|
|
081df4d5d0 | ||
|
|
2d86f162a0 | ||
|
|
c2b7315abf | ||
|
|
7b265d3b47 | ||
|
|
c90dd98319 | ||
|
|
193f5cf4ad | ||
|
|
930eeaede8 | ||
|
|
36a63f3b14 | ||
|
|
d9dba1c515 | ||
|
|
411b47f78d | ||
|
|
a550278f39 | ||
|
|
d715d726db | ||
|
|
60acbc7939 | ||
|
|
6a634c10ca | ||
|
|
308f226ca0 | ||
|
|
c0aeda7554 | ||
|
|
3633581ebf | ||
|
|
15539f27a6 | ||
|
|
0a9d03e214 | ||
|
|
36f16921bb | ||
|
|
cbe397be6a | ||
|
|
8dc409bd78 | ||
|
|
56659c73bb | ||
|
|
accc94f56b | ||
|
|
64f5663da5 | ||
|
|
c6ba4aaa24 | ||
|
|
020954a7cc | ||
|
|
61be4a6769 | ||
|
|
cf9439852f | ||
|
|
5bf3b7ec7b | ||
|
|
715e228b41 | ||
|
|
91675dc83b | ||
|
|
e0addd61ce | ||
|
|
66cc7a6054 | ||
|
|
2d6b092b64 | ||
|
|
9ab19b0e4d | ||
|
|
6110b42ce2 | ||
|
|
82a345c4c7 | ||
|
|
c0a80aa62b | ||
|
|
b325a44ee2 | ||
|
|
88d87ceaab | ||
|
|
ba04007f86 | ||
|
|
81dcd273ce | ||
|
|
d899d3dcaa | ||
|
|
9f6d21ef04 | ||
|
|
bdefa235eb | ||
|
|
545c242bba | ||
|
|
e241486143 | ||
|
|
2f81f1d61d | ||
|
|
4d3ffa2ca3 | ||
|
|
f237882757 | ||
|
|
090dcd6f24 | ||
|
|
6db343c6b2 | ||
|
|
d46347a66f | ||
|
|
ab8f68e4bc | ||
|
|
8c9fc66b89 | ||
|
|
2be53d581e | ||
|
|
26f3fc3d2c | ||
|
|
efff4f0341 | ||
|
|
b3f2aa36be | ||
|
|
cdc88b43df | ||
|
|
ecbb7b62c9 | ||
|
|
b1a2e70d12 | ||
|
|
b2f5cc4a45 | ||
|
|
8a1573d425 | ||
|
|
cb0b2e4aa0 | ||
|
|
7092cf23fc | ||
|
|
e434220c16 | ||
|
|
0858804095 | ||
|
|
5f7e90d22d | ||
|
|
6dce60d227 | ||
|
|
f6668a6dd3 | ||
|
|
dd396a86aa | ||
|
|
f3b6504723 | ||
|
|
41cab61bda | ||
|
|
c76996db86 | ||
|
|
f5716c6530 | ||
|
|
459d35e8a1 | ||
|
|
e9ce44481a | ||
|
|
18f1f8a13a | ||
|
|
e97f54f126 | ||
|
|
0d0e4deb16 | ||
|
|
da51da2530 | ||
|
|
c024bdc31e | ||
|
|
4ec0558cd8 | ||
|
|
48d89d338c | ||
|
|
0f23d5cd56 | ||
|
|
9380d99688 | ||
|
|
06fb42e7c7 | ||
|
|
66a830eec0 | ||
|
|
0e73c8109b | ||
|
|
5e4c9963c6 | ||
|
|
f9070b2ec8 | ||
|
|
8107078ea7 | ||
|
|
be3b6bc0a8 | ||
|
|
290602057a | ||
|
|
a1a3ccb227 | ||
|
|
e9002fb494 | ||
|
|
cffec143e0 | ||
|
|
385873a0cf | ||
|
|
8842b7eea7 | ||
|
|
0cd0e1f126 | ||
|
|
7c01366281 | ||
|
|
fa193a8089 | ||
|
|
27c5663ba1 | ||
|
|
cfd8086586 | ||
|
|
c3a05640ab | ||
|
|
ca691c8fdd | ||
|
|
47ff07451f | ||
|
|
5bbf63b33f | ||
|
|
768c7e88f9 | ||
|
|
23b8914187 | ||
|
|
aee50813e4 | ||
|
|
331b7647de | ||
|
|
b1494477a2 | ||
|
|
31b671bcdd | ||
|
|
9e2226a776 | ||
|
|
9ca510086b | ||
|
|
7ec40145de | ||
|
|
734ec87b89 | ||
|
|
0d421226fa | ||
|
|
d174fe1c81 | ||
|
|
64abc46d99 | ||
|
|
f4ab8e71a8 | ||
|
|
763577bf87 | ||
|
|
226153f744 | ||
|
|
e298320119 | ||
|
|
b90d633e6e | ||
|
|
31e60dee45 | ||
|
|
0dd3df2984 | ||
|
|
d53e9f5a4f |
9
.dockerignore
Normal file
9
.dockerignore
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
.git
|
||||||
|
.gitlab
|
||||||
|
Dockerfile
|
||||||
|
node_modules
|
||||||
|
storage/logs
|
||||||
|
storage/framework/cache/data
|
||||||
|
.dockerignore
|
||||||
|
build.sh
|
||||||
|
opensem-*.tar.xz
|
||||||
1
.gitlab/merge_request_templates/mytemplate.md
Normal file
1
.gitlab/merge_request_templates/mytemplate.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
|
||||||
103
Dockerfile
Normal file
103
Dockerfile
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
FROM php:8.3.25-cli-alpine3.21 AS phpdeps
|
||||||
|
|
||||||
|
|
||||||
|
## Install composer
|
||||||
|
|
||||||
|
RUN apk add wget gnupg ca-certificates
|
||||||
|
|
||||||
|
ARG COMPOSER_VERSION=2.8.11
|
||||||
|
ENV COMPOSER_ALLOW_SUPERUSER=0
|
||||||
|
|
||||||
|
RUN cd tmp && \
|
||||||
|
wget "https://getcomposer.org/download/${COMPOSER_VERSION}/composer.phar" && \
|
||||||
|
wget "https://getcomposer.org/download/${COMPOSER_VERSION}/composer.phar.sha256sum" && \
|
||||||
|
sha256sum -c composer.phar.sha256sum && \
|
||||||
|
install -m0755 /tmp/composer.phar /usr/local/bin/composer && \
|
||||||
|
composer --version
|
||||||
|
|
||||||
|
|
||||||
|
## Install PHP extensions
|
||||||
|
|
||||||
|
RUN apk add autoconf dpkg-dev dpkg file g++ gcc libc-dev make pkgconf re2c libxml2-dev
|
||||||
|
RUN docker-php-ext-install dom
|
||||||
|
|
||||||
|
RUN docker-php-ext-install bcmath
|
||||||
|
|
||||||
|
RUN apk add libpng-dev libjpeg-turbo-dev libwebp-dev libxpm-dev
|
||||||
|
RUN docker-php-ext-configure gd --with-jpeg --with-webp --with-xpm && \
|
||||||
|
docker-php-ext-install gd
|
||||||
|
|
||||||
|
RUN apk add libzip-dev
|
||||||
|
RUN docker-php-ext-install zip
|
||||||
|
|
||||||
|
RUN apk add libexif-dev
|
||||||
|
RUN docker-php-ext-install exif
|
||||||
|
|
||||||
|
|
||||||
|
## Composer dependencies
|
||||||
|
|
||||||
|
RUN apk add git ## required by composer install
|
||||||
|
|
||||||
|
COPY . /app
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN mkdir -p /app/bootstrap/cache \
|
||||||
|
/app/storage/framework/cache \
|
||||||
|
/app/storage/framework/views \
|
||||||
|
/app/storage/framework/sessions \
|
||||||
|
/app/storage/app/public \
|
||||||
|
/app/storage/logs
|
||||||
|
|
||||||
|
RUN composer install --no-dev --optimize-autoloader
|
||||||
|
|
||||||
|
RUN chmod +x artisan
|
||||||
|
|
||||||
|
RUN ./artisan vendor:publish --tag=public --force ## creates public/vendor/jsvalidation
|
||||||
|
RUN ./artisan vendor:publish --tag=boilerplate-public --force --ansi ## creates public/vendor/boilerplate
|
||||||
|
RUN ./artisan vendor:publish --tag=datatables-buttons --force --ansi ## creates public/vendor/datatables/buttons
|
||||||
|
|
||||||
|
## XXXvlab: 2025-09-25 these migration files are breaking first
|
||||||
|
## install, but we had to resolve to not install from scratch and use
|
||||||
|
## the existing database, so commenting out for now
|
||||||
|
#RUN rm -f vendor/sebastienheyd/boilerplate/src/database/migrations/2017_03_24_093351_laratrust_setup_tables.php
|
||||||
|
#RUN rm -f vendor/sebastienheyd/boilerplate/src/database/migrations/2017_03_24_093352_users_table_update.php
|
||||||
|
#RUN rm -f vendor/sebastienheyd/boilerplate/src/database/migrations/2020_01_14_090810_permissions_categories.php
|
||||||
|
|
||||||
|
|
||||||
|
## Node.js, npm, yarn and frontend dependencies
|
||||||
|
|
||||||
|
RUN apk add nodejs npm yarn
|
||||||
|
RUN yarn install --frozen-lockfile
|
||||||
|
RUN yarn production
|
||||||
|
RUN yarn grunt ## this step requires both node_modules and vendor to be present
|
||||||
|
|
||||||
|
|
||||||
|
## Separate out the build stages
|
||||||
|
|
||||||
|
FROM alpine:3.21 AS pack
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN apk add --no-cache xz
|
||||||
|
|
||||||
|
# bring PHP app with vendor
|
||||||
|
COPY --from=phpdeps /app /app
|
||||||
|
|
||||||
|
# ensure required runtime dirs exist (empty is fine)
|
||||||
|
RUN mkdir -p storage/framework/{cache,views,sessions} bootstrap/cache
|
||||||
|
# create artifact (use tar + xz so we don't depend on GNU tar -J)
|
||||||
|
RUN mkdir -p /out \
|
||||||
|
&& tar -C /app -cf /out/app.tar \
|
||||||
|
--exclude=.git --exclude=.github --exclude=.env --exclude='*.md' \
|
||||||
|
--exclude=tests --exclude=.gitignore \
|
||||||
|
--exclude=.editorconfig --exclude=phpunit.xml \
|
||||||
|
--exclude=.travis.yml --exclude=composer.lock --exclude=.styleci.yml \
|
||||||
|
--exclude=Makefile --exclude=.gitkeep --exclude=test \
|
||||||
|
--exclude=resources/shop \
|
||||||
|
artisan app config database vendor public resources routes stubs bootstrap storage composer.json \
|
||||||
|
&& xz -T0 -9e /out/app.tar \
|
||||||
|
&& mv /out/app.tar.xz /out/opensem-prod.tar.xz
|
||||||
|
|
||||||
|
FROM scratch AS export
|
||||||
|
COPY --from=pack /out/opensem-prod.tar.xz /
|
||||||
575
Gruntfile.js
575
Gruntfile.js
@@ -1,121 +1,132 @@
|
|||||||
var jsBase = [
|
var jsBase = [
|
||||||
'node_modules/jquery/dist/jquery.min.js',
|
'node_modules/jquery/dist/jquery.min.js',
|
||||||
'node_modules/jquery-migrate/jquery-migrate.min.js',
|
'node_modules/jquery-migrate/dist/jquery-migrate.min.js',
|
||||||
|
'node_modules/jquery-ui-dist/jquery-ui.min.js'
|
||||||
|
]
|
||||||
|
|
||||||
|
var jsBootstrap = [
|
||||||
'node_modules/bootstrap/dist/js/bootstrap.bundle.min.js',
|
'node_modules/bootstrap/dist/js/bootstrap.bundle.min.js',
|
||||||
|
'node_modules/bootbox/dist/bootbox.all.min.js',
|
||||||
]
|
]
|
||||||
|
|
||||||
var cssBase = [
|
var jsCompat = [
|
||||||
'node_modules/bootstrap/dist/css/bootstrap.min.css',
|
|
||||||
]
|
|
||||||
|
|
||||||
var cssIcons = [
|
|
||||||
'node_modules/font-awesome/css/font-awesome.css',
|
|
||||||
]
|
|
||||||
|
|
||||||
var jsCompatibilty = [
|
|
||||||
'node_modules/promise-polyfill/dist/polyfill.min.js',
|
'node_modules/promise-polyfill/dist/polyfill.min.js',
|
||||||
'node_modules/es6-promise/dist/es6-promise.min.js'
|
'node_modules/es6-promise/dist/es6-promise.min.js',
|
||||||
]
|
|
||||||
|
|
||||||
var jsCoreInclude = [
|
|
||||||
'build/js/include/core/appender.js',
|
|
||||||
// 'build/js/include/core/cache.js',
|
|
||||||
// 'build/js/include/core/handlebars.js',
|
|
||||||
// 'build/js/include/core/lang.js',
|
|
||||||
'build/js/include/core/objectLength.js',
|
|
||||||
// 'build/js/include/core/session.js',
|
|
||||||
'build/js/include/core/url.js',
|
|
||||||
// 'build/js/include/core/user.js',
|
|
||||||
// 'build/js/include/form/check_fields.js',
|
|
||||||
// 'build/js/include/form/checkbox.js',
|
|
||||||
// 'build/js/include/form/datetime.js',
|
|
||||||
// 'build/js/include/form/multi-select.js',
|
|
||||||
// 'build/js/include/form/radio.js',
|
|
||||||
// 'build/js/include/form/select.js',
|
|
||||||
'build/js/include/form/upload.js',
|
|
||||||
// 'build/js/include/form/validator.js',
|
|
||||||
'build/js/include/layout/animate.js',
|
|
||||||
// 'build/js/include/layout/message.js',
|
|
||||||
// 'build/js/include/layout/modal.js',
|
|
||||||
'build/js/include/layout/scroll.js',
|
|
||||||
// 'build/js/include/layout/tooltip.js',
|
|
||||||
// 'build/js/include/datatable.js',
|
|
||||||
'build/js/include/file.js',
|
|
||||||
'build/js/include/uploader.js',
|
|
||||||
]
|
|
||||||
|
|
||||||
var jsMain = [
|
|
||||||
// 'node_modules/sweetalert2/dist/sweetalert2.all.min.js',
|
|
||||||
// 'node_modules/inputmask/dist/min/jquery.inputmask.bundle.min.js',
|
|
||||||
/* 'node_modules/summernote/dist/summernote.min.js',
|
|
||||||
'node_modules/summernote/dist/lang/summernote-fr-FR.min.js',
|
|
||||||
*/
|
|
||||||
// 'node_modules/@activix/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js',
|
|
||||||
// 'node_modules/@activix/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.fr.js',
|
|
||||||
'node_modules/bootstrap-fileinput/js/plugins/piexif.min.js',
|
|
||||||
'node_modules/bootstrap-fileinput/js/plugins/sortable.min.js',
|
|
||||||
// 'node_modules/bootstrap-slider/dist/bootstrap-slider.min.js',
|
|
||||||
// 'node_modules/bootstrap-validate/dist/bootstrap-validate.js',
|
|
||||||
// 'node_modules/jQuery-QueryBuilder/dist/js/jquery-builder.standalone.min.js',
|
|
||||||
/* 'node_modules/jQuery-QueryBuilder/dist/i18n/query-builder.fr.js', */
|
|
||||||
/* 'node_modules/isotope-layout/dist/isotope.pkgd.min.js', */
|
|
||||||
'node_modules/jquery-serializejson/jquery.serializejson.min.js',
|
|
||||||
'node_modules/bootstrap4-toggle/js/bootstrap4-toggle.min.js',
|
|
||||||
'node_modules/wew.js/dist/wew.min.js',
|
|
||||||
'node_modules/jquery.are-you-sure/jquery.are-you-sure.js',
|
|
||||||
/* 'node_modules/letteringjs/jquery.lettering.js', */
|
|
||||||
/* 'node_modules/textillate/jquery.textillate.js', */
|
|
||||||
'node_modules/jqtree/tree.jquery.js',
|
|
||||||
'node_modules/numeral/min/numeral.min.js',
|
|
||||||
'node_modules/numeral/min/locales/fr.min.js',
|
|
||||||
'build/js/include/plugins/jquery.hcaptions.js',
|
|
||||||
jsCoreInclude
|
|
||||||
// 'build/js/include/confirm.js',
|
|
||||||
]
|
|
||||||
|
|
||||||
var cssMain = [
|
|
||||||
// 'node_modules/sweetalert2/dist/sweetalert2.min.css',
|
|
||||||
// 'node_modules/inputmask/css/inputmask.css',
|
|
||||||
// 'node_modules/summernote/dist/summernote.css',
|
|
||||||
// 'node_modules/@activix/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css',
|
|
||||||
// 'node_modules/bootstrap-slider/dist/css/bootstrap-slider.min.css',
|
|
||||||
// 'node_modules/jQuery-QueryBuilder/dist/css/query-builder.default.min.css',
|
|
||||||
'node_modules/animate.css/animate.min.css',
|
|
||||||
'node_modules/bootstrap4-toggle/css/bootstrap4-toggle.min.css',
|
|
||||||
'node_modules/jqtree/jqtree.css',
|
|
||||||
// 'build/css/modal-option.css',
|
|
||||||
'build/css/shadow.css',
|
|
||||||
// 'build/css/utility.css',
|
|
||||||
'build/css/main.css'
|
|
||||||
]
|
]
|
||||||
|
|
||||||
var jsSite = [
|
var jsSite = [
|
||||||
jsBase
|
jsBase,
|
||||||
|
jsBootstrap,
|
||||||
|
'node_modules/jquery-serializejson/jquery.serializejson.min.js',
|
||||||
|
'node_modules/currency.js/dist/currency.min.js',
|
||||||
|
'resources/shop/js/plugins/smooth_products/js/smoothproducts.min.js',
|
||||||
|
'resources/shop/js/site.js',
|
||||||
]
|
]
|
||||||
|
|
||||||
var cssSite = [
|
var cssSite = [
|
||||||
cssBase,
|
'node_modules/bootstrap/dist/css/bootstrap.min.css',
|
||||||
cssIcons,
|
'node_modules/@fortawesome/fontawesome-free/css/all.min.css',
|
||||||
'node_modules/animate.css/animate.min.css',
|
'node_modules/animate.css/animate.min.css',
|
||||||
'build/css/shadow.css',
|
'node_modules/icheck-bootstrap/icheck-bootstrap.min.css',
|
||||||
'build/css/site.css'
|
'resources/shop/js/plugins/smooth_products/css/smoothproducts.css',
|
||||||
|
'resources/shop/css/site.css',
|
||||||
|
]
|
||||||
|
|
||||||
|
var jsAdminLTE = [
|
||||||
|
jsBase,
|
||||||
|
jsBootstrap,
|
||||||
|
'node_modules/sizzle/dist/sizzle.min.js',
|
||||||
|
'node_modules/admin-lte/dist/js/adminlte.min.js',
|
||||||
|
'node_modules/toastr/build/toastr.min.js',
|
||||||
|
]
|
||||||
|
|
||||||
|
var jsCoreInclude = [
|
||||||
|
'resources/shop/js/include/core/objectLength.js',
|
||||||
|
'resources/shop/js/include/core/url.js',
|
||||||
|
'resources/shop/js/include/core/user.js',
|
||||||
|
'resources/shop/js/include/form/radio.js',
|
||||||
|
'resources/shop/js/include/form/upload.js',
|
||||||
|
'resources/shop/js/include/form/validator.js',
|
||||||
|
'resources/shop/js/include/layout/animate.js',
|
||||||
|
'resources/shop/js/include/layout/scroll.js',
|
||||||
|
'resources/shop/js/include/layout/tooltip.js',
|
||||||
|
]
|
||||||
|
|
||||||
|
var jsBundle = [
|
||||||
|
'node_modules/jquery-ui-sortable/jquery-ui.min.js',
|
||||||
|
'node_modules/jquery-serializejson/jquery.serializejson.min.js',
|
||||||
|
'node_modules/jquery-placeholder/jquery.placeholder.js',
|
||||||
|
'node_modules/@claviska/jquery-minicolors/jquery.minicolors.js',
|
||||||
|
'node_modules/bootstrap-validate/dist/bootstrap-validate.js',
|
||||||
|
'node_modules/bootstrap-validator/dist/validator.min.js',
|
||||||
|
'node_modules/jquery-validation/dist/jquery.validate.min.js',
|
||||||
|
'node_modules/jquery-confirm/dist/jquery-confirm.min.js',
|
||||||
|
'node_modules/jquery.cookie/jquery.cookie.js',
|
||||||
|
'node_modules/jquery.filer/js/jquery.filer.min.js',
|
||||||
|
'node_modules/jquery-file-download/src/Scripts/jquery.fileDownload.js',
|
||||||
|
'node_modules/jquery-jeditable/dist/jquery.jeditable.min.js',
|
||||||
|
'node_modules/jquery.quicksearch/dist/jquery.quicksearch.min.js',
|
||||||
|
'node_modules/jquery.nicescroll/dist/jquery.nicescroll.js',
|
||||||
|
'node_modules/jquery-slimscroll/jquery.slimscroll.min.js',
|
||||||
|
'node_modules/handlebars/dist/handlebars.min.js',
|
||||||
|
'node_modules/swag/lib/swag.min.js',
|
||||||
|
'node_modules/multiselect/js/jquery.multi-select.js',
|
||||||
|
'node_modules/screenfull/dist/screenfull.js',
|
||||||
|
'node_modules/underscore/underscore-min.js',
|
||||||
|
]
|
||||||
|
|
||||||
|
var jsMain = [
|
||||||
|
jsCompat,
|
||||||
|
jsCoreInclude,
|
||||||
|
jsBundle,
|
||||||
|
]
|
||||||
|
|
||||||
|
var cssPrint = [
|
||||||
|
// 'node_modules/bootstrap/dist/css/bootstrap.min.css',
|
||||||
|
'cssIcons',
|
||||||
|
'resources/shop/print.css'
|
||||||
|
]
|
||||||
|
|
||||||
|
var cssBundle = [
|
||||||
|
'node_modules/bootstrap/dist/css/bootstrap.min.css',
|
||||||
|
'node_modules/animate.css/animate.min.css',
|
||||||
|
'node_modules/dropzone/dist/min/dropzone.min.css',
|
||||||
|
'node_modules/daterangepicker/daterangepicker.css',
|
||||||
|
'node_modules/jquery-confirm/dist/jquery-confirm.min.css',
|
||||||
|
'node_modules/bootstrap-datepicker/dist/css/bootstrap-datepicker3.css',
|
||||||
|
'node_modules/bootstrap-sweetalert/dist/sweetalert.css',
|
||||||
|
'node_modules/bootstrap4-toggle/css/bootstrap4-toggle.min.css',
|
||||||
|
'node_modules/@claviska/jquery-minicolors/jquery.minicolors.css',
|
||||||
|
'node_modules/jquery.filer/css/jquery.filer.css',
|
||||||
|
'node_modules/jquery.filer/css/themes/jquery.filer-dragdropbox-theme.css',
|
||||||
|
'node_modules/jquery.filer/assets/fonts/jquery.filer-icons/jquery-filer.css',
|
||||||
|
]
|
||||||
|
|
||||||
|
var cssIcons = [
|
||||||
|
'node_modules/@fortawesome/fontawesome-free/css/fontawesome.min.css',
|
||||||
|
]
|
||||||
|
|
||||||
|
var cssMain = [
|
||||||
|
cssBundle,
|
||||||
|
cssIcons,
|
||||||
|
'resources/shop/css/main.css',
|
||||||
]
|
]
|
||||||
|
|
||||||
var jsDataTables = [
|
var jsDataTables = [
|
||||||
'node_modules/jszip/dist/jszip.min.js',
|
'node_modules/jszip/dist/jszip.min.js',
|
||||||
'node_modules/pdfmake/build/pdfmake.min.js',
|
'node_modules/pdfmake/build/pdfmake.min.js',
|
||||||
'node_modules/pdfmake/build/vfs_fonts.js',
|
'node_modules/pdfmake/build/vfs_fonts.js',
|
||||||
'node_modules/datatables/media/js/jquery.dataTables.min.js',
|
'node_modules/datatables.net/js/jquery.dataTables.min.js',
|
||||||
'node_modules/datatables.net-bs4/js/dataTables.bootstrap4.min.js',
|
'node_modules/datatables.net-bs4/js/dataTables.bootstrap4.min.js',
|
||||||
'node_modules/datatables.net-autofill/js/autoFill.min.js',
|
'node_modules/datatables.net-autofill/js/dataTables.autoFill.min.js',
|
||||||
'node_modules/datatables.net-autofill/js/autoFill.bootstrap.min.js',
|
'node_modules/datatables.net-autofill-bs4/js/autoFill.bootstrap4.min.js',
|
||||||
'node_modules/datatables.net-buttons/js/dataTables.buttons.min.js',
|
'node_modules/datatables.net-buttons/js/dataTables.buttons.min.js',
|
||||||
'node_modules/datatables.net-buttons-bs4/js/buttons.bootstrap4.min.js',
|
'node_modules/datatables.net-buttons-bs4/js/buttons.bootstrap4.min.js',
|
||||||
'node_modules/datatables.net-buttons/js/buttons.html5.min.js',
|
'node_modules/datatables.net-buttons/js/buttons.html5.min.js',
|
||||||
'node_modules/datatables.net-buttons/js/buttons.print.min.js',
|
'node_modules/datatables.net-buttons/js/buttons.print.min.js',
|
||||||
'node_modules/datatables.net-buttons/js/buttons.colVis.min.js',
|
'node_modules/datatables.net-buttons/js/buttons.colVis.min.js',
|
||||||
'node_modules/datatables.net-colreorder/js/dataTables.colReorder.min.js',
|
'node_modules/datatables.net-colreorder/js/dataTables.colReorder.min.js',
|
||||||
'node_modules/datatables.net-colreorder-bs4/js/dataTables.colReorder-bs4.min.js',
|
'node_modules/datatables.net-colreorder-bs4/js/colReorder.bootstrap4.min.js',
|
||||||
'node_modules/datatables.net-fixedheader/js/dataTables.fixedHeader.min.js',
|
'node_modules/datatables.net-fixedheader/js/dataTables.fixedHeader.min.js',
|
||||||
'node_modules/datatables.net-fixedheader-bs4/js/fixedHeader.bootstrap4.min.js',
|
'node_modules/datatables.net-fixedheader-bs4/js/fixedHeader.bootstrap4.min.js',
|
||||||
'node_modules/datatables.net-fixedcolumns/js/dataTables.fixedColumns.min.js',
|
'node_modules/datatables.net-fixedcolumns/js/dataTables.fixedColumns.min.js',
|
||||||
@@ -124,21 +135,18 @@ var jsDataTables = [
|
|||||||
'node_modules/datatables.net-keytable-bs4/js/keyTable.bootstrap4.min.js',
|
'node_modules/datatables.net-keytable-bs4/js/keyTable.bootstrap4.min.js',
|
||||||
'node_modules/datatables.net-responsive/js/dataTables.responsive.min.js',
|
'node_modules/datatables.net-responsive/js/dataTables.responsive.min.js',
|
||||||
'node_modules/datatables.net-rowreorder/js/dataTables.rowReorder.min.js',
|
'node_modules/datatables.net-rowreorder/js/dataTables.rowReorder.min.js',
|
||||||
'node_modules/datatables.net-rowreorder-bs4/js/dataTables.rowReorder.botstrap4.min.js',
|
'node_modules/datatables.net-rowreorder-bs4/js/rowReorder.bootstrap4.min.js',
|
||||||
'node_modules/datatables.net-scroller/js/dataTables.scroller.min.js',
|
'node_modules/datatables.net-scroller/js/dataTables.scroller.min.js',
|
||||||
'node_modules/datatables.net-scroller-bs4/js/scroller.bootstrap4.min.js',
|
'node_modules/datatables.net-scroller-bs4/js/scroller.bootstrap4.min.js',
|
||||||
'node_modules/datatables.net-select/js/dataTables.select.min.js',
|
'node_modules/datatables.net-select/js/dataTables.select.min.js',
|
||||||
'node_modules/datatables.net-select-bs4/js/select.bootstrap4.min.js',
|
'node_modules/datatables.net-select-bs4/js/select.bootstrap4.min.js',
|
||||||
'node_modules/yadcf/jquery.dataTables.yadcf.js',
|
/* 'node_modules/yadcf/jquery.dataTables.yadcf.js', */
|
||||||
'build/js/modal.js',
|
|
||||||
'build/js/datatables.js',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
var cssDataTables = [
|
var cssDataTables = [
|
||||||
// 'node_modules/datatables/media/css/jquery.dataTables.min.css',
|
|
||||||
'node_modules/datatables.net-bs4/css/dataTables.bootstrap4.min.css',
|
'node_modules/datatables.net-bs4/css/dataTables.bootstrap4.min.css',
|
||||||
|
'node_modules/datatables.net-autofill-bs4/css/autoFill.bootstrap4.min.css',
|
||||||
'node_modules/dataTables.net-buttons-bs4/css/buttons.bootstrap4.min.css',
|
'node_modules/dataTables.net-buttons-bs4/css/buttons.bootstrap4.min.css',
|
||||||
'node_modules/datatables.net-autofill/css/autoFill.bootstrap.min.css',
|
|
||||||
'node_modules/datatables.net-colreorder-bs4/css/colReorder.bootstrap4.min.css',
|
'node_modules/datatables.net-colreorder-bs4/css/colReorder.bootstrap4.min.css',
|
||||||
'node_modules/datatables.net-fixedheader-bs4/css/fixedHeader.bootstrap4.min.css',
|
'node_modules/datatables.net-fixedheader-bs4/css/fixedHeader.bootstrap4.min.css',
|
||||||
'node_modules/datatables.net-fixedcolumns-bs4/css/fixedColumns.bootstrap4.min.css',
|
'node_modules/datatables.net-fixedcolumns-bs4/css/fixedColumns.bootstrap4.min.css',
|
||||||
@@ -146,18 +154,9 @@ var cssDataTables = [
|
|||||||
'node_modules/datatables.net-rowreorder-bs4/css/rowReorder.bootstrap4.min.css',
|
'node_modules/datatables.net-rowreorder-bs4/css/rowReorder.bootstrap4.min.css',
|
||||||
'node_modules/datatables.net-scroller-bs4/css/scroller.bootstrap4.min.css',
|
'node_modules/datatables.net-scroller-bs4/css/scroller.bootstrap4.min.css',
|
||||||
'node_modules/datatables.net-select-bs4/css/select.bootstrap4.min.css',
|
'node_modules/datatables.net-select-bs4/css/select.bootstrap4.min.css',
|
||||||
'node_modules/yadcf/jquery.dataTables.yadcf.css',
|
/* 'node_modules/yadcf/jquery.dataTables.yadcf.css', */
|
||||||
'build/dataTables.bootstrap.min.css',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
var jsCalendar = [
|
|
||||||
'node_modules/fullcalendar/dist/fullcalendar.min.js',
|
|
||||||
'node_modules/fullcalendar/dist/locale/fr.js'
|
|
||||||
]
|
|
||||||
|
|
||||||
var cssCalendar = [
|
|
||||||
'node_modules/fullcalendar/dist/fullcalendar.min.css',
|
|
||||||
]
|
|
||||||
|
|
||||||
module.exports = function(grunt) {
|
module.exports = function(grunt) {
|
||||||
|
|
||||||
@@ -171,65 +170,56 @@ module.exports = function(grunt) {
|
|||||||
build: {
|
build: {
|
||||||
files: [
|
files: [
|
||||||
{
|
{
|
||||||
'public/js/main.min.js': jsMain,
|
'public/assets/js/main.min.js': jsMain,
|
||||||
'public/js/site.js': jsSite,
|
'public/assets/plugins/datatables.min.js': jsDataTables,
|
||||||
'public/js/datatables.min.js': jsDataTables,
|
'public/assets/plugins/adminlte/adminlte.min.js': jsAdminLTE,
|
||||||
'public/js/calendar.min.js': jsCalendar
|
'public/js/site.min.js': jsSite,
|
||||||
},
|
|
||||||
{
|
|
||||||
expand: true,
|
|
||||||
cwd: 'build/js/modules',
|
|
||||||
src: '**/*.js',
|
|
||||||
dest: 'public/js',
|
|
||||||
rename: function (dest, src) {
|
|
||||||
return dest + '/' + src.replace('.js', '.min.js');
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
eslint: {
|
eslint: {
|
||||||
target: ['build/js/*']
|
target: ['public/assets/js/*']
|
||||||
},
|
},
|
||||||
webstandards: {
|
webstandards: {
|
||||||
'src': ['build/js/*']
|
'src': ['public/assets/js/*']
|
||||||
},
|
},
|
||||||
concat: {
|
concat: {
|
||||||
options: {
|
options: {
|
||||||
separator: '\n'
|
separator: '\n'
|
||||||
},
|
},
|
||||||
mainjs: {
|
|
||||||
src: jsMain,
|
|
||||||
dest: 'public/js/main.min.js'
|
|
||||||
},
|
|
||||||
maincss: {
|
|
||||||
src: cssMain,
|
|
||||||
dest: 'public/css/main.min.css'
|
|
||||||
},
|
|
||||||
sitejs: {
|
|
||||||
src: jsSite,
|
|
||||||
dest: 'public/js/site.min.js'
|
|
||||||
},
|
|
||||||
sitecss: {
|
sitecss: {
|
||||||
src: cssSite,
|
src: cssSite,
|
||||||
dest: 'public/css/site.min.css'
|
dest: 'public/css/site.min.css'
|
||||||
},
|
},
|
||||||
|
siteJs: {
|
||||||
|
src: jsSite,
|
||||||
|
dest: 'public/js/site.min.js'
|
||||||
|
},
|
||||||
|
mainjs: {
|
||||||
|
src: jsMain,
|
||||||
|
dest: 'public/assets/js/main.min.js'
|
||||||
|
},
|
||||||
|
maincss: {
|
||||||
|
src: cssMain,
|
||||||
|
dest: 'public/assets/css/main.min.css'
|
||||||
|
},
|
||||||
|
printcss: {
|
||||||
|
src: cssPrint,
|
||||||
|
dest: 'public/assets/css/print.min.css'
|
||||||
|
},
|
||||||
|
adminltejs: {
|
||||||
|
src: jsAdminLTE,
|
||||||
|
dest: 'public/assets/plugins/adminlte/adminlte.min.js'
|
||||||
|
},
|
||||||
datatablesjs: {
|
datatablesjs: {
|
||||||
src: jsDataTables,
|
src: jsDataTables,
|
||||||
dest: 'public/js/datatables.min.js'
|
dest: 'public/assets/plugins/datatables.min.js'
|
||||||
},
|
},
|
||||||
datatablescss: {
|
datatablescss: {
|
||||||
src: cssDataTables,
|
src: cssDataTables,
|
||||||
dest: 'public/css/datatables.min.css'
|
dest: 'public/assets/plugins/datatables.min.css'
|
||||||
},
|
},
|
||||||
calendarjs: {
|
|
||||||
src: jsCalendar,
|
|
||||||
dest: 'public/js/calendar.min.js'
|
|
||||||
},
|
|
||||||
calendarcss: {
|
|
||||||
src: cssCalendar,
|
|
||||||
dest: 'public/css/calendar.min.css'
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
cssmin: {
|
cssmin: {
|
||||||
options: {
|
options: {
|
||||||
@@ -239,7 +229,13 @@ module.exports = function(grunt) {
|
|||||||
target: {
|
target: {
|
||||||
files: [
|
files: [
|
||||||
{
|
{
|
||||||
'public/css/main.min.css': cssMain
|
'public/assets/css/main.min.css': cssMain
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'public/assets/css/print.min.css': cssPrint
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'public/css/site.min.css': cssSite
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -249,33 +245,57 @@ module.exports = function(grunt) {
|
|||||||
files: [
|
files: [
|
||||||
{
|
{
|
||||||
expand: true,
|
expand: true,
|
||||||
cwd: 'node_modules/bootstrap/dist/fonts/',
|
cwd: 'node_modules/@fortawesome/fontawesome-free/webfonts/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/webfonts/'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'resources/shop/fonts',
|
||||||
src: ['**'],
|
src: ['**'],
|
||||||
dest: 'public/fonts/'
|
dest: 'public/fonts/'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
expand: true,
|
expand: true,
|
||||||
cwd: 'node_modules/font-awesome/fonts/',
|
cwd: 'resources/shop/img',
|
||||||
src: ['**'],
|
src: ['**'],
|
||||||
dest: 'public/fonts/'
|
dest: 'public/img/'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
expand: true,
|
expand: true,
|
||||||
cwd: 'node_modules/summernote/dist/font/',
|
cwd: 'resources/shop/lang',
|
||||||
src: ['**'],
|
src: ['**'],
|
||||||
dest: 'public/css/font/'
|
dest: 'public/assets/lang/'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
expand: true,
|
expand: true,
|
||||||
cwd: 'node_modules/datatables/media/images/',
|
cwd: 'resources/shop/plugins',
|
||||||
src: ['**'],
|
src: ['**'],
|
||||||
dest: 'public/images/'
|
dest: 'public/assets/plugins/'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
expand: true,
|
expand: true,
|
||||||
cwd: 'node_modules/bootstrap4-toggle/',
|
cwd: 'resources/shop/assets/tpl',
|
||||||
src: ['**'],
|
src: ['**'],
|
||||||
dest: 'public/assets/plugins/bootstrap4-toggle',
|
dest: 'public/assets/tpl/'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/owp.glyphicons/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/fonts/glyphicons'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/@claviska/jquery-minicolors/',
|
||||||
|
src: ['jquery.minicolors.png'],
|
||||||
|
dest: 'public/assets/css/'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/@claviska/jquery-minicolors/',
|
||||||
|
src: ['jquery.minicolors.*'],
|
||||||
|
dest: 'public/assets/plugins/jquery-minicolors',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
expand: true,
|
expand: true,
|
||||||
@@ -285,19 +305,252 @@ module.exports = function(grunt) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
expand: true,
|
expand: true,
|
||||||
cwd: 'build/img/',
|
cwd: 'node_modules/jquery.quicksearch/dist/',
|
||||||
|
src: ['jquery.quicksearch.min.js.map'],
|
||||||
|
dest: 'public/assets/js/'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/jquery.quicksearch/dist/',
|
||||||
|
src: ['**/*.map'],
|
||||||
|
dest: 'public/js'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/pdfmake/build/',
|
||||||
|
src: ['pdfmake.min.js.map'],
|
||||||
|
dest: 'public/assets/plugins/'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/daterangepicker/',
|
||||||
|
src: ['daterangepicker.css'],
|
||||||
|
dest: 'public/assets/plugins/daterangepicker',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/daterangepicker/',
|
||||||
|
src: ['daterangepicker.js'],
|
||||||
|
dest: 'public/assets/plugins/daterangepicker',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/chart.js/dist/',
|
||||||
src: ['**'],
|
src: ['**'],
|
||||||
dest: 'public/img/'
|
dest: 'public/assets/plugins/chartjs'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/highcharts/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/highcharts'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/@highcharts/map-collection/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/highcharts/map',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/nestable2/dist/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/nestable2'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/bootstrap-autocomplete/dist/latest/',
|
||||||
|
src: ['bootstrap-autocomplete.min.js'],
|
||||||
|
dest: 'public/assets/plugins/autocomplete'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/slick-carousel/slick/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/slick',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/jquery-slimscroll/',
|
||||||
|
src: ['jquery.slimscroll.min.js'],
|
||||||
|
dest: 'public/assets/plugins',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/jquery.nicescroll/dist/',
|
||||||
|
src: ['jquery.nicescroll.min.js'],
|
||||||
|
dest: 'public/assets/plugins',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/bootstrap4-toggle/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/bootstrap4-toggle',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/pdfobject/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/pdfobject',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'resources/shop/plugins/pdfjs/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/pdfjs',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/bootstrap4-duallistbox/dist/',
|
||||||
|
src: ['*.min.*'],
|
||||||
|
dest: 'public/assets/plugins/bootstrap4-duallistbox',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/select2/dist/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/select2',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/tempusdominus-bootstrap-4/build/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/datepicker',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/moment/min/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/moment',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/currency.js/dist/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/currency',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/bootstrap-fileinput/css/',
|
||||||
|
src: ['**/*.min.css'],
|
||||||
|
dest: 'public/assets/plugins/bootstrap-fileinput/css',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/bootstrap-fileinput/js/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/bootstrap-fileinput/js',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/bootstrap-fileinput/img/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/bootstrap-fileinput/img',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/bootstrap-fileinput/themes/fa/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/bootstrap-fileinput/themes/fa',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/bootstrap-fileinput/themes/fas/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/bootstrap-fileinput/themes/fas',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'resources/shop/js/include/plugins/datatables_lang/',
|
||||||
|
src: ['*.json'],
|
||||||
|
dest: 'public/assets/plugins/datatables_lang',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/tinymce/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/tinymce',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'vendor/sebastienheyd/boilerplate/src/public/plugins/tinymce/plugins/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/tinymce/plugins',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'vendor/sebastienheyd/boilerplate/src/resources/assets/js/vendor/tinymce/plugins/stickytoolbar/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/tinymce/plugins/stickytoolbar',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'vendor/sebastienheyd/boilerplate/src/resources/assets/js/vendor/tinymce/langs/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/tinymce/langs',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'vendor/sebastienheyd/boilerplate/src/resources/assets/js/vendor/tinymce/skins/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/tinymce/skins/ui',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'vendor/sebastienheyd/boilerplate/src/public/plugins/tinymce/skins/ui/boilerplate/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/tinymce/skins/ui/boilerplate',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/icheck-bootstrap/',
|
||||||
|
src: ['icheck-bootstrap.min.css'],
|
||||||
|
dest: 'public/assets/plugins/icheck/'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/jstree/dist/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/jstree/'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/jquery.fancytree/dist/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/fancytree'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/jqtree/',
|
||||||
|
src: ['tree.jquery.js'],
|
||||||
|
dest: 'public/assets/plugins/jqtree'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/jqtree/',
|
||||||
|
src: ['jqtree.css'],
|
||||||
|
dest: 'public/assets/plugins/jqtree'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'node_modules/sidr/dist/',
|
||||||
|
src: ['**'],
|
||||||
|
dest: 'public/assets/plugins/sidr'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
expand: true,
|
||||||
|
cwd: 'resources/shop/js/include/',
|
||||||
|
src: ['boilerplate.js'],
|
||||||
|
dest: 'public/assets/plugins',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
dist: {
|
dist: {
|
||||||
files: [
|
files: ['resources/shop/js/*', 'resources/shop/css/*'],
|
||||||
'build/*',
|
// tasks: ['concat', 'copy']
|
||||||
],
|
tasks: ['concat']
|
||||||
tasks: ['concat', 'copy']
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
22
app/Charts/Shop/Order.php
Normal file
22
app/Charts/Shop/Order.php
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Charts\Shop;
|
||||||
|
|
||||||
|
use Akaunting\Apexcharts\Chart;
|
||||||
|
use App\Repositories\Shop\OrderMetrics;
|
||||||
|
|
||||||
|
class Order
|
||||||
|
{
|
||||||
|
public static function getMonthly()
|
||||||
|
{
|
||||||
|
$data = OrderMetrics::getTotalMonthly();
|
||||||
|
|
||||||
|
return (new Chart)->setType('bar')
|
||||||
|
->setWidth('100%')
|
||||||
|
->setHeight(300)
|
||||||
|
->setLabels(array_keys($data))
|
||||||
|
->setDataset('CA', 'bar', array_values($data))
|
||||||
|
->setColor('#334F17')
|
||||||
|
->setStrokeColors(['#527C39']);
|
||||||
|
}
|
||||||
|
}
|
||||||
24
app/Console/Commands/FixSlug.php
Normal file
24
app/Console/Commands/FixSlug.php
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use App\Models\Shop\Article;
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
|
||||||
|
class FixSlug extends Command
|
||||||
|
{
|
||||||
|
protected $signature = 'FixSlug';
|
||||||
|
|
||||||
|
protected $description = 'Slugify articles';
|
||||||
|
|
||||||
|
public function handle()
|
||||||
|
{
|
||||||
|
$articles = Article::all();
|
||||||
|
foreach ($articles as $article) {
|
||||||
|
$article->slug = null;
|
||||||
|
$article->update(['name' => $article->name]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
27
app/Console/Commands/addTagGroup.php
Normal file
27
app/Console/Commands/addTagGroup.php
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use App\Models\Shop\Tag;
|
||||||
|
use App\Repositories\Shop\TagGroups;
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
|
||||||
|
class AddTagGroup extends Command
|
||||||
|
{
|
||||||
|
protected $signature = 'addTagGroup';
|
||||||
|
|
||||||
|
protected $description = 'Migrations of tags';
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function handle()
|
||||||
|
{
|
||||||
|
$tags = Tag::withTrashed()->get();
|
||||||
|
foreach ($tags as $tag) {
|
||||||
|
$tag->update(['group' => TagGroups::getName($tag->tag_group_id)]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
30
app/Console/Commands/untranslateShelves.php
Normal file
30
app/Console/Commands/untranslateShelves.php
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use App\Models\Shop\Category;
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
|
||||||
|
class UntranslateShelves extends Command
|
||||||
|
{
|
||||||
|
protected $signature = 'untranslateShelves';
|
||||||
|
|
||||||
|
protected $description = 'Migrations of shelves';
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function handle()
|
||||||
|
{
|
||||||
|
$categories = Category::all();
|
||||||
|
foreach ($categories as $category) {
|
||||||
|
$trans = json_decode($category->name, true);
|
||||||
|
$name = $trans['fr'];
|
||||||
|
$trans = $category->description ? json_decode($category->description, true) : false;
|
||||||
|
$description = $trans ? $trans['fr'] : '';
|
||||||
|
$category->update(['name' => $name, 'description' => $description]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
28
app/Console/Commands/untranslateTags.php
Normal file
28
app/Console/Commands/untranslateTags.php
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use App\Models\Shop\Tag;
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
|
||||||
|
class UntranslateTags extends Command
|
||||||
|
{
|
||||||
|
protected $signature = 'untranslateTags';
|
||||||
|
|
||||||
|
protected $description = 'Migrations of tags';
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function handle()
|
||||||
|
{
|
||||||
|
$tags = Tag::withTrashed()->get();
|
||||||
|
foreach ($tags as $tag) {
|
||||||
|
$trans = json_decode($tag->name, true);
|
||||||
|
$name = $trans['fr'];
|
||||||
|
$tag->update(['name' => $name]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,36 +7,18 @@ use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
|||||||
|
|
||||||
class Kernel extends ConsoleKernel
|
class Kernel extends ConsoleKernel
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* The Artisan commands provided by your application.
|
|
||||||
*
|
|
||||||
* @var array
|
|
||||||
*/
|
|
||||||
protected $commands = [
|
protected $commands = [
|
||||||
//
|
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
|
||||||
* Define the application's command schedule.
|
|
||||||
*
|
|
||||||
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
protected function schedule(Schedule $schedule)
|
protected function schedule(Schedule $schedule)
|
||||||
{
|
{
|
||||||
// $schedule->command('inspire')
|
$schedule->command(\Spatie\Health\Commands\RunHealthChecksCommand::class)->everyMinute();
|
||||||
// ->hourly();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Register the commands for the application.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
protected function commands()
|
protected function commands()
|
||||||
{
|
{
|
||||||
$this->load(__DIR__.'/Commands');
|
$this->load(__DIR__.'/Commands');
|
||||||
|
|
||||||
require base_path('routes/console.php');
|
include base_path('routes/console.php');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
13
app/Contracts/Commentator.php
Normal file
13
app/Contracts/Commentator.php
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace BeyondCode\Comments\Contracts;
|
||||||
|
|
||||||
|
interface Commentator
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Check if a comment for a specific model needs to be approved.
|
||||||
|
*
|
||||||
|
* @param mixed $model
|
||||||
|
*/
|
||||||
|
public function needsCommentApproval($model): bool;
|
||||||
|
}
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Datatables\Botanic;
|
|
||||||
|
|
||||||
use Yajra\DataTables\Html\Column;
|
|
||||||
use App\Datatables\ParentDataTable as DataTable;
|
|
||||||
use App\Models\Botanic\Family;
|
|
||||||
|
|
||||||
class FamiliesDataTable extends DataTable
|
|
||||||
{
|
|
||||||
public $model_name = 'families';
|
|
||||||
|
|
||||||
public function query(Family $model)
|
|
||||||
{
|
|
||||||
$model = $model::withCount(['genres','species','varieties']);
|
|
||||||
return self::buildQuery($model);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function getColumns()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
Column::make('name')->title('Nom'),
|
|
||||||
Column::make('alias'),
|
|
||||||
Column::make('latin'),
|
|
||||||
Column::make('genres_count')->title('Nb genres')->searchable(false)->addClass('text-right'),
|
|
||||||
Column::make('species_count')->title('Nb espèces')->searchable(false)->addClass('text-right'),
|
|
||||||
Column::make('varieties_count')->title('Nb variétés')->searchable(false)->addClass('text-right'),
|
|
||||||
self::makeColumnButtons(),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Datatables\Botanic;
|
|
||||||
|
|
||||||
use Yajra\DataTables\Html\Column;
|
|
||||||
use App\Datatables\ParentDataTable as DataTable;
|
|
||||||
use App\Models\Botanic\Specie;
|
|
||||||
|
|
||||||
class SpeciesDataTable extends DataTable
|
|
||||||
{
|
|
||||||
public $model_name = 'species';
|
|
||||||
|
|
||||||
public function query(Specie $model)
|
|
||||||
{
|
|
||||||
$model = $model::withCount('varieties')->with('genre');
|
|
||||||
return self::buildQuery($model);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function modifier($datatables)
|
|
||||||
{
|
|
||||||
$datatables
|
|
||||||
->editColumn('genre_name', function(Specie $specie) {
|
|
||||||
return $specie->genre ? $specie->genre->name : '';
|
|
||||||
})
|
|
||||||
->rawColumns(['genre_name', 'action'])
|
|
||||||
;
|
|
||||||
return Parent::modifier($datatables);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
protected function getColumns()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
Column::make('name')->title('Nom'),
|
|
||||||
Column::make('alias'),
|
|
||||||
Column::make('genre.name')->data('genre_name')->title('Genre'),
|
|
||||||
Column::make('latin'),
|
|
||||||
Column::make('varieties_count')->title('Nb variétés')->searchable(false)->addClass('text-right'),
|
|
||||||
self::makeColumnButtons(),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Datatables\Botanic;
|
|
||||||
|
|
||||||
use Yajra\DataTables\Html\Column;
|
|
||||||
use App\Datatables\ParentDataTable as DataTable;
|
|
||||||
use App\Models\Botanic\Variety;
|
|
||||||
|
|
||||||
class VarietiesDataTable extends DataTable
|
|
||||||
{
|
|
||||||
public $model_name = 'varieties';
|
|
||||||
|
|
||||||
public function query(Variety $model)
|
|
||||||
{
|
|
||||||
// $model = $model::with('specie')->withCount('Articles')->select('botanic_varieties.*');
|
|
||||||
$model = $model::joinRelations('Specie')->select('botanic_varieties.*','botanic_species.name as specie_name')->with('Specie')->withCount('Articles');
|
|
||||||
return self::buildQuery($model);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function getColumns()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
Column::make('Specie.name')->data('specie_name')->title('Espèce'),
|
|
||||||
Column::make('name')->title('Nom'),
|
|
||||||
Column::make('articles_count')->title('Nb articles')->class('text-right')->searchable(false),
|
|
||||||
self::makeColumnButtons(),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,204 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Datatables;
|
|
||||||
|
|
||||||
use Yajra\DataTables\Html\Button;
|
|
||||||
use Yajra\DataTables\Html\Column;
|
|
||||||
use Yajra\DataTables\Html\Editor\Editor;
|
|
||||||
use Yajra\DataTables\Html\Editor\Fields;
|
|
||||||
use Yajra\DataTables\Services\DataTable;
|
|
||||||
|
|
||||||
class ParentDataTable extends DataTable
|
|
||||||
{
|
|
||||||
public $rowReorder = true;
|
|
||||||
public $rowReorderSelector; // ['selector' => 'tr']
|
|
||||||
public $colReorder = false;
|
|
||||||
public $fixedColumns = false;
|
|
||||||
public $scrollX = false;
|
|
||||||
public $scrollCollapse = true;
|
|
||||||
public $sortedColumn = 0;
|
|
||||||
public $sortedOrder = 'asc';
|
|
||||||
public $stateSave = false;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Build DataTable class.
|
|
||||||
*
|
|
||||||
* @param mixed $query Results from query() method.
|
|
||||||
* @return \Yajra\DataTables\DataTableAbstract
|
|
||||||
*/
|
|
||||||
public function dataTable($query)
|
|
||||||
{
|
|
||||||
return $this->modifier(datatables()->eloquent($query));
|
|
||||||
}
|
|
||||||
|
|
||||||
public function modifier($datatables)
|
|
||||||
{
|
|
||||||
return $this->addButtons($datatables->setRowId('{{$id}}'));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add buttons DataTable class.
|
|
||||||
*
|
|
||||||
* @param mixed $query Results from query() method.
|
|
||||||
* @return \Yajra\DataTables\DataTableAbstract
|
|
||||||
*/
|
|
||||||
public function addButtons($datatables)
|
|
||||||
{
|
|
||||||
return $datatables->addColumn('action', $this->getHtmlButtons());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getHtmlButtons()
|
|
||||||
{
|
|
||||||
$buttons = '';
|
|
||||||
|
|
||||||
// $buttons .= '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-secondary btn-show mr-2"><i class="fa fa-fw fa-eye"></i></button>';
|
|
||||||
// $buttons .= '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-primary btn-edit mr-2"><i class="fa fa-fw fa-leaf-alt"></i></button>';
|
|
||||||
$buttons .= '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-primary btn-edit mr-2"><i class="fa fa-fw fa-pencil-alt"></i></button>';
|
|
||||||
$buttons .= '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-danger btn-del"><i class="fa fa-fw fa-trash"></i></button>';
|
|
||||||
return $buttons;
|
|
||||||
// return view('components.datatables.buttons.row_action');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function makeColumnButtons()
|
|
||||||
{
|
|
||||||
return Column::computed('action')
|
|
||||||
->title('')
|
|
||||||
->exportable(false)
|
|
||||||
->printable(false)
|
|
||||||
->searchable(false)
|
|
||||||
->width("74")
|
|
||||||
->addClass('text-center text-nowrap');
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function isFilteredByField($field)
|
|
||||||
{
|
|
||||||
return (request()->has('filters.' . $field)) ? request()->input('filters.'. $field) : (request()->has($field) ? request()->input($field) : false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get query source of dataTable.
|
|
||||||
*
|
|
||||||
* @param \App\Family $model
|
|
||||||
* @return \Illuminate\Database\Eloquent\Builder
|
|
||||||
*/
|
|
||||||
public function buildQuery($model)
|
|
||||||
{
|
|
||||||
return $model->newQuery();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Optional method if you want to use html builder.
|
|
||||||
*
|
|
||||||
* @return \Yajra\DataTables\Html\Builder
|
|
||||||
*/
|
|
||||||
public function html()
|
|
||||||
{
|
|
||||||
return $this->buildHtml(strtolower($this->model_name) . '-table');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Optional method if you want to use html builder.
|
|
||||||
*
|
|
||||||
* @return \Yajra\DataTables\Html\Builder
|
|
||||||
*/
|
|
||||||
public function buildHtml($table_id = false, $selector = false)
|
|
||||||
{
|
|
||||||
$table_id = $table_id ? $table_id : strtolower($this->model_name) . '-table';
|
|
||||||
$selector = $selector ? $selector : '#' . $this->model_name . '-filters';
|
|
||||||
return $this->builder()
|
|
||||||
->setTableId($table_id)
|
|
||||||
->parameters($this->getParameters())
|
|
||||||
->columns($this->getColumns())
|
|
||||||
->ajax([
|
|
||||||
'data' => 'function(d) { d.filters = $("' . $selector . '").serializeJSON(); }',
|
|
||||||
'url' => isset($this->url) ? $this->url : ''
|
|
||||||
])
|
|
||||||
->dom($this->getDom())
|
|
||||||
->orderBy($this->sortedColumn,$this->sortedOrder)
|
|
||||||
->buttons($this->getButtons());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getButtons() {
|
|
||||||
return [
|
|
||||||
Button::make('export'),
|
|
||||||
Button::make('print'),
|
|
||||||
Button::make('colvis'),
|
|
||||||
Button::make('columnsToggle')
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getParameters()
|
|
||||||
{
|
|
||||||
$data = [
|
|
||||||
'pageLength' => 5,
|
|
||||||
'scrollX' => $this->scrollX,
|
|
||||||
'scrollCollapse' => $this->scrollCollapse,
|
|
||||||
'searchDelay' => 500,
|
|
||||||
'colReorder' => $this->colReorder,
|
|
||||||
'fixedColumns' => $this->fixedColumns,
|
|
||||||
// 'autoWidth' => false,
|
|
||||||
'stateSave' => $this->stateSave
|
|
||||||
];
|
|
||||||
if ($this->rowReorder) {
|
|
||||||
$data['rowReorder'] = ['selector' => $this->rowReorderSelector];
|
|
||||||
}
|
|
||||||
return $data;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDom()
|
|
||||||
{
|
|
||||||
$dom = '';
|
|
||||||
// $dom .= $this->getDatatablesHeaderDefault();
|
|
||||||
$dom .= "rt";
|
|
||||||
$dom .= $this->getDatatablesFooterDefault();
|
|
||||||
return $dom;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDatatablesHeader() {
|
|
||||||
return view('components.datatables.header');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDatatablesHeaderDefault() {
|
|
||||||
// return "<div class'row'><div class='col'></div></div>";
|
|
||||||
/*
|
|
||||||
|
|
||||||
$dom = 't<"row datatable-pager light"<"col-md-12"'
|
|
||||||
. '<"datatable-more-export-buttons filter-buttons pull-left">'
|
|
||||||
. '<"datatable-more-export-favorites-buttons filter-buttons pull-left">'
|
|
||||||
. '<"datatable-more-export-basket-buttons filter-buttons pull-left">'
|
|
||||||
. '<"datatable-download-buttons filter-buttons pull-left">'
|
|
||||||
. '>>'
|
|
||||||
. '<"dt-toolbar-footer"<"col"i><"col pull-right datatable-pager light nopadding-right"p>>';
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
$dom = "<'row dt-toolbar-header'<'col-lg-4'l><'col-lg-4'B><'col-lg-4 text-right add'f>>";
|
|
||||||
return $dom;
|
|
||||||
// return 't<"row datatable-pager light"<"col-md-12"<"datatable-more-export-buttons filter-buttons pull-left"><"datatable-more-export-favorites-buttons filter-buttons pull-left"><"datatable-more-export-basket-buttons filter-buttons pull-left"><"datatable-download-buttons filter-buttons pull-left">>><"dt-toolbar-footer"<"col-md-6"i><"col-md-6 pull-right datatable-pager light nopadding-right"p>>';
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDatatablesFooterDefault() {
|
|
||||||
return "<'row pt-3 dt-toolbar-footer'<'col-md-6'i><'col-md-6'p>>";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get filename for export.
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
protected function filename()
|
|
||||||
{
|
|
||||||
return self::buildFilename($this->model_name);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get filename for export.
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
protected function buildFilename($name)
|
|
||||||
{
|
|
||||||
return $name . '_' . date('YmdHis');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Datatables\Shop;
|
|
||||||
|
|
||||||
use Yajra\DataTables\Html\Column;
|
|
||||||
use App\Datatables\ParentDataTable as DataTable;
|
|
||||||
use App\Models\Shop\ArticleFamily;
|
|
||||||
|
|
||||||
class ArticleFamiliesDataTable extends DataTable
|
|
||||||
{
|
|
||||||
public $model_name = 'article_families';
|
|
||||||
|
|
||||||
public function query(ArticleFamily $model)
|
|
||||||
{
|
|
||||||
$model = $model::withCount('Articles');
|
|
||||||
return self::buildQuery($model);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function getColumns()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
Column::make('name')->title('Nom'),
|
|
||||||
Column::make('articles_count')->title('Nb articles')->addClass('text-right'),
|
|
||||||
self::makeColumnButtons(),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Datatables\Shop;
|
|
||||||
|
|
||||||
use Yajra\DataTables\Html\Column;
|
|
||||||
use App\Datatables\ParentDataTable as DataTable;
|
|
||||||
use App\Models\Shop\Article;
|
|
||||||
|
|
||||||
class ArticlesDataTable extends DataTable
|
|
||||||
{
|
|
||||||
public $model_name = 'articles';
|
|
||||||
|
|
||||||
public function query(Article $model)
|
|
||||||
{
|
|
||||||
// $model = $model::with('Family')->select('shop_articles.*','family.name as family_name')->join('shop_article_families as family', 'family.id', '=', 'shop_articles.article_family_id')->groupBy('shop_articles.id');
|
|
||||||
$model = $model::with('article_family')->select('shop_articles.*');
|
|
||||||
// $model = $model::joinRelations('Family')->select('shop_articles.*','shop_article_families.name as family_name');
|
|
||||||
return self::buildQuery($model);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function getColumns()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
Column::make('article_family.name')->title('Famille')->orderable(false),
|
|
||||||
Column::make('name')->title('Nom'),
|
|
||||||
self::makeColumnButtons(),
|
|
||||||
];
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Datatables\Shop;
|
|
||||||
|
|
||||||
use Yajra\DataTables\Html\Column;
|
|
||||||
use App\Datatables\ParentDataTable as DataTable;
|
|
||||||
use App\Models\Shop\Category;
|
|
||||||
|
|
||||||
class CategoriesDataTable extends DataTable
|
|
||||||
{
|
|
||||||
public $model_name = 'categories';
|
|
||||||
|
|
||||||
public function query(Category $model)
|
|
||||||
{
|
|
||||||
$model = $model::withCount('articles');
|
|
||||||
return self::buildQuery($model);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function getColumns()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
Column::make('name')->title('Nom'),
|
|
||||||
Column::make('articles_count')->title('Nb Articles')->class('text-right')->searchable(false),
|
|
||||||
self::makeColumnButtons(),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Datatables\Shop;
|
|
||||||
|
|
||||||
use Yajra\DataTables\Html\Column;
|
|
||||||
use App\Datatables\ParentDataTable as DataTable;
|
|
||||||
use App\Models\Shop\Customer;
|
|
||||||
|
|
||||||
class CustomersDataTable extends DataTable
|
|
||||||
{
|
|
||||||
public $model_name = 'customers';
|
|
||||||
|
|
||||||
public function query(Product $model)
|
|
||||||
{
|
|
||||||
return self::buildQuery($model);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function getColumns()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
Column::make('name')->title('Nom'),
|
|
||||||
Column::make('address')->title('Adresse'),
|
|
||||||
Column::make('zipcode')->title('Code postal'),
|
|
||||||
Column::make('city')->title('Ville'),
|
|
||||||
self::makeColumnButtons(),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Datatables\Shop;
|
|
||||||
|
|
||||||
use Yajra\DataTables\Html\Column;
|
|
||||||
use App\Datatables\ParentDataTable as DataTable;
|
|
||||||
use App\Models\Shop\Invoice;
|
|
||||||
|
|
||||||
class InvoicesDataTable extends DataTable
|
|
||||||
{
|
|
||||||
public $model_name = 'Invoices';
|
|
||||||
|
|
||||||
public function query(Invoice $model)
|
|
||||||
{
|
|
||||||
return self::buildQuery($model);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function getColumns()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
Column::make('status.name'),
|
|
||||||
Column::make('customer.name'),
|
|
||||||
Column::make('total'),
|
|
||||||
self::makeColumnButtons(),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Datatables\Shop;
|
|
||||||
|
|
||||||
use Yajra\DataTables\Html\Column;
|
|
||||||
use App\Datatables\ParentDataTable as DataTable;
|
|
||||||
use App\Models\Shop\Order;
|
|
||||||
|
|
||||||
class OrdersDataTable extends DataTable
|
|
||||||
{
|
|
||||||
public $model_name = 'orders';
|
|
||||||
|
|
||||||
public function query(Product $model)
|
|
||||||
{
|
|
||||||
return self::buildQuery($model);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function getColumns()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
Column::make('name'),
|
|
||||||
self::makeColumnButtons(),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Datatables\Shop;
|
|
||||||
|
|
||||||
use Yajra\DataTables\Html\Column;
|
|
||||||
use App\Datatables\ParentDataTable as DataTable;
|
|
||||||
use App\Models\Shop\Package;
|
|
||||||
|
|
||||||
class PackagesDataTable extends DataTable
|
|
||||||
{
|
|
||||||
public $model_name = 'packages';
|
|
||||||
|
|
||||||
public function query(Package $model)
|
|
||||||
{
|
|
||||||
$model = $model::with(['article_family'])->select('shop_packages.*');
|
|
||||||
$model = self::filterByFamily($model);
|
|
||||||
return self::buildQuery($model);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function filterByFamily($model, $family_id = false)
|
|
||||||
{
|
|
||||||
$family_id = $family_id ? $family_id : self::isFilteredByField('family_id');
|
|
||||||
return $family_id ? $model->byArticleFamily($family_id) : $model;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function getColumns()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
Column::make('article_family.name')->title('Famille d\'articles'),
|
|
||||||
Column::make('value')->title('Valeur'),
|
|
||||||
self::makeColumnButtons(),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Datatables\Shop;
|
|
||||||
|
|
||||||
use Yajra\DataTables\Html\Column;
|
|
||||||
use App\Datatables\ParentDataTable as DataTable;
|
|
||||||
use App\Models\Shop\PriceGenericCategory;
|
|
||||||
|
|
||||||
class PriceGenericCategoriesDataTable extends DataTable
|
|
||||||
{
|
|
||||||
public $model_name = 'price_generic_categories';
|
|
||||||
|
|
||||||
public function query(PriceGenericCategory $model)
|
|
||||||
{
|
|
||||||
$model = $model->withCount('price_generics');
|
|
||||||
return self::buildQuery($model);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function getColumns()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
Column::make('name')->title('Nom'),
|
|
||||||
Column::make('price_generics_count')->title('Nb Tarifs')->class('text-right'),
|
|
||||||
self::makeColumnButtons(),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Datatables\Shop;
|
|
||||||
|
|
||||||
use Yajra\DataTables\Html\Column;
|
|
||||||
use App\Datatables\ParentDataTable as DataTable;
|
|
||||||
use App\Models\Shop\PriceGeneric;
|
|
||||||
|
|
||||||
class PriceGenericsDataTable extends DataTable
|
|
||||||
{
|
|
||||||
public $model_name = 'price_generics';
|
|
||||||
|
|
||||||
public function query(PriceGeneric $model)
|
|
||||||
{
|
|
||||||
$model = $model::with(['category','priceByUnit'])->withCount('prices');
|
|
||||||
return self::buildQuery($model);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function getColumns()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
Column::make('category.name')->title('Catégorie'),
|
|
||||||
Column::make('name')->title('Nom'),
|
|
||||||
Column::make('price_by_unit.price')->title('Prix HT')->class('text-right'),
|
|
||||||
Column::make('price_by_unit.price_taxed')->title('Prix TTC')->class('text-right'),
|
|
||||||
Column::make('prices_count')->title('Nb tarifs')->class('text-right'),
|
|
||||||
self::makeColumnButtons(),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Datatables\Shop;
|
|
||||||
|
|
||||||
use Yajra\DataTables\Html\Column;
|
|
||||||
use App\Datatables\ParentDataTable as DataTable;
|
|
||||||
use App\Models\Shop\TagGroup;
|
|
||||||
|
|
||||||
class TagGroupsDataTable extends DataTable
|
|
||||||
{
|
|
||||||
public $model_name = 'tag_groups';
|
|
||||||
|
|
||||||
public function query(TagGroup $model)
|
|
||||||
{
|
|
||||||
$model = $model::withCount('tags');
|
|
||||||
return self::buildQuery($model);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function getColumns()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
Column::make('name'),
|
|
||||||
Column::make('tags_count')->title('Nb de tags')->searchable(false)->addClass('text-right'),
|
|
||||||
self::makeColumnButtons(),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Datatables\Shop;
|
|
||||||
|
|
||||||
use Yajra\DataTables\Html\Column;
|
|
||||||
use App\Datatables\ParentDataTable as DataTable;
|
|
||||||
use App\Models\Shop\Tag;
|
|
||||||
|
|
||||||
class TagsDataTable extends DataTable
|
|
||||||
{
|
|
||||||
public $model_name = 'tags';
|
|
||||||
public $rowReorder = ['selector' => 'tr'];
|
|
||||||
|
|
||||||
public function query(Tag $model)
|
|
||||||
{
|
|
||||||
$model = $model::with('group')->select(['tags.*']);
|
|
||||||
return self::buildQuery($model);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function getColumns()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
Column::make('group.name')->title('Groupe'),
|
|
||||||
Column::make('sort_order')->title('Ordre'),
|
|
||||||
Column::make('name')->title('Nom'),
|
|
||||||
self::makeColumnButtons(),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Datatables\Shop;
|
|
||||||
|
|
||||||
use Yajra\DataTables\Html\Column;
|
|
||||||
use App\Datatables\ParentDataTable as DataTable;
|
|
||||||
use App\Models\Shop\Unity;
|
|
||||||
|
|
||||||
class UnitiesDataTable extends DataTable
|
|
||||||
{
|
|
||||||
public $model_name = 'unities';
|
|
||||||
|
|
||||||
public function query(Unity $model)
|
|
||||||
{
|
|
||||||
$model = $model::with(['package.article_family'])->select('shop_unities.*');
|
|
||||||
$model = self::filterByFamily($model);
|
|
||||||
return self::buildQuery($model);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function filterByFamily($model, $family_id = false)
|
|
||||||
{
|
|
||||||
$family_id = $family_id ? $family_id : self::isFilteredByField('family_id');
|
|
||||||
return $family_id ? $model->byArticleFamily($family_id) : $model;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function getColumns()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
Column::make('package.article_family.name')->title('Famille'),
|
|
||||||
Column::make('package.value')->title('Package'),
|
|
||||||
Column::make('value')->title('Valeur'),
|
|
||||||
self::makeColumnButtons(),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
34
app/Datatables/Admin/Core/CommentsDataTable.php
Normal file
34
app/Datatables/Admin/Core/CommentsDataTable.php
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Admin\Core;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Core\Comment;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class CommentsDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'comments';
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->url = route('Admin.Core.Comments.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function query(Comment $model)
|
||||||
|
{
|
||||||
|
$model = $model::with(['commentator'])->select('*');
|
||||||
|
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('updated_at')->title(__('date'))->width('80')->class('text-center')->searchable(false),
|
||||||
|
Column::make('commentator.name')->title(__('name'))->searchable(false),
|
||||||
|
Column::make('comment')->title(__('comments'))->searchable(false),
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
33
app/Datatables/Admin/Core/Mail/MailTemplatesDataTable.php
Normal file
33
app/Datatables/Admin/Core/Mail/MailTemplatesDataTable.php
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Admin\Core\Mail;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Core\Mail\MailTemplate;
|
||||||
|
use App\Repositories\Core\Auth\Users;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class MailTemplatesDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'mail_templates';
|
||||||
|
|
||||||
|
public $sortedColumn = 0;
|
||||||
|
|
||||||
|
public $sortedOrder = 'desc';
|
||||||
|
|
||||||
|
public $stateSave = true;
|
||||||
|
|
||||||
|
public function query(MailTemplate $model)
|
||||||
|
{
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('subject')->title(__('Core.subject')),
|
||||||
|
Column::make('mailable')->title(__('Mailable')),
|
||||||
|
$this->makeColumnButtons()->width('60'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
50
app/Datatables/Admin/Shop/ArticleNaturesDataTable.php
Normal file
50
app/Datatables/Admin/Shop/ArticleNaturesDataTable.php
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\ArticleNature;
|
||||||
|
use App\Repositories\Core\Medias;
|
||||||
|
use App\Repositories\Shop\ArticleNatures;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class ArticleNaturesDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'article_natures';
|
||||||
|
|
||||||
|
public $sortedColumn = 1;
|
||||||
|
|
||||||
|
public function query(ArticleNature $model)
|
||||||
|
{
|
||||||
|
$model = $model::withCount('Articles');
|
||||||
|
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function modifier($datatables)
|
||||||
|
{
|
||||||
|
$datatables
|
||||||
|
->editColumn('icon', function (ArticleNature $nature) {
|
||||||
|
$logo = Medias::getImage($nature, 'normal', 'icon');
|
||||||
|
|
||||||
|
return $logo ? "<img src='{$logo}'>" : '';
|
||||||
|
})
|
||||||
|
->editColumn('product_type', function (ArticleNature $nature) {
|
||||||
|
return ArticleNatures::getProductTypeName($nature->product_type);
|
||||||
|
})
|
||||||
|
->rawColumns(['icon', 'action']);
|
||||||
|
|
||||||
|
return parent::modifier($datatables);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('icon')->title('Icone')->width(40)->orderable(false),
|
||||||
|
Column::make('product_type')->title('Famille de produit')->width(140),
|
||||||
|
Column::make('name')->title('Nom'),
|
||||||
|
Column::make('articles_count')->title('Nb Art.')->addClass('text-right')->searchable(false)->width(60),
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
116
app/Datatables/Admin/Shop/ArticlesDataTable.php
Normal file
116
app/Datatables/Admin/Shop/ArticlesDataTable.php
Normal file
@@ -0,0 +1,116 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\Article;
|
||||||
|
use App\Repositories\Shop\ArticleImages;
|
||||||
|
use App\Repositories\Shop\Articles;
|
||||||
|
use App\Repositories\Shop\Tags;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class ArticlesDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'articles';
|
||||||
|
|
||||||
|
public $sortedColumn = 3;
|
||||||
|
|
||||||
|
public function query(Article $model)
|
||||||
|
{
|
||||||
|
$model = $model::with(['article_nature', 'image'])->withCount(['categories', 'images', 'offers', 'tags']);
|
||||||
|
$model = self::filterByArticleNature($model);
|
||||||
|
$model = self::filterByCategory($model);
|
||||||
|
$model = self::filterByTag($model);
|
||||||
|
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function filterByArticleNature($model, $article_nature_id = false)
|
||||||
|
{
|
||||||
|
$article_nature_id = $article_nature_id ? $article_nature_id : self::isFilteredByField('article_nature_id');
|
||||||
|
|
||||||
|
return $article_nature_id ? $model->byArticleNature($article_nature_id) : $model;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function filterByCategory($model, $category_id = false)
|
||||||
|
{
|
||||||
|
$category_id = $category_id ? $category_id : self::isFilteredByField('category_id');
|
||||||
|
|
||||||
|
return $category_id ? $model->byCategory($category_id) : $model;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function filterByTag($model, $tag_id = false)
|
||||||
|
{
|
||||||
|
$tag_id = $tag_id ? $tag_id : self::isFilteredByField('tag_id');
|
||||||
|
|
||||||
|
return $tag_id ? $model->byTag($tag_id) : $model;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function modifier($datatables)
|
||||||
|
{
|
||||||
|
$datatables
|
||||||
|
->editColumn('visible', function (Article $article) {
|
||||||
|
return view('components.form.toggle', [
|
||||||
|
'name' => 'visible',
|
||||||
|
'value' => $article->visible,
|
||||||
|
'on' => __('oui'),
|
||||||
|
'off' => __('non'),
|
||||||
|
'meta' => 'data-id='.$article->id,
|
||||||
|
'size' => 'sm',
|
||||||
|
'class' => 'visible',
|
||||||
|
]);
|
||||||
|
})
|
||||||
|
->editColumn('homepage', function (Article $article) {
|
||||||
|
return view('components.form.toggle', [
|
||||||
|
'name' => 'homepage',
|
||||||
|
'value' => $article->homepage,
|
||||||
|
'on' => __('oui'),
|
||||||
|
'off' => __('non'),
|
||||||
|
'meta' => 'data-id='.$article->id,
|
||||||
|
'size' => 'sm',
|
||||||
|
'class' => 'homepage',
|
||||||
|
]);
|
||||||
|
})
|
||||||
|
->editColumn('thumb', function (Article $article) {
|
||||||
|
$image = ArticleImages::getFullImageByArticle($article);
|
||||||
|
|
||||||
|
return Articles::getThumb($image, false);
|
||||||
|
})
|
||||||
|
->editColumn('article_nature.name', function (Article $article) {
|
||||||
|
return $article->article_nature ? $article->article_nature->name : '';
|
||||||
|
})
|
||||||
|
->editColumn('tags2', function (Article $article) {
|
||||||
|
$html = '';
|
||||||
|
foreach ($article->tags as $tag) {
|
||||||
|
$html .= Tags::getTagHtml($tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $html;
|
||||||
|
})
|
||||||
|
->editColumn('images_count2', function (Article $article) {
|
||||||
|
return ArticleImages::countFullImagesByArticle($article);
|
||||||
|
})
|
||||||
|
->rawColumns(['tags2', 'thumb', 'action']);
|
||||||
|
|
||||||
|
return parent::modifier($datatables);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('visible')->title('Visible')->searchable(false)->width(50),
|
||||||
|
Column::make('homepage')->title('Accueil')->searchable(false)->width(50),
|
||||||
|
Column::make('ref')->title('Ref'),
|
||||||
|
Column::make('article_nature.name')->title('Nature'),
|
||||||
|
Column::make('thumb')->title('')->searchable(false)->orderable(false)->width(40)->class('text-center'),
|
||||||
|
Column::make('name')->title('Nom'),
|
||||||
|
// Column::make('tags2')->title('Tags')->searchable(false)->orderable(false),
|
||||||
|
// Column::make('tags_count')->title('#Tag')->class('text-right')->searchable(false)->width(40),
|
||||||
|
Column::make('categories_count')->title('#Ray')->class('text-right')->searchable(false)->width(40),
|
||||||
|
Column::make('offers_count')->title('#Ofr')->class('text-right')->searchable(false)->width(40),
|
||||||
|
// Column::make('images_count')->title('#Pho')->class('text-right')->searchable(false)->width(40),
|
||||||
|
// Column::make('images_count2')->title('#PhoH')->class('text-right')->searchable(false)->orderable(false)->width(40),
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
74
app/Datatables/Admin/Shop/CategoriesDataTable.php
Normal file
74
app/Datatables/Admin/Shop/CategoriesDataTable.php
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\Category;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class CategoriesDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'categories';
|
||||||
|
|
||||||
|
public function query(Category $model)
|
||||||
|
{
|
||||||
|
$model = $model::notRoot()->with(['tags.articles'])->withCount(['articles', 'tags']);
|
||||||
|
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function modifier($datatables)
|
||||||
|
{
|
||||||
|
$datatables
|
||||||
|
->editColumn('name', function (Category $category) {
|
||||||
|
return $category->name;
|
||||||
|
})
|
||||||
|
->editColumn('visible', function (Category $category) {
|
||||||
|
return view('components.form.toggle', [
|
||||||
|
'name' => 'visible',
|
||||||
|
'value' => $category->visible,
|
||||||
|
'on' => __('oui'),
|
||||||
|
'off' => __('non'),
|
||||||
|
'meta' => 'data-id='.$category->id,
|
||||||
|
'size' => 'sm',
|
||||||
|
'class' => 'visible',
|
||||||
|
]);
|
||||||
|
})
|
||||||
|
->editColumn('homepage', function (Category $category) {
|
||||||
|
return view('components.form.toggle', [
|
||||||
|
'name' => 'homepage',
|
||||||
|
'value' => $category->homepage,
|
||||||
|
'on' => __('oui'),
|
||||||
|
'off' => __('non'),
|
||||||
|
'meta' => 'data-id='.$category->id,
|
||||||
|
'size' => 'sm',
|
||||||
|
'class' => 'homepage',
|
||||||
|
]);
|
||||||
|
})
|
||||||
|
->editColumn('articles_tagged_count', function (Category $category) {
|
||||||
|
$count = 0;
|
||||||
|
foreach ($category->tags as $tag) {
|
||||||
|
$nb = collect($tag->articles)->count();
|
||||||
|
$count += $nb;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $count;
|
||||||
|
})
|
||||||
|
->rawColumns(['visible', 'action']);
|
||||||
|
|
||||||
|
return parent::modifier($datatables);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('visible')->title('visible')->width(60),
|
||||||
|
Column::make('homepage')->title('homepage')->width(60),
|
||||||
|
Column::make('name')->title('Nom'),
|
||||||
|
Column::make('articles_count')->title('#Art')->class('text-right')->orderable(false)->searchable(false)->width(60),
|
||||||
|
Column::make('tags_count')->title('#Tags')->class('text-right')->searchable(false)->width(60),
|
||||||
|
Column::make('articles_tagged_count')->title('#ArtTag')->class('text-right')->searchable(false)->orderable(false)->width(60),
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
33
app/Datatables/Admin/Shop/ContentsDataTable.php
Normal file
33
app/Datatables/Admin/Shop/ContentsDataTable.php
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\Content;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class ContentsDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'contents';
|
||||||
|
|
||||||
|
public function query(Content $model)
|
||||||
|
{
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function modifier($datatables)
|
||||||
|
{
|
||||||
|
$datatables->rawColumns(['text', 'action']);
|
||||||
|
|
||||||
|
return parent::modifier($datatables);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('id')->title('id'),
|
||||||
|
Column::make('text')->title('Texte'),
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
53
app/Datatables/Admin/Shop/CustomerAddressesDataTable.php
Normal file
53
app/Datatables/Admin/Shop/CustomerAddressesDataTable.php
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\CustomerAddress;
|
||||||
|
use App\Repositories\Shop\CustomerAddresses;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class CustomerAddressesDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'customer_addresses';
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->url = route('Admin.Shop.CustomerAddresses.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function query(CustomerAddress $model)
|
||||||
|
{
|
||||||
|
$model = self::filterByCustomer($model);
|
||||||
|
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function filterByCustomer($model, $customerId = false)
|
||||||
|
{
|
||||||
|
$customerId = $customerId ? $customerId : self::isFilteredByField('customer_id');
|
||||||
|
|
||||||
|
return $customerId ? $model->byCustomer($customerId) : $model;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function modifier($datatables)
|
||||||
|
{
|
||||||
|
$datatables->editColumn('type', function (CustomerAddress $address) {
|
||||||
|
return CustomerAddresses::getIconByType($address->type);
|
||||||
|
})->rawColumns(['type', 'action']);
|
||||||
|
|
||||||
|
return parent::modifier($datatables);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('type')->title('')->width(30),
|
||||||
|
Column::make('address')->title('Adresse'),
|
||||||
|
Column::make('zipcode')->title('Code postal'),
|
||||||
|
Column::make('city')->title('Ville'),
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
80
app/Datatables/Admin/Shop/CustomerInvoicesDataTable.php
Normal file
80
app/Datatables/Admin/Shop/CustomerInvoicesDataTable.php
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\Invoice;
|
||||||
|
use App\Repositories\Shop\Customers;
|
||||||
|
use App\Repositories\Shop\InvoicePayments;
|
||||||
|
use App\Repositories\Shop\Invoices;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class CustomerInvoicesDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'invoices';
|
||||||
|
|
||||||
|
public $sortedColumn = 1;
|
||||||
|
|
||||||
|
public $sortedOrder = 'desc';
|
||||||
|
|
||||||
|
public $stateSave = true;
|
||||||
|
|
||||||
|
public $url = null;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->url = route('Shop.Invoices.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function query(Invoice $model)
|
||||||
|
{
|
||||||
|
$customerId = Customers::getId();
|
||||||
|
$model = $model->byCustomer($customerId)->with(['address']);
|
||||||
|
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getHtmlButtons()
|
||||||
|
{
|
||||||
|
$buttons = view('components.form.button', [
|
||||||
|
'dataId' => '{{$uuid}}',
|
||||||
|
'class' => 'btn-sm btn-secondary btn-invoice mr-2',
|
||||||
|
'icon' => 'fa-file-pdf',
|
||||||
|
'title' => 'Télécharger la facture',
|
||||||
|
'url' => route('Shop.Invoices.pdf').'/{{$uuid}}',
|
||||||
|
]);
|
||||||
|
|
||||||
|
$buttons .= self::getButtonShow('uuid', 'Voir la facture');
|
||||||
|
|
||||||
|
return $buttons;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function modifier($datatables)
|
||||||
|
{
|
||||||
|
$datatables
|
||||||
|
->editColumn('status', function (Invoice $invoice) {
|
||||||
|
return Invoices::getStatus($invoice->status);
|
||||||
|
})
|
||||||
|
->editColumn('created_at', function (Invoice $invoice) {
|
||||||
|
return $invoice->created_at->isoFormat('DD/MM/YY HH:mm');
|
||||||
|
})
|
||||||
|
->editColumn('payment_type', function (Invoice $invoice) {
|
||||||
|
return InvoicePayments::getPaymentType($invoice->payment_type);
|
||||||
|
})
|
||||||
|
->rawColumns(['action']);
|
||||||
|
|
||||||
|
return parent::modifier($datatables);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('created_at')->title('Date'),
|
||||||
|
Column::make('ref')->title('Ref'),
|
||||||
|
Column::make('payment_type')->title('Règlement'),
|
||||||
|
Column::make('total_shipped')->title('Montant')->class('text-right'),
|
||||||
|
Column::make('status')->title('Statut'),
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
69
app/Datatables/Admin/Shop/CustomerOrdersDataTable.php
Normal file
69
app/Datatables/Admin/Shop/CustomerOrdersDataTable.php
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\Order;
|
||||||
|
use App\Repositories\Shop\Customers;
|
||||||
|
use App\Repositories\Shop\Orders;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class CustomerOrdersDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'orders';
|
||||||
|
|
||||||
|
public $sortedColumn = 1;
|
||||||
|
|
||||||
|
public $sortedOrder = 'desc';
|
||||||
|
|
||||||
|
public $stateSave = true;
|
||||||
|
|
||||||
|
public $url = null;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->url = route('Shop.Orders.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function query(Order $model)
|
||||||
|
{
|
||||||
|
$customerId = Customers::getId();
|
||||||
|
$model = $model->byCustomer($customerId);
|
||||||
|
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getHtmlButtons()
|
||||||
|
{
|
||||||
|
$buttons = '';
|
||||||
|
|
||||||
|
$buttons .= self::getButtonShow('uuid', 'Voir la facture');
|
||||||
|
|
||||||
|
return $buttons;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function modifier($datatables)
|
||||||
|
{
|
||||||
|
$datatables
|
||||||
|
->editColumn('status', function (Order $order) {
|
||||||
|
return Orders::getStatus($order->status);
|
||||||
|
})
|
||||||
|
->editColumn('created_at', function (Order $order) {
|
||||||
|
return $order->created_at->isoFormat('DD/MM/YY HH:mm');
|
||||||
|
})
|
||||||
|
->rawColumns(['action']);
|
||||||
|
|
||||||
|
return parent::modifier($datatables);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('created_at')->title('Date'),
|
||||||
|
Column::make('ref')->title('Ref'),
|
||||||
|
Column::make('total_shipped')->title('Montant')->class('text-right'),
|
||||||
|
Column::make('status')->title('Statut'),
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
42
app/Datatables/Admin/Shop/CustomersDataTable.php
Normal file
42
app/Datatables/Admin/Shop/CustomersDataTable.php
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\Customer;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class CustomersDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'customers';
|
||||||
|
|
||||||
|
public function query(Customer $model)
|
||||||
|
{
|
||||||
|
$model = $model->with('addresses');
|
||||||
|
$model = self::filterBySaleChannel($model);
|
||||||
|
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function filterBySaleChannel($model, $sale_channel_id = false)
|
||||||
|
{
|
||||||
|
$sale_channel_id = $sale_channel_id ? $sale_channel_id : self::isFilteredByField('sale_channel_id');
|
||||||
|
|
||||||
|
return $sale_channel_id ? $model->bySaleChannel($sale_channel_id) : $model;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('company')->title('Société'),
|
||||||
|
Column::make('last_name')->title('Nom'),
|
||||||
|
Column::make('first_name')->title('Prénom'),
|
||||||
|
Column::make('address')->title('Adresse'),
|
||||||
|
Column::make('zipcode')->title('Code postal'),
|
||||||
|
Column::make('city')->title('Ville'),
|
||||||
|
Column::make('phone')->title('Téléphone'),
|
||||||
|
Column::make('email')->title('Email'),
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
66
app/Datatables/Admin/Shop/DeliveriesDataTable.php
Normal file
66
app/Datatables/Admin/Shop/DeliveriesDataTable.php
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\Delivery;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class DeliveriesDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'deliveries';
|
||||||
|
|
||||||
|
public function query(Delivery $model)
|
||||||
|
{
|
||||||
|
$model = $model->with('sale_channel');
|
||||||
|
$model = self::filterBySaleChannel($model);
|
||||||
|
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function filterBySaleChannel($model, $sale_channel_id = false)
|
||||||
|
{
|
||||||
|
$sale_channel_id = $sale_channel_id ? $sale_channel_id : self::isFilteredByField('sale_channel_id');
|
||||||
|
|
||||||
|
return $sale_channel_id ? $model->bySaleChannel($sale_channel_id) : $model;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function modifier($datatables)
|
||||||
|
{
|
||||||
|
$datatables
|
||||||
|
->editColumn('active', function (Delivery $delivery) {
|
||||||
|
return view('components.form.toggle', [
|
||||||
|
'value' => $delivery->active,
|
||||||
|
'on' => __('active'),
|
||||||
|
'off' => __('inactive'),
|
||||||
|
'meta' => 'data-id='.$delivery->id,
|
||||||
|
'size' => 'xs',
|
||||||
|
]);
|
||||||
|
})
|
||||||
|
->editColumn('is_public', function (Delivery $delivery) {
|
||||||
|
return $delivery->is_public ? "<i class='fa fa-check secondary'></i>" : '';
|
||||||
|
})
|
||||||
|
->editColumn('at_house', function (Delivery $delivery) {
|
||||||
|
return $delivery->at_house ? "<i class='fa fa-check secondary'></i>" : '';
|
||||||
|
})
|
||||||
|
->editColumn('address', function (Delivery $delivery) {
|
||||||
|
return $delivery->address.' '.$delivery->zipcode.' '.$delivery->city;
|
||||||
|
})
|
||||||
|
->rawColumns(['active', 'is_public', 'at_house', 'address', 'action']);
|
||||||
|
|
||||||
|
return parent::modifier($datatables);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('active')->title(__('active'))->width(60)->class('text-center'),
|
||||||
|
Column::make('is_public')->title(__('Public'))->width(60)->class('text-center'),
|
||||||
|
Column::make('at_house')->title(__('Défaut'))->width(60)->class('text-center'),
|
||||||
|
Column::make('name')->title('Nom'),
|
||||||
|
Column::make('sale_channel.name')->title(__('shop.sale_channels.name')),
|
||||||
|
Column::make('address')->title('Adresse')->searchable(false),
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
27
app/Datatables/Admin/Shop/DeliveryPackagesDataTable.php
Normal file
27
app/Datatables/Admin/Shop/DeliveryPackagesDataTable.php
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\DeliveryPackage;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class DeliveryPackagesDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'delivery_packages';
|
||||||
|
|
||||||
|
public function query(DeliveryPackage $model)
|
||||||
|
{
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('weight')->title('Poids')->addClass('text-right'),
|
||||||
|
Column::make('weight_flyer')->title('Flyer')->addClass('text-right'),
|
||||||
|
Column::make('weight_packaging')->title('Packaging')->addClass('text-right'),
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\DeliveryTypeCalculation;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class DeliveryTypeCalculationsDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'delivery_type_calculations';
|
||||||
|
|
||||||
|
public function query(DeliveryTypeCalculation $model)
|
||||||
|
{
|
||||||
|
$model = $model->with('delivery_type');
|
||||||
|
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('delivery_type.name')->title('Nom'),
|
||||||
|
Column::make('weight')->title('Poids en g')->addClass('text-right'),
|
||||||
|
Column::make('price')->title('Prix')->addClass('text-right'),
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
25
app/Datatables/Admin/Shop/DeliveryTypesDataTable.php
Normal file
25
app/Datatables/Admin/Shop/DeliveryTypesDataTable.php
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\DeliveryType;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class DeliveryTypesDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'delivery_types';
|
||||||
|
|
||||||
|
public function query(DeliveryType $model)
|
||||||
|
{
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('name')->title('Nom'),
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
48
app/Datatables/Admin/Shop/InvoicePaymentsDataTable.php
Normal file
48
app/Datatables/Admin/Shop/InvoicePaymentsDataTable.php
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\InvoicePayment;
|
||||||
|
use App\Repositories\Shop\InvoicePayments;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class InvoicePaymentsDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'invoice_payments';
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->url = route('Admin.Shop.InvoicePayments.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function query(InvoicePayment $model)
|
||||||
|
{
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function modifier($datatables)
|
||||||
|
{
|
||||||
|
$datatables
|
||||||
|
->editColumn('payment_type', function (InvoicePayment $payment) {
|
||||||
|
return InvoicePayments::getPaymentType($payment->payment_type);
|
||||||
|
})
|
||||||
|
->editColumn('date', function (InvoicePayment $payment) {
|
||||||
|
return $payment->date;
|
||||||
|
})
|
||||||
|
->rawColumns(['action']);
|
||||||
|
|
||||||
|
return parent::modifier($datatables);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('payment_type')->title('Type')->width(80),
|
||||||
|
Column::make('date')->width(60),
|
||||||
|
Column::make('amount')->title('Montant')->width(100),
|
||||||
|
Column::make('reference')->title('Référence'),
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
49
app/Datatables/Admin/Shop/InvoicesDataTable.php
Normal file
49
app/Datatables/Admin/Shop/InvoicesDataTable.php
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\Invoice;
|
||||||
|
use App\Repositories\Shop\Invoices;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class InvoicesDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'invoices';
|
||||||
|
|
||||||
|
public function query(Invoice $model)
|
||||||
|
{
|
||||||
|
$model = $model->with('customer');
|
||||||
|
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function modifier($datatables)
|
||||||
|
{
|
||||||
|
$datatables
|
||||||
|
->editColumn('status', function (Invoice $invoice) {
|
||||||
|
return Invoices::getStatus($invoice->status);
|
||||||
|
})
|
||||||
|
->editColumn('created_at', function (Invoice $invoice) {
|
||||||
|
return $invoice->created_at->toDateTimeString();
|
||||||
|
})
|
||||||
|
->editColumn('customer.last_name', function (Invoice $invoice) {
|
||||||
|
return ($invoice->customer ?? false) ? $invoice->customer->name : '';
|
||||||
|
})
|
||||||
|
->rawColumns(['action']);
|
||||||
|
|
||||||
|
return parent::modifier($datatables);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('ref')->title('Ref')->width(80),
|
||||||
|
Column::make('status')->width(60),
|
||||||
|
Column::make('created_at')->title('Date')->width(100),
|
||||||
|
Column::make('customer.last_name')->title('Client')->default(''),
|
||||||
|
Column::make('total')->addClass('text-right'),
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
54
app/Datatables/Admin/Shop/MerchandisesDataTable.php
Normal file
54
app/Datatables/Admin/Shop/MerchandisesDataTable.php
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\Merchandise;
|
||||||
|
use App\Repositories\Shop\Merchandises;
|
||||||
|
use App\Repositories\Shop\Tags;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class MerchandisesDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'merchandises';
|
||||||
|
|
||||||
|
public function query(Merchandise $model)
|
||||||
|
{
|
||||||
|
$model = $model::with(['image', 'tags', 'producer'])->withCount(['Articles', 'tags', 'images']);
|
||||||
|
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function modifier($datatables)
|
||||||
|
{
|
||||||
|
$datatables
|
||||||
|
->editColumn('thumb', function (Merchandise $merchandise) {
|
||||||
|
return Merchandises::getThumb($merchandise->image, false);
|
||||||
|
})
|
||||||
|
->editColumn('tags2', function (Merchandise $merchandise) {
|
||||||
|
$html = '';
|
||||||
|
foreach ($merchandise->tags as $tag) {
|
||||||
|
$html .= Tags::getTagHtml($tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $html;
|
||||||
|
})
|
||||||
|
->rawColumns(['thumb', 'tags2', 'action']);
|
||||||
|
|
||||||
|
return parent::modifier($datatables);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('thumb')->title('')->searchable(false)->orderable(false)->width(40)->class('text-center'),
|
||||||
|
Column::make('name')->title('Nom'),
|
||||||
|
Column::make('producer.name')->title('Producteur'),
|
||||||
|
Column::make('tags2')->title('Tags')->searchable(false)->orderable(false),
|
||||||
|
Column::make('articles_count')->title('#Art')->class('text-right')->searchable(false),
|
||||||
|
Column::make('tags_count')->title('#Tag')->class('text-right')->searchable(false),
|
||||||
|
Column::make('images_count')->title('#Pho')->class('text-right')->searchable(false),
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
79
app/Datatables/Admin/Shop/OffersDataTable.php
Normal file
79
app/Datatables/Admin/Shop/OffersDataTable.php
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\Offer;
|
||||||
|
use App\Repositories\Shop\Offers;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class OffersDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'offers';
|
||||||
|
|
||||||
|
public $sortedColumn = 1;
|
||||||
|
|
||||||
|
public function query(Offer $model)
|
||||||
|
{
|
||||||
|
$model = $model->with(['article.article_nature', 'variation', 'tariff'])->select($model->getTable().'.*');
|
||||||
|
$model = self::filterByArticleNature($model);
|
||||||
|
$model = self::filterByPackage($model);
|
||||||
|
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function filterByArticleNature($model, $articleNatureId = false)
|
||||||
|
{
|
||||||
|
$articleNatureId = $articleNatureId ? $articleNatureId : self::isFilteredByField('article_nature_id');
|
||||||
|
|
||||||
|
return $articleNatureId ? $model->byArticleNature($articleNatureId) : $model;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function filterByPackage($model, $packageId = false)
|
||||||
|
{
|
||||||
|
$packageId = $packageId ? $packageId : self::isFilteredByField('package_id');
|
||||||
|
|
||||||
|
return $packageId ? $model->byPackage($packageId) : $model;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function modifier($datatables)
|
||||||
|
{
|
||||||
|
$datatables
|
||||||
|
->editColumn('thumb', function (Offer $offer) {
|
||||||
|
return '<img src="'.Offers::getThumbSrc($offer).'">';
|
||||||
|
})
|
||||||
|
->editColumn('status_id', function (Offer $offer) {
|
||||||
|
return view('components.form.toggle', [
|
||||||
|
'name' => 'status_id',
|
||||||
|
'value' => $offer->status_id,
|
||||||
|
'on' => __('active'),
|
||||||
|
'off' => __('inactive'),
|
||||||
|
'meta' => 'data-id='.$offer->id,
|
||||||
|
'size' => 'xs',
|
||||||
|
]);
|
||||||
|
})
|
||||||
|
->editColumn('stock_delayed', function (Offer $offer) {
|
||||||
|
return $offer->stock_delayed.' - '.$offer->delay_type;
|
||||||
|
})
|
||||||
|
->rawColumns(['active', 'thumb', 'action']);
|
||||||
|
|
||||||
|
return parent::modifier($datatables);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('status_id')->title('')->width(40)->searchable(false),
|
||||||
|
Column::make('article.article_nature.name')->title('Nature')->defaultContent('')->searchable(false),
|
||||||
|
Column::make('thumb')->title('')->width(30)->searchable(false)->addClass('text-center'),
|
||||||
|
Column::make('article.name')->title('Article')->defaultContent(''),
|
||||||
|
Column::make('variation.name')->title('Déclinaison')->defaultContent('')->searchable(false),
|
||||||
|
Column::make('weight')->title('Poids')->searchable(false)->addClass('text-right'),
|
||||||
|
Column::make('tariff.name')->title('Tarif')->defaultContent('')->searchable(false),
|
||||||
|
Column::make('stock_current')->title('Appro im')->searchable(false)->addClass('text-right'),
|
||||||
|
Column::make('stock_delayed')->title('Appro délai')->searchable(false)->addClass('text-right'),
|
||||||
|
Column::make('stock_ondemand')->title('Dmde')->searchable(false)->addClass('text-right'),
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
61
app/Datatables/Admin/Shop/OrdersDataTable.php
Normal file
61
app/Datatables/Admin/Shop/OrdersDataTable.php
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\Order;
|
||||||
|
use App\Repositories\Shop\InvoicePayments;
|
||||||
|
use App\Repositories\Shop\Orders;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class OrdersDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'orders';
|
||||||
|
|
||||||
|
public $sortedColumn = 0;
|
||||||
|
|
||||||
|
public $sortedOrder = 'desc';
|
||||||
|
|
||||||
|
public $stateSave = true;
|
||||||
|
|
||||||
|
public function query(Order $model)
|
||||||
|
{
|
||||||
|
$model = $model->with(['customer', 'delivery']);
|
||||||
|
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function modifier($datatables)
|
||||||
|
{
|
||||||
|
$datatables
|
||||||
|
->editColumn('status', function (Order $order) {
|
||||||
|
return Orders::getStatus($order->status);
|
||||||
|
})
|
||||||
|
->editColumn('created_at', function (Order $order) {
|
||||||
|
return $order->created_at->format('d/m/Y H:i:s');
|
||||||
|
})
|
||||||
|
->editColumn('customer.last_name', function (Order $order) {
|
||||||
|
return $order->customer->last_name.' '.$order->customer->first_name;
|
||||||
|
})
|
||||||
|
->editColumn('payment_type', function (Order $order) {
|
||||||
|
return InvoicePayments::getPaymentType($order->payment_type);
|
||||||
|
})
|
||||||
|
->rawColumns(['action']);
|
||||||
|
|
||||||
|
return parent::modifier($datatables);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('ref')->title('Ref'),
|
||||||
|
Column::make('status')->title('Statut'),
|
||||||
|
Column::make('created_at')->title('Date'),
|
||||||
|
Column::make('customer.last_name')->title('Client'),
|
||||||
|
Column::make('delivery.name')->title('Point de distribution'),
|
||||||
|
Column::make('payment_type')->title('Règlement'),
|
||||||
|
Column::make('total_shipped')->title('Montant')->class('text-right'),
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
29
app/Datatables/Admin/Shop/PackagesDataTable.php
Normal file
29
app/Datatables/Admin/Shop/PackagesDataTable.php
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\Package;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class PackagesDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'packages';
|
||||||
|
|
||||||
|
public function query(Package $model)
|
||||||
|
{
|
||||||
|
$model = $model->withCount(['variations', 'offers']);
|
||||||
|
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('value')->title('Valeur'),
|
||||||
|
Column::make('variations_count')->title('nb variations')->searchable(false)->class('text-right'),
|
||||||
|
Column::make('offers_count')->title('nb offres')->searchable(false)->class('text-right'),
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
36
app/Datatables/Admin/Shop/PriceListValuesDataTable.php
Normal file
36
app/Datatables/Admin/Shop/PriceListValuesDataTable.php
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\PriceListValue;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class PriceListValuesDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'price_list_values';
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->url = route('Admin.Shop.PriceListValues.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function query(PriceListValue $model)
|
||||||
|
{
|
||||||
|
$model = $model->with(['price_list']);
|
||||||
|
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('price_list.name')->data('price_list')->title('etat'),
|
||||||
|
Column::make('code')->title('Code'),
|
||||||
|
Column::make('quantity')->title('Quantité'),
|
||||||
|
Column::make('price')->title('Prix HT'),
|
||||||
|
Column::make('price_taxed')->title('Prix TTC'),
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
58
app/Datatables/Admin/Shop/PriceListsDataTable.php
Normal file
58
app/Datatables/Admin/Shop/PriceListsDataTable.php
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\PriceList;
|
||||||
|
use App\Repositories\Shop\PriceLists;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class PriceListsDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'price_lists';
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->url = route('Admin.Shop.PriceLists.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function query(PriceList $model)
|
||||||
|
{
|
||||||
|
$model = $model->with(['sale_channel', 'price_list_values']);
|
||||||
|
$model = self::filterByTariff($model);
|
||||||
|
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function filterByTariff($model, $tariff_id = false)
|
||||||
|
{
|
||||||
|
$tariff_id = $tariff_id ? $tariff_id : self::isFilteredByField('tariff_id');
|
||||||
|
|
||||||
|
return $tariff_id ? $model->byTariff($tariff_id) : $model;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function modifier($datatables)
|
||||||
|
{
|
||||||
|
$datatables
|
||||||
|
->editColumn('status', function (PriceList $price_list) {
|
||||||
|
return PriceLists::getStatus($price_list['status_id']);
|
||||||
|
})
|
||||||
|
->editColumn('tariff_id', function (PriceList $price_list) {
|
||||||
|
return view('Admin.Shop.PriceLists.partials.table-prices', ['prices' => $price_list['price_list_values']]);
|
||||||
|
})
|
||||||
|
->rawColumns(['tariff_id', 'action']);
|
||||||
|
|
||||||
|
return parent::modifier($datatables);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('status_id')->data('status')->title('etat'),
|
||||||
|
Column::make('name')->title('Nom'),
|
||||||
|
Column::make('sale_channel.name')->title('Canal de vente'),
|
||||||
|
Column::make('tariff_id')->title('Liste de prix'),
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
53
app/Datatables/Admin/Shop/ProducersDataTable.php
Normal file
53
app/Datatables/Admin/Shop/ProducersDataTable.php
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\Producer;
|
||||||
|
use App\Repositories\Shop\Producers;
|
||||||
|
use App\Repositories\Shop\Tags;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class ProducersDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'producers';
|
||||||
|
|
||||||
|
public function query(Producer $model)
|
||||||
|
{
|
||||||
|
$model = $model::with(['image', 'tags'])->withCount(['Merchandises', 'tags', 'images']);
|
||||||
|
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function modifier($datatables)
|
||||||
|
{
|
||||||
|
$datatables
|
||||||
|
->editColumn('thumb', function (Producer $producer) {
|
||||||
|
return Producers::getThumb($producer->image, false);
|
||||||
|
})
|
||||||
|
->editColumn('tags2', function (Producer $producer) {
|
||||||
|
$html = '';
|
||||||
|
foreach ($producer->tags as $tag) {
|
||||||
|
$html .= Tags::getTagHtml($tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $html;
|
||||||
|
})
|
||||||
|
->rawColumns(['thumb', 'tags2', 'action']);
|
||||||
|
|
||||||
|
return parent::modifier($datatables);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('thumb')->title('')->searchable(false)->orderable(false)->width(40)->class('text-center'),
|
||||||
|
Column::make('name')->title('Nom'),
|
||||||
|
Column::make('tags2')->title('Tags')->searchable(false)->orderable(false),
|
||||||
|
Column::make('merchandises_count')->title('#Marchandises')->class('text-right')->searchable(false),
|
||||||
|
// Column::make('tags_count')->title('#Tag')->class('text-right')->searchable(false),
|
||||||
|
// Column::make('images_count')->title('#Pho')->class('text-right')->searchable(false),
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
31
app/Datatables/Admin/Shop/SaleChannelsDataTable.php
Normal file
31
app/Datatables/Admin/Shop/SaleChannelsDataTable.php
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\SaleChannel;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class SaleChannelsDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'sale_channels';
|
||||||
|
|
||||||
|
public function query(SaleChannel $model)
|
||||||
|
{
|
||||||
|
$model = $model->withCount(['customers', 'deliveries', 'tariffs']);
|
||||||
|
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('code')->title('Code abrégé')->width(100),
|
||||||
|
Column::make('name')->title('Nom'),
|
||||||
|
Column::make('customers_count')->title('#Clients')->searchable(false)->class('text-right'),
|
||||||
|
Column::make('deliveries_count')->title('#Distrib')->searchable(false)->class('text-right'),
|
||||||
|
Column::make('tariffs_count')->title('#Tarifs')->searchable(false)->class('text-right'),
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
51
app/Datatables/Admin/Shop/TagGroupsDataTable.php
Normal file
51
app/Datatables/Admin/Shop/TagGroupsDataTable.php
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\TagGroup;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class TagGroupsDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'tag_groups';
|
||||||
|
|
||||||
|
public $sortedColumn = 2;
|
||||||
|
|
||||||
|
public function query(TagGroup $model)
|
||||||
|
{
|
||||||
|
$model = $model::with('article_family')->withCount('tags');
|
||||||
|
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function modifier($datatables)
|
||||||
|
{
|
||||||
|
$datatables
|
||||||
|
->editColumn('visible', function (TagGroup $tag_group) {
|
||||||
|
return view('components.form.toggle', [
|
||||||
|
'name' => 'visible',
|
||||||
|
'value' => $tag_group->visible,
|
||||||
|
'on' => __('oui'),
|
||||||
|
'off' => __('non'),
|
||||||
|
'meta' => 'data-id='.$tag_group->id,
|
||||||
|
'size' => 'sm',
|
||||||
|
'class' => 'visible',
|
||||||
|
]);
|
||||||
|
})
|
||||||
|
->rawColumns(['visible', 'action']);
|
||||||
|
|
||||||
|
return parent::modifier($datatables);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('visible')->title('Visible')->width(60)->searchable(false),
|
||||||
|
Column::make('code')->title('Code')->width(100),
|
||||||
|
Column::make('name')->title('Nom'),
|
||||||
|
Column::make('tags_count')->title('#Tags')->searchable(false)->addClass('text-right')->width(60),
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
45
app/Datatables/Admin/Shop/TagsDataTable.php
Normal file
45
app/Datatables/Admin/Shop/TagsDataTable.php
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\Tag;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class TagsDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'tags';
|
||||||
|
|
||||||
|
public $rowReorder = ['selector' => 'tr'];
|
||||||
|
|
||||||
|
public function query(Tag $model)
|
||||||
|
{
|
||||||
|
$model = $model::with('tag_group')->withCount(['articles', 'shelves', 'species', 'varieties']);
|
||||||
|
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function modifier($datatables)
|
||||||
|
{
|
||||||
|
$datatables
|
||||||
|
->editColumn('name', function (Tag $tag) {
|
||||||
|
return $tag->name;
|
||||||
|
})
|
||||||
|
->rawColumns(['active', 'action']);
|
||||||
|
|
||||||
|
return parent::modifier($datatables);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('tag_group.name')->title('Groupe')->width(200),
|
||||||
|
Column::make('name')->title('Nom'),
|
||||||
|
Column::make('articles_count')->title('#Art')->class('text-right')->searchable(false)->width(60),
|
||||||
|
Column::make('species_count')->title('#Esp')->class('text-right')->searchable(false)->width(60),
|
||||||
|
Column::make('varieties_count')->title('#Var')->class('text-right')->searchable(false)->width(60),
|
||||||
|
Column::make('shelves_count')->title('#Ray')->class('text-right')->searchable(false)->width(60),
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
25
app/Datatables/Admin/Shop/TariffUnitiesDataTable.php
Normal file
25
app/Datatables/Admin/Shop/TariffUnitiesDataTable.php
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\TariffUnity;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class TariffUnitiesDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'tariff_unities';
|
||||||
|
|
||||||
|
public function query(TariffUnity $model)
|
||||||
|
{
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('value')->title('Valeur'),
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
53
app/Datatables/Admin/Shop/TariffsDataTable.php
Normal file
53
app/Datatables/Admin/Shop/TariffsDataTable.php
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\Tariff;
|
||||||
|
use App\Repositories\Shop\Tariffs;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class TariffsDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'tariffs';
|
||||||
|
|
||||||
|
public function query(Tariff $model)
|
||||||
|
{
|
||||||
|
$model = $model->with(['sale_channels'])->withCount(['price_lists', 'offers']);
|
||||||
|
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function modifier($datatables)
|
||||||
|
{
|
||||||
|
$datatables
|
||||||
|
->editColumn('status', function (Tariff $tariff) {
|
||||||
|
return Tariffs::getStatus($tariff['status_id']);
|
||||||
|
})
|
||||||
|
->editColumn('sale_channels2', function (Tariff $tariff) {
|
||||||
|
$html = '';
|
||||||
|
foreach ($tariff->sale_channels as $sale_channel) {
|
||||||
|
$html .= $sale_channel->code.', ';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $html;
|
||||||
|
})
|
||||||
|
->rawColumns(['sale_channels2', 'action']);
|
||||||
|
|
||||||
|
return parent::modifier($datatables);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('status_id')->data('status')->title('status')->searchable(false)->orderable(false),
|
||||||
|
Column::make('name')->title('Nom'),
|
||||||
|
Column::make('sale_channels2')->title('Canaux de vente')->searchable(false)->orderable(false),
|
||||||
|
Column::make('code')->title('Code'),
|
||||||
|
Column::make('ref')->title('Référence'),
|
||||||
|
Column::make('price_lists_count')->title('#Lst prix')->searchable(false)->orderable(false)->class('text-right'),
|
||||||
|
Column::make('offers_count')->title('#Offres')->searchable(false)->orderable(false)->class('text-right'),
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
25
app/Datatables/Admin/Shop/UnitiesDataTable.php
Normal file
25
app/Datatables/Admin/Shop/UnitiesDataTable.php
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\Unity;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class UnitiesDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'unities';
|
||||||
|
|
||||||
|
public function query(Unity $model)
|
||||||
|
{
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('value')->title('Valeur'),
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
42
app/Datatables/Admin/Shop/VariationsDataTable.php
Normal file
42
app/Datatables/Admin/Shop/VariationsDataTable.php
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\Variation;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class VariationsDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'variations';
|
||||||
|
|
||||||
|
public function query(Variation $model)
|
||||||
|
{
|
||||||
|
$model = $model->with(['package', 'unity'])->withCount('offers');
|
||||||
|
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function modifier($datatables)
|
||||||
|
{
|
||||||
|
$datatables
|
||||||
|
->editColumn('unity_value', function (Variation $variation) {
|
||||||
|
return $variation->unity ? $variation->unity->value : '';
|
||||||
|
})
|
||||||
|
->rawColumns(['description', 'action']);
|
||||||
|
|
||||||
|
return parent::modifier($datatables);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('package.value')->title('Package'),
|
||||||
|
Column::make('quantity')->title('Quantité')->class('text-right')->with(80),
|
||||||
|
Column::make('unity_value')->title('Unité')->searchable(false)->with(80),
|
||||||
|
Column::make('description')->title('Description'),
|
||||||
|
Column::make('offers_count')->title('#Ofr')->searchable(false)->class('text-right'),
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
32
app/Datatables/Botanic/FamiliesDataTable.php
Normal file
32
app/Datatables/Botanic/FamiliesDataTable.php
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Botanic;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Botanic\Family;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class FamiliesDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'families';
|
||||||
|
|
||||||
|
public function query(Family $model)
|
||||||
|
{
|
||||||
|
$model = $model::withCount(['genres', 'species', 'varieties']);
|
||||||
|
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('name')->title('Nom'),
|
||||||
|
Column::make('alias'),
|
||||||
|
Column::make('latin'),
|
||||||
|
Column::make('genres_count')->title('Nb genres')->searchable(false)->addClass('text-right'),
|
||||||
|
Column::make('species_count')->title('Nb espèces')->searchable(false)->addClass('text-right'),
|
||||||
|
Column::make('varieties_count')->title('Nb variétés')->searchable(false)->addClass('text-right'),
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
namespace App\Datatables\Botanic;
|
namespace App\Datatables\Botanic;
|
||||||
|
|
||||||
use Yajra\DataTables\Html\Column;
|
|
||||||
use App\Datatables\ParentDataTable as DataTable;
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
use App\Models\Botanic\Genre;
|
use App\Models\Botanic\Genre;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
class GenresDataTable extends DataTable
|
class GenresDataTable extends DataTable
|
||||||
{
|
{
|
||||||
@@ -13,7 +13,8 @@ class GenresDataTable extends DataTable
|
|||||||
public function query(Genre $model)
|
public function query(Genre $model)
|
||||||
{
|
{
|
||||||
$model = $model::with('family')->withCount('species')->withCount('varieties');
|
$model = $model::with('family')->withCount('species')->withCount('varieties');
|
||||||
return self::buildQuery($model);
|
|
||||||
|
return $this->buildQuery($model);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function modifier($datatables)
|
public function modifier($datatables)
|
||||||
@@ -22,9 +23,9 @@ class GenresDataTable extends DataTable
|
|||||||
->editColumn('family_name', function (Genre $genre) {
|
->editColumn('family_name', function (Genre $genre) {
|
||||||
return $genre->family ? $genre->family->name : '';
|
return $genre->family ? $genre->family->name : '';
|
||||||
})
|
})
|
||||||
->rawColumns(['genre_name', 'action'])
|
->rawColumns(['genre_name', 'action']);
|
||||||
;
|
|
||||||
return Parent::modifier($datatables);
|
return parent::modifier($datatables);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getColumns()
|
protected function getColumns()
|
||||||
@@ -36,8 +37,7 @@ class GenresDataTable extends DataTable
|
|||||||
Column::make('family.name')->data('family_name')->title('Famille'),
|
Column::make('family.name')->data('family_name')->title('Famille'),
|
||||||
Column::make('species_count')->title('Nb Espèces')->searchable(false)->addClass('text-right'),
|
Column::make('species_count')->title('Nb Espèces')->searchable(false)->addClass('text-right'),
|
||||||
Column::make('varieties_count')->title('Nb Variétés')->searchable(false)->addClass('text-right'),
|
Column::make('varieties_count')->title('Nb Variétés')->searchable(false)->addClass('text-right'),
|
||||||
self::makeColumnButtons(),
|
$this->makeColumnButtons(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
59
app/Datatables/Botanic/SpeciesDataTable.php
Normal file
59
app/Datatables/Botanic/SpeciesDataTable.php
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Botanic;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Botanic\Specie;
|
||||||
|
use App\Repositories\Botanic\Species;
|
||||||
|
use App\Repositories\Shop\Tags;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class SpeciesDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'species';
|
||||||
|
|
||||||
|
public function query(Specie $model)
|
||||||
|
{
|
||||||
|
$model = $model::withCount(['images', 'varieties', 'tags'])->with(['genre', 'image', 'tags']);
|
||||||
|
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function modifier($datatables)
|
||||||
|
{
|
||||||
|
$datatables
|
||||||
|
->editColumn('thumb', function (Specie $specie) {
|
||||||
|
return Species::getThumb($specie->image, false);
|
||||||
|
})
|
||||||
|
->editColumn('genre_name', function (Specie $specie) {
|
||||||
|
return $specie->genre ? $specie->genre->name : '';
|
||||||
|
})
|
||||||
|
->editColumn('tags2', function (Specie $specie) {
|
||||||
|
$html = '';
|
||||||
|
foreach ($specie->tags as $tag) {
|
||||||
|
$html .= Tags::getTagHtml($tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $html;
|
||||||
|
})
|
||||||
|
->rawColumns(['thumb', 'tags2', 'genre_name', 'action']);
|
||||||
|
|
||||||
|
return parent::modifier($datatables);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('name')->title('Nom'),
|
||||||
|
Column::make('thumb')->title('')->searchable(false)->orderable(false)->width(40)->class('text-center'),
|
||||||
|
Column::make('alias'),
|
||||||
|
Column::make('genre.name')->data('genre_name')->title('Genre'),
|
||||||
|
Column::make('latin'),
|
||||||
|
Column::make('tags2')->title('Tags')->searchable(false)->orderable(false),
|
||||||
|
Column::make('varieties_count')->title('#Var')->searchable(false)->addClass('text-right'),
|
||||||
|
Column::make('tags_count')->title('#Tag')->searchable(false)->addClass('text-right'),
|
||||||
|
Column::make('images_count')->title('#Pho')->searchable(false)->addClass('text-right'),
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
54
app/Datatables/Botanic/VarietiesDataTable.php
Normal file
54
app/Datatables/Botanic/VarietiesDataTable.php
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Botanic;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Botanic\Variety;
|
||||||
|
use App\Repositories\Botanic\Varieties;
|
||||||
|
use App\Repositories\Shop\Tags;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class VarietiesDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'varieties';
|
||||||
|
|
||||||
|
public function query(Variety $model)
|
||||||
|
{
|
||||||
|
$model = $model::joinRelationship('Specie')->select('botanic_varieties.*', 'botanic_species.name as specie_name')->with(['image', 'Specie', 'tags'])->withCount(['Articles', 'tags', 'images']);
|
||||||
|
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function modifier($datatables)
|
||||||
|
{
|
||||||
|
$datatables
|
||||||
|
->editColumn('thumb', function (Variety $variety) {
|
||||||
|
return Varieties::getThumb($variety->image, false);
|
||||||
|
})
|
||||||
|
->editColumn('tags2', function (Variety $variety) {
|
||||||
|
$html = '';
|
||||||
|
foreach ($variety->tags as $tag) {
|
||||||
|
$html .= Tags::getTagHtml($tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $html;
|
||||||
|
})
|
||||||
|
->rawColumns(['thumb', 'tags2', 'action']);
|
||||||
|
|
||||||
|
return parent::modifier($datatables);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('Specie.name')->data('specie_name')->title('Espèce'),
|
||||||
|
Column::make('thumb')->title('')->searchable(false)->orderable(false)->width(40)->class('text-center'),
|
||||||
|
Column::make('name')->title('Nom'),
|
||||||
|
Column::make('tags2')->title('Tags')->searchable(false)->orderable(false),
|
||||||
|
Column::make('articles_count')->title('#Art')->class('text-right')->searchable(false),
|
||||||
|
Column::make('tags_count')->title('#Tag')->class('text-right')->searchable(false),
|
||||||
|
Column::make('images_count')->title('#Pho')->class('text-right')->searchable(false),
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
193
app/Datatables/ParentDataTable.php
Normal file
193
app/Datatables/ParentDataTable.php
Normal file
@@ -0,0 +1,193 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables;
|
||||||
|
|
||||||
|
use Yajra\DataTables\Html\Button;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
use Yajra\DataTables\Services\DataTable;
|
||||||
|
|
||||||
|
class ParentDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $autoWidth = false;
|
||||||
|
|
||||||
|
public $colReorder = false;
|
||||||
|
|
||||||
|
public $fixedColumns = false;
|
||||||
|
|
||||||
|
public $fixedHeader = false;
|
||||||
|
|
||||||
|
public $rowReorder = false;
|
||||||
|
|
||||||
|
public $rowReorderSelector; // ['selector' => 'tr']
|
||||||
|
|
||||||
|
public $scrollCollapse = false;
|
||||||
|
|
||||||
|
public $scrollX = false;
|
||||||
|
|
||||||
|
public $sortedColumn = 0;
|
||||||
|
|
||||||
|
public $sortedOrder = 'asc';
|
||||||
|
|
||||||
|
public $stateSave = true;
|
||||||
|
|
||||||
|
public function dataTable($query)
|
||||||
|
{
|
||||||
|
return $this->modifier(datatables()->eloquent($query));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function modifier($datatables)
|
||||||
|
{
|
||||||
|
return $this->addButtons($datatables->setRowId('{{$id}}'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addButtons($datatables)
|
||||||
|
{
|
||||||
|
return $datatables->addColumn('action', $this->getHtmlButtons());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getHtmlButtons()
|
||||||
|
{
|
||||||
|
return self::getButtonEdit().self::getButtonDel();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getButtonEdit($field = 'id', $title = 'Modifier')
|
||||||
|
{
|
||||||
|
return view('components.form.buttons.edit', [
|
||||||
|
'dataId' => '{{$'.$field.'}}',
|
||||||
|
'class' => 'btn-sm mr-2',
|
||||||
|
'title' => $title,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getButtonShow($field = 'id', $title = 'Voir')
|
||||||
|
{
|
||||||
|
return view('components.form.buttons.show', [
|
||||||
|
'dataId' => '{{$'.$field.'}}',
|
||||||
|
'class' => 'btn-sm mr-2',
|
||||||
|
'title' => $title,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getButtonDel($field = 'id', $title = 'Effacer')
|
||||||
|
{
|
||||||
|
return view('components.form.buttons.delete', [
|
||||||
|
'dataId' => '{{$'.$field.'}}',
|
||||||
|
'class' => 'btn-sm mr-2',
|
||||||
|
'title' => $title,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function makeColumnButtons()
|
||||||
|
{
|
||||||
|
return Column::computed('action')
|
||||||
|
->title('')
|
||||||
|
->exportable(false)
|
||||||
|
->printable(false)
|
||||||
|
->searchable(false)
|
||||||
|
->width(74)
|
||||||
|
->addClass('text-center text-nowrap');
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function isFilteredByField($field)
|
||||||
|
{
|
||||||
|
if (request()->has('filters.'.$field)) {
|
||||||
|
return request()->input('filters.'.$field);
|
||||||
|
}
|
||||||
|
|
||||||
|
return request()->has($field) ? request()->input($field) : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function buildQuery($model)
|
||||||
|
{
|
||||||
|
return $model->newQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function html()
|
||||||
|
{
|
||||||
|
return $this->buildHtml(strtolower($this->model_name).'-table');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function buildHtml($table_id = false, $selector = false)
|
||||||
|
{
|
||||||
|
$table_id = $table_id ? $table_id : strtolower($this->model_name).'-table';
|
||||||
|
$selector = $selector ? $selector : '#'.$this->model_name.'-filters';
|
||||||
|
|
||||||
|
return $this->builder()
|
||||||
|
->setTableId($table_id)
|
||||||
|
->parameters($this->getParameters())
|
||||||
|
->columns($this->getColumns())
|
||||||
|
->ajax([
|
||||||
|
'data' => 'function(d) { d.filters = $("'.$selector.'").serializeJSON(); }',
|
||||||
|
'url' => $this->url ?? '',
|
||||||
|
])
|
||||||
|
->dom($this->getDom())
|
||||||
|
->orderBy($this->sortedColumn, $this->sortedOrder)
|
||||||
|
->buttons($this->getButtons());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getButtons()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Button::make('print'),
|
||||||
|
Button::make('colvis'),
|
||||||
|
Button::make('columnsToggle'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getParameters()
|
||||||
|
{
|
||||||
|
$data = [
|
||||||
|
'autoWidth' => $this->autoWidth,
|
||||||
|
'colReorder' => $this->colReorder,
|
||||||
|
'fixedColumns' => $this->fixedColumns,
|
||||||
|
'fixedHeader' => $this->fixedHeader,
|
||||||
|
'pageLength' => 10,
|
||||||
|
'searchDelay' => 500,
|
||||||
|
'scrollX' => $this->scrollX,
|
||||||
|
'scrollCollapse' => $this->scrollCollapse,
|
||||||
|
'stateSave' => $this->stateSave,
|
||||||
|
];
|
||||||
|
if ($this->rowReorder) {
|
||||||
|
$data['rowReorder'] = ['selector' => $this->rowReorderSelector];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDom()
|
||||||
|
{
|
||||||
|
return 'rt'.$this->getDatatablesFooterDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDatatablesHeader()
|
||||||
|
{
|
||||||
|
return view('components.datatables.header');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDatatablesHeaderDefault()
|
||||||
|
{
|
||||||
|
return "<'row dt-toolbar-header'<'col-lg-4'l><'col-lg-4'B><'col-lg-4 text-right add'f>>";
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDatatablesFooterDefault()
|
||||||
|
{
|
||||||
|
return "<'row pt-3 dt-toolbar-footer'<'col-md-6'i><'col-md-6'p>>";
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function filename(): string
|
||||||
|
{
|
||||||
|
return self::buildFilename($this->model_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function buildFilename($name)
|
||||||
|
{
|
||||||
|
return $name.'_'.date('YmdHis');
|
||||||
|
}
|
||||||
|
}
|
||||||
28
app/Datatables/Shop/CustomerDeliveriesDataTable.php
Normal file
28
app/Datatables/Shop/CustomerDeliveriesDataTable.php
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\Customer;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class CustomerDeliveriesDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'customer_deliveries';
|
||||||
|
|
||||||
|
public function query(Customer $model)
|
||||||
|
{
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('name')->title('Nom'),
|
||||||
|
Column::make('address')->title('Adresse'),
|
||||||
|
Column::make('zipcode')->title('Code postal'),
|
||||||
|
Column::make('city')->title('Ville'),
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
81
app/Datatables/Shop/CustomerInvoicesDataTable.php
Normal file
81
app/Datatables/Shop/CustomerInvoicesDataTable.php
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\Invoice;
|
||||||
|
use App\Repositories\Shop\Customers;
|
||||||
|
use App\Repositories\Shop\InvoicePayments;
|
||||||
|
use App\Repositories\Shop\Invoices;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class CustomerInvoicesDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'invoices';
|
||||||
|
|
||||||
|
public $sortedColumn = 1;
|
||||||
|
|
||||||
|
public $sortedOrder = 'desc';
|
||||||
|
|
||||||
|
public $stateSave = true;
|
||||||
|
|
||||||
|
public $url = null;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->url = route('Shop.Invoices.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function query(Invoice $model)
|
||||||
|
{
|
||||||
|
$customerId = Customers::getId();
|
||||||
|
$model = $model->byCustomer($customerId)->with(['address']);
|
||||||
|
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getHtmlButtons()
|
||||||
|
{
|
||||||
|
$buttons = view('components.form.button', [
|
||||||
|
'dataId' => '{{$uuid}}',
|
||||||
|
'class' => 'btn-sm btn-secondary btn-invoice mr-2',
|
||||||
|
'icon' => 'fa-file-pdf',
|
||||||
|
'title' => 'Télécharger la facture',
|
||||||
|
'url' => route('Shop.Invoices.pdf').'/{{$uuid}}',
|
||||||
|
]);
|
||||||
|
|
||||||
|
$buttons .= self::getButtonShow('uuid', 'Voir la facture');
|
||||||
|
|
||||||
|
return $buttons;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function modifier($datatables)
|
||||||
|
{
|
||||||
|
$datatables
|
||||||
|
->editColumn('status', function (Invoice $invoice) {
|
||||||
|
return Invoices::getStatus($invoice->status);
|
||||||
|
})
|
||||||
|
->editColumn('created_at', function (Invoice $invoice) {
|
||||||
|
return $invoice->created_at->isoFormat('DD/MM/YY HH:mm');
|
||||||
|
})
|
||||||
|
->editColumn('payment_type', function (Invoice $invoice) {
|
||||||
|
return InvoicePayments::getPaymentType($invoice->payment_type);
|
||||||
|
})
|
||||||
|
->rawColumns(['action']);
|
||||||
|
|
||||||
|
return parent::modifier($datatables);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('created_at')->title('Date'),
|
||||||
|
Column::make('ref')->title('Ref'),
|
||||||
|
Column::make('payment_type')->title('Règlement'),
|
||||||
|
Column::make('total_shipped')->title('Montant')->class('text-right'),
|
||||||
|
Column::make('status')->title('Statut'),
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
70
app/Datatables/Shop/CustomerOrdersDataTable.php
Normal file
70
app/Datatables/Shop/CustomerOrdersDataTable.php
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\Order;
|
||||||
|
use App\Repositories\Shop\Customers;
|
||||||
|
use App\Repositories\Shop\Orders;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class CustomerOrdersDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'orders';
|
||||||
|
|
||||||
|
public $sortedColumn = 1;
|
||||||
|
|
||||||
|
public $sortedOrder = 'desc';
|
||||||
|
|
||||||
|
public $stateSave = true;
|
||||||
|
|
||||||
|
public $url = null;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->url = route('Shop.Orders.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function query(Order $model)
|
||||||
|
{
|
||||||
|
$customerId = Customers::getId();
|
||||||
|
$model = $model->byCustomer($customerId);
|
||||||
|
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getHtmlButtons()
|
||||||
|
{
|
||||||
|
$buttons = '';
|
||||||
|
|
||||||
|
$buttons .= self::getButtonShow('uuid', 'Voir la facture');
|
||||||
|
|
||||||
|
return $buttons;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function modifier($datatables)
|
||||||
|
{
|
||||||
|
$datatables
|
||||||
|
->editColumn('status', function (Order $order) {
|
||||||
|
return Orders::getStatus($order->status);
|
||||||
|
})
|
||||||
|
->editColumn('created_at', function (Order $order) {
|
||||||
|
return $order->created_at->isoFormat('DD/MM/YY HH:mm');
|
||||||
|
})
|
||||||
|
->rawColumns(['action']);
|
||||||
|
|
||||||
|
return parent::modifier($datatables);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('created_at')->title('Date'),
|
||||||
|
Column::make('ref')->title('Ref'),
|
||||||
|
Column::make('total_shipped')->title('Montant')->class('text-right'),
|
||||||
|
Column::make('status')->title('Statut'),
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
51
app/Datatables/Shop/InvoicesDataTable.php
Normal file
51
app/Datatables/Shop/InvoicesDataTable.php
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\Invoice;
|
||||||
|
use App\Repositories\Shop\Invoices;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class InvoicesDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'Invoices';
|
||||||
|
|
||||||
|
public function query(Invoice $model)
|
||||||
|
{
|
||||||
|
$model = $model->with('customer');
|
||||||
|
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function modifier($datatables)
|
||||||
|
{
|
||||||
|
$datatables
|
||||||
|
->editColumn('status', function (Invoice $invoice) {
|
||||||
|
return Invoices::getStatus($invoice->status);
|
||||||
|
})
|
||||||
|
->editColumn('created_at', function (Invoice $invoice) {
|
||||||
|
return $invoice->created_at->toDateTimeString();
|
||||||
|
})
|
||||||
|
->editColumn('customer.last_name', function (Invoice $invoice) {
|
||||||
|
$customer = $invoice->customer ?? false;
|
||||||
|
|
||||||
|
return $customer ? $customer->last_name.' '.$customer->first_name : '';
|
||||||
|
})
|
||||||
|
->rawColumns(['action']);
|
||||||
|
|
||||||
|
return parent::modifier($datatables);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('ref')->title('Ref')->width(80),
|
||||||
|
Column::make('status')->width(60),
|
||||||
|
Column::make('created_at')->title('Date')->width(100),
|
||||||
|
Column::make('customer.last_name')->title('Client')->default(''),
|
||||||
|
Column::make('total')->addClass('text-right'),
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
66
app/Datatables/Shop/OrdersDataTable.php
Normal file
66
app/Datatables/Shop/OrdersDataTable.php
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Datatables\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\ParentDataTable as DataTable;
|
||||||
|
use App\Models\Shop\Order;
|
||||||
|
use App\Repositories\Shop\InvoicePayments;
|
||||||
|
use App\Repositories\Shop\Orders;
|
||||||
|
use Yajra\DataTables\Html\Column;
|
||||||
|
|
||||||
|
class OrdersDataTable extends DataTable
|
||||||
|
{
|
||||||
|
public $model_name = 'orders';
|
||||||
|
|
||||||
|
public $sortedColumn = 1;
|
||||||
|
|
||||||
|
public $sortedOrder = 'desc';
|
||||||
|
|
||||||
|
public $stateSave = true;
|
||||||
|
|
||||||
|
public function query(Order $model)
|
||||||
|
{
|
||||||
|
$model = $model->with(['customer', 'delivery']);
|
||||||
|
|
||||||
|
return $this->buildQuery($model);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function modifier($datatables)
|
||||||
|
{
|
||||||
|
$datatables
|
||||||
|
->editColumn('status', function (Order $order) {
|
||||||
|
return Orders::getStatus($order->status);
|
||||||
|
})
|
||||||
|
->editColumn('created_at', function (Order $order) {
|
||||||
|
return $order->created_at->toDateTimeString();
|
||||||
|
})
|
||||||
|
->editColumn('customer.last_name', function (Order $order) {
|
||||||
|
return $order->customer->last_name.' '.$order->customer->first_name;
|
||||||
|
})
|
||||||
|
->editColumn('payment_type', function (Order $order) {
|
||||||
|
return InvoicePayments::getPaymentType($order->payment_type);
|
||||||
|
})
|
||||||
|
->rawColumns(['action']);
|
||||||
|
|
||||||
|
return parent::modifier($datatables);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getHtmlButtons()
|
||||||
|
{
|
||||||
|
return '<button type="button" data-id="{{$uuid}}" class="btn btn-xs btn-secondary btn-show mr-2"><i class="fa fa-fw fa-eye"></i></button>';
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getColumns()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Column::make('created_at')->title('Date'),
|
||||||
|
Column::make('ref')->title('Ref'),
|
||||||
|
Column::make('customer.last_name')->title('Client'),
|
||||||
|
Column::make('delivery.name')->title('Point de distribution'),
|
||||||
|
Column::make('payment_type')->title('Règlement'),
|
||||||
|
Column::make('total_shipped')->title('Montant')->class('text-right'),
|
||||||
|
Column::make('status')->title('Statut'),
|
||||||
|
$this->makeColumnButtons(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,53 +2,25 @@
|
|||||||
|
|
||||||
namespace App\Exceptions;
|
namespace App\Exceptions;
|
||||||
|
|
||||||
use Exception;
|
|
||||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||||
|
use Throwable;
|
||||||
|
|
||||||
class Handler extends ExceptionHandler
|
class Handler extends ExceptionHandler
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* A list of the exception types that are not reported.
|
|
||||||
*
|
|
||||||
* @var array
|
|
||||||
*/
|
|
||||||
protected $dontReport = [
|
protected $dontReport = [
|
||||||
//
|
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
|
||||||
* A list of the inputs that are never flashed for validation exceptions.
|
|
||||||
*
|
|
||||||
* @var array
|
|
||||||
*/
|
|
||||||
protected $dontFlash = [
|
protected $dontFlash = [
|
||||||
'password',
|
'password',
|
||||||
'password_confirmation',
|
'password_confirmation',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
public function report(Throwable $exception)
|
||||||
* Report or log an exception.
|
|
||||||
*
|
|
||||||
* @param \Exception $exception
|
|
||||||
* @return void
|
|
||||||
*
|
|
||||||
* @throws \Exception
|
|
||||||
*/
|
|
||||||
public function report(Exception $exception)
|
|
||||||
{
|
{
|
||||||
parent::report($exception);
|
parent::report($exception);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function render($request, Throwable $exception)
|
||||||
* Render an exception into an HTTP response.
|
|
||||||
*
|
|
||||||
* @param \Illuminate\Http\Request $request
|
|
||||||
* @param \Exception $exception
|
|
||||||
* @return \Symfony\Component\HttpFoundation\Response
|
|
||||||
*
|
|
||||||
* @throws \Exception
|
|
||||||
*/
|
|
||||||
public function render($request, Exception $exception)
|
|
||||||
{
|
{
|
||||||
return parent::render($request, $exception);
|
return parent::render($request, $exception);
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
13
app/Http/Controllers/Admin/Botanic/Controller.php
Normal file
13
app/Http/Controllers/Admin/Botanic/Controller.php
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Botanic;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||||
|
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||||
|
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||||
|
use Illuminate\Routing\Controller as BaseController;
|
||||||
|
|
||||||
|
class Controller extends BaseController
|
||||||
|
{
|
||||||
|
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
|
||||||
|
}
|
||||||
40
app/Http/Controllers/Admin/Botanic/FamilyController.php
Normal file
40
app/Http/Controllers/Admin/Botanic/FamilyController.php
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Botanic;
|
||||||
|
|
||||||
|
use App\Datatables\Botanic\FamiliesDataTable;
|
||||||
|
use App\Repositories\Botanic\Families;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class FamilyController extends Controller
|
||||||
|
{
|
||||||
|
public function index(FamiliesDataTable $dataTable)
|
||||||
|
{
|
||||||
|
return $dataTable->render('Admin.Botanic.Families.list');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
return view('Admin.Botanic.Families.create');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$data = $request->all();
|
||||||
|
$ret = Families::store($data);
|
||||||
|
|
||||||
|
return redirect()->route('Admin.Botanic.Families.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$data['family'] = Families::get($id)->toArray();
|
||||||
|
|
||||||
|
return view('Admin.Botanic.Families.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
return Families::destroy($id);
|
||||||
|
}
|
||||||
|
}
|
||||||
44
app/Http/Controllers/Admin/Botanic/GenreController.php
Normal file
44
app/Http/Controllers/Admin/Botanic/GenreController.php
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Botanic;
|
||||||
|
|
||||||
|
use App\Datatables\Botanic\GenresDataTable;
|
||||||
|
use App\Repositories\Botanic\Families;
|
||||||
|
use App\Repositories\Botanic\Genres;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class GenreController extends Controller
|
||||||
|
{
|
||||||
|
public function index(GenresDataTable $dataTable)
|
||||||
|
{
|
||||||
|
return $dataTable->render('Admin.Botanic.Genres.list');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
$data = Genres::init();
|
||||||
|
|
||||||
|
return view('Admin.Botanic.Genres.create', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$data = $request->all();
|
||||||
|
$ret = Genres::store($data);
|
||||||
|
|
||||||
|
return redirect()->route('Admin.Botanic.Genres.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$data = Genres::init();
|
||||||
|
$data['genre'] = Genres::get($id);
|
||||||
|
|
||||||
|
return view('Admin.Botanic.Genres.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
return Genres::destroy($id);
|
||||||
|
}
|
||||||
|
}
|
||||||
68
app/Http/Controllers/Admin/Botanic/SpecieController.php
Normal file
68
app/Http/Controllers/Admin/Botanic/SpecieController.php
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Botanic;
|
||||||
|
|
||||||
|
use App\Datatables\Botanic\SpeciesDataTable;
|
||||||
|
use App\Repositories\Botanic\Genres;
|
||||||
|
use App\Repositories\Botanic\Species;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class SpecieController extends Controller
|
||||||
|
{
|
||||||
|
public function index(SpeciesDataTable $dataTable)
|
||||||
|
{
|
||||||
|
return $dataTable->render('Admin.Botanic.Species.list');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getOptions()
|
||||||
|
{
|
||||||
|
return response()->json(['0' => ''] + Species::getOptions());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
$data = Genres::init();
|
||||||
|
|
||||||
|
return view('Admin.Botanic.Species.create', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$data = $request->all();
|
||||||
|
$ret = Species::storeFull($data);
|
||||||
|
|
||||||
|
return redirect()->route('Admin.Botanic.Species.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$data = Genres::init();
|
||||||
|
$data['specie'] = Species::getFull($id);
|
||||||
|
|
||||||
|
return view('Admin.Botanic.Species.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
return Species::destroy($id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getImages(Request $request, $id = false, $can_edit = true)
|
||||||
|
{
|
||||||
|
$id = $id ? $id : $request->input('id');
|
||||||
|
$data = [
|
||||||
|
'images' => Species::getImages($id),
|
||||||
|
'can_edit' => $can_edit,
|
||||||
|
];
|
||||||
|
|
||||||
|
return view('components.uploader.mini-gallery-items', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function deleteImage(Request $request)
|
||||||
|
{
|
||||||
|
$id = $request->input('id');
|
||||||
|
$index = $request->input('index');
|
||||||
|
|
||||||
|
return Species::deleteImage($id, $index);
|
||||||
|
}
|
||||||
|
}
|
||||||
69
app/Http/Controllers/Admin/Botanic/VarietyController.php
Normal file
69
app/Http/Controllers/Admin/Botanic/VarietyController.php
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Botanic;
|
||||||
|
|
||||||
|
use App\Datatables\Botanic\VarietiesDataTable;
|
||||||
|
use App\Repositories\Botanic\Species;
|
||||||
|
use App\Repositories\Botanic\Varieties;
|
||||||
|
use App\Repositories\Shop\TagGroups;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class VarietyController extends Controller
|
||||||
|
{
|
||||||
|
public function index(VarietiesDataTable $dataTable)
|
||||||
|
{
|
||||||
|
return $dataTable->render('Admin.Botanic.Varieties.list');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getOptionsWithSpecie()
|
||||||
|
{
|
||||||
|
return response()->json(['0' => ''] + Varieties::getOptionsWithSpecie());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
$data = Varieties::init();
|
||||||
|
|
||||||
|
return view('Admin.Botanic.Varieties.create', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$data = $request->all();
|
||||||
|
Varieties::storeFull($data);
|
||||||
|
|
||||||
|
return redirect()->route('Admin.Botanic.Varieties.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$data = Varieties::init();
|
||||||
|
$data['variety'] = Varieties::getFull($id);
|
||||||
|
|
||||||
|
return view('Admin.Botanic.Varieties.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
return Varieties::destroy($id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getImages(Request $request, $id = false, $can_edit = true)
|
||||||
|
{
|
||||||
|
$id = $id ? $id : $request->input('id');
|
||||||
|
$data = [
|
||||||
|
'images' => Varieties::getImages($id),
|
||||||
|
'can_edit' => $can_edit,
|
||||||
|
];
|
||||||
|
|
||||||
|
return view('components.uploader.mini-gallery-items', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function deleteImage(Request $request)
|
||||||
|
{
|
||||||
|
$id = $request->input('id');
|
||||||
|
$index = $request->input('index');
|
||||||
|
|
||||||
|
return Varieties::deleteImage($id, $index);
|
||||||
|
}
|
||||||
|
}
|
||||||
9
app/Http/Controllers/Admin/Controller.php
Normal file
9
app/Http/Controllers/Admin/Controller.php
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller as ParentController;
|
||||||
|
|
||||||
|
class Controller extends ParentController
|
||||||
|
{
|
||||||
|
}
|
||||||
57
app/Http/Controllers/Admin/Core/CommentController.php
Normal file
57
app/Http/Controllers/Admin/Core/CommentController.php
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Core;
|
||||||
|
|
||||||
|
use App\Datatables\Admin\Core\CommentsDataTable;
|
||||||
|
use App\Repositories\Core\Comments;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class CommentController extends Controller
|
||||||
|
{
|
||||||
|
public function index($model, $model_id)
|
||||||
|
{
|
||||||
|
$data['comments'] = Comments::getCommentsByModel($model, $model_id);
|
||||||
|
|
||||||
|
return view('Admin.Core.Comments.partials.list-comments', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function list(CommentsDataTable $dataTable, $model, $model_id)
|
||||||
|
{
|
||||||
|
$data['model'] = $model;
|
||||||
|
$data['model_id'] = $model_id;
|
||||||
|
|
||||||
|
return $dataTable->render('Admin.Core.Comment.index', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create($model, $model_id)
|
||||||
|
{
|
||||||
|
$data['comment']['commentable_type'] = $model;
|
||||||
|
$data['comment']['commentable_id'] = $model_id;
|
||||||
|
|
||||||
|
return view('Admin.Core.Comments.partials.modal', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit(Request $request, $id = false)
|
||||||
|
{
|
||||||
|
$id = $id ? $id : $request->input('id');
|
||||||
|
$data = Comments::get($id);
|
||||||
|
|
||||||
|
return view('Admin.Core.Comments.partials.modal', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$data = $request->all();
|
||||||
|
Comments::store($data);
|
||||||
|
|
||||||
|
return response()->json(['error' => 0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy(Request $request, $id = false)
|
||||||
|
{
|
||||||
|
$id = $id ? $id : $request->input('id');
|
||||||
|
Comments::destroy($id);
|
||||||
|
|
||||||
|
return response()->json(['error' => 0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
9
app/Http/Controllers/Admin/Core/Controller.php
Normal file
9
app/Http/Controllers/Admin/Core/Controller.php
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Core;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller as ParentController;
|
||||||
|
|
||||||
|
class Controller extends ParentController
|
||||||
|
{
|
||||||
|
}
|
||||||
9
app/Http/Controllers/Admin/Core/Mail/Controller.php
Normal file
9
app/Http/Controllers/Admin/Core/Mail/Controller.php
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Core\Mail;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller as ParentController;
|
||||||
|
|
||||||
|
class Controller extends ParentController
|
||||||
|
{
|
||||||
|
}
|
||||||
26
app/Http/Controllers/Admin/Core/Mail/MailLogController.php
Normal file
26
app/Http/Controllers/Admin/Core/Mail/MailLogController.php
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Core\Mail;
|
||||||
|
|
||||||
|
use App\Datatables\Admin\Core\Mail\MailLogsDataTable;
|
||||||
|
use App\Repositories\Core\Mail\MailLogs;
|
||||||
|
|
||||||
|
class MailLogController extends Controller
|
||||||
|
{
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
// $this->middleware('ability:admin');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function index(MailLogsDataTable $dataTable)
|
||||||
|
{
|
||||||
|
return $dataTable->render('admin.Core.Mail.MailLog.index', $data ?? []);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show($id)
|
||||||
|
{
|
||||||
|
$data['message'] = MailLogs::getParsed($id);
|
||||||
|
|
||||||
|
return view('admin.Core.Mail.MailLog.modal', $data);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Core\Mail;
|
||||||
|
|
||||||
|
use App\Datatables\Admin\Core\Mail\MailTemplatesDataTable;
|
||||||
|
use App\Repositories\Core\Mail\MailTemplates;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class MailTemplateController extends Controller
|
||||||
|
{
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
// $this->middleware('ability:admin');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function index(MailTemplatesDataTable $dataTable)
|
||||||
|
{
|
||||||
|
return $dataTable->render('Admin.Core.Mail.MailTemplate.index', $data ?? []);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function modalCreate()
|
||||||
|
{
|
||||||
|
$data = MailTemplates::init();
|
||||||
|
|
||||||
|
return view('Admin.Core.Mail.MailTemplate.modal', $data ?? []);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function modalEdit($id = false)
|
||||||
|
{
|
||||||
|
$data = MailTemplates::init();
|
||||||
|
$data['mail_template'] = MailTemplates::edit($id);
|
||||||
|
|
||||||
|
return view('Admin.Core.Mail.MailTemplate.modal', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function storeAjax(Request $request)
|
||||||
|
{
|
||||||
|
$data = $request->all();
|
||||||
|
unset($data['proengsoft_jsvalidation']);
|
||||||
|
$ret = MailTemplates::store($data);
|
||||||
|
|
||||||
|
return response()->json(['error' => 0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy(Request $request, $id = false)
|
||||||
|
{
|
||||||
|
$id = $id ?? $request->input('id');
|
||||||
|
MailTemplates::destroy($id);
|
||||||
|
|
||||||
|
return response()->json(['error' => 0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getVarsByMailable($mailable)
|
||||||
|
{
|
||||||
|
$data['vars'] = MailTemplates::getVarsByMailable($mailable);
|
||||||
|
|
||||||
|
return view('Admin.Core.Mail.MailTemplate.partials.vars', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function preview($template_id, $model_id)
|
||||||
|
{
|
||||||
|
return MailTemplates::preview($template_id, $model_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function modalPreview($template_id)
|
||||||
|
{
|
||||||
|
$data = MailTemplates::getDataFormodalPreview($template_id);
|
||||||
|
|
||||||
|
return view('Admin.Core.Mail.MailTemplate.partials.modalPreview', $data);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,28 +2,29 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers\Admin;
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
use App\Charts\Shop\Order;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Repositories\Shop\Dashboards;
|
||||||
|
use Carbon\Carbon;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
class HomeController extends Controller
|
class HomeController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Create a new controller instance.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->middleware('auth');
|
$this->middleware('auth');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function index(Request $request, $period = false)
|
||||||
* Show the application dashboard.
|
|
||||||
*
|
|
||||||
* @return \Illuminate\Contracts\Support\Renderable
|
|
||||||
*/
|
|
||||||
public function index()
|
|
||||||
{
|
{
|
||||||
// return redirect('dashboard');
|
$start = $request->input('start') ?? Carbon::now()->subMonths(12)->startOfMonth();
|
||||||
|
$end = $request->input('end') ?? Carbon::now();
|
||||||
|
|
||||||
|
$data = Dashboards::getStats($start, $end);
|
||||||
|
$data['chart'] = Order::getMonthly();
|
||||||
|
|
||||||
|
// dump($data);
|
||||||
|
// exit;
|
||||||
|
return view('Admin.Shop.Dashboard.index', $data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
132
app/Http/Controllers/Admin/Shop/ArticleController.php
Normal file
132
app/Http/Controllers/Admin/Shop/ArticleController.php
Normal file
@@ -0,0 +1,132 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\Admin\Shop\ArticlesDataTable;
|
||||||
|
use App\Http\Requests\Admin\Shop\StoreArticlePost;
|
||||||
|
use App\Repositories\Shop\ArticleInherited;
|
||||||
|
use App\Repositories\Shop\ArticleNatures;
|
||||||
|
use App\Repositories\Shop\Articles;
|
||||||
|
use App\Repositories\Shop\Categories;
|
||||||
|
use App\Repositories\Shop\Tags;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class ArticleController extends Controller
|
||||||
|
{
|
||||||
|
public function autocomplete(Request $request, $str = false)
|
||||||
|
{
|
||||||
|
$str = $str ? $str : $request->input('q');
|
||||||
|
|
||||||
|
return response()->json(Articles::autocomplete($str));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function index(ArticlesDataTable $dataTable)
|
||||||
|
{
|
||||||
|
$data = [
|
||||||
|
'article_natures' => ArticleNatures::getOptions(),
|
||||||
|
'categories' => Categories::getOptions(),
|
||||||
|
'tags' => Tags::getOptionsFullName(),
|
||||||
|
];
|
||||||
|
|
||||||
|
return $dataTable->render('Admin.Shop.Articles.list', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
$data = Articles::getMeta();
|
||||||
|
|
||||||
|
return view('Admin.Shop.Articles.create', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(StoreArticlePost $request)
|
||||||
|
{
|
||||||
|
$data = $request->all();
|
||||||
|
$data['visible'] = $data['visible'] ?? false;
|
||||||
|
$data['homepage'] = $data['homepage'] ?? false;
|
||||||
|
|
||||||
|
Articles::storeFull($data);
|
||||||
|
|
||||||
|
return redirect()->route('Admin.Shop.Articles.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show($id)
|
||||||
|
{
|
||||||
|
$data['article'] = Articles::get($id);
|
||||||
|
|
||||||
|
return view('Admin.Shop.Articles.view', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$data = Articles::getFull($id);
|
||||||
|
|
||||||
|
return view('Admin.Shop.Articles.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
return Articles::destroy($id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getProductDescription($productId, $model)
|
||||||
|
{
|
||||||
|
$data = [
|
||||||
|
'article' => [
|
||||||
|
'inherited' => ArticleInherited::getInheritedByProduct($productId, base64_decode($model)),
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
return view('Admin.Shop.Articles.partials.product.description', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getProductTags($productId, $model)
|
||||||
|
{
|
||||||
|
$data = ArticleInherited::getInheritedByProduct($productId, base64_decode($model));
|
||||||
|
|
||||||
|
return view('Admin.Shop.Articles.partials.product.tags', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getProductImages($productId)
|
||||||
|
{
|
||||||
|
$data = [
|
||||||
|
'article' => [
|
||||||
|
'product_id' => $productId,
|
||||||
|
],
|
||||||
|
'no_popup' => false,
|
||||||
|
];
|
||||||
|
|
||||||
|
return view('Admin.Shop.Articles.partials.product.images', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getImages(Request $request, $id = false)
|
||||||
|
{
|
||||||
|
$id = $id ? $id : $request->input('id');
|
||||||
|
$data = [
|
||||||
|
'images' => Articles::getImages($id),
|
||||||
|
];
|
||||||
|
|
||||||
|
return view('components.uploader.mini-gallery-items', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function deleteImage(Request $request)
|
||||||
|
{
|
||||||
|
$id = $request->input('id');
|
||||||
|
$index = $request->input('index');
|
||||||
|
|
||||||
|
return Articles::deleteImage($id, $index);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function toggleVisible(Request $request)
|
||||||
|
{
|
||||||
|
$data = Articles::toggleVisible($request->input('id'), $request->input('visible') === 'true' ? 1 : 0);
|
||||||
|
|
||||||
|
return response()->json(['error' => 0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function toggleHomepage(Request $request)
|
||||||
|
{
|
||||||
|
$data = Articles::toggleHomepage($request->input('id'), $request->input('homepage') === 'true' ? 1 : 0);
|
||||||
|
|
||||||
|
return response()->json(['error' => 0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
65
app/Http/Controllers/Admin/Shop/ArticleNatureController.php
Normal file
65
app/Http/Controllers/Admin/Shop/ArticleNatureController.php
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\Admin\Shop\ArticleNaturesDataTable;
|
||||||
|
use App\Repositories\Shop\ArticleNatures;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
|
class ArticleNatureController extends Controller
|
||||||
|
{
|
||||||
|
public function index(ArticleNaturesDataTable $dataTable)
|
||||||
|
{
|
||||||
|
return $dataTable->render('Admin.Shop.ArticleNatures.list');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
return view('Admin.Shop.ArticleNatures.create');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$data = $request->all();
|
||||||
|
$data['slug'] = Str::slug($data['name'], '-');
|
||||||
|
$articleNature = ArticleNatures::store($request->all());
|
||||||
|
ArticleNatures::storeIcon($articleNature, $request->file('icon'), 'icon');
|
||||||
|
ArticleNatures::storeIcon($articleNature, $request->file('icon_selection'), 'icon_selection');
|
||||||
|
|
||||||
|
return redirect()->route('Admin.Shop.ArticleNatures.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show($id)
|
||||||
|
{
|
||||||
|
$data = [
|
||||||
|
'article_nature' => ArticleNatures::get($id),
|
||||||
|
];
|
||||||
|
|
||||||
|
return view('Admin.Shop.ArticleNatures.view', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$data = [
|
||||||
|
'article_nature' => ArticleNatures::get($id),
|
||||||
|
'product_types' => ArticleNatures::getProductTypes(),
|
||||||
|
];
|
||||||
|
$data['article_nature']['icon'] = ArticleNatures::getIcon($id, 'normal', 'icon');
|
||||||
|
$data['article_nature']['icon_selection'] = ArticleNatures::getIcon($id, 'normal', 'icon_selection');
|
||||||
|
|
||||||
|
return view('Admin.Shop.ArticleNatures.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
return ArticleNatures::destroy($id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getOptions(Request $request)
|
||||||
|
{
|
||||||
|
$data = ArticleNatures::getOptionsByProductTypeModel($request->input('product_type'));
|
||||||
|
|
||||||
|
return response()->json(['0' => ''] + $data);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,56 +1,51 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Http\Controllers\Shop\Admin;
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use App\Http\Controllers\Controller;
|
|
||||||
|
|
||||||
|
use App\Datatables\Admin\Shop\CategoriesDataTable;
|
||||||
use App\Repositories\Shop\Categories;
|
use App\Repositories\Shop\Categories;
|
||||||
use App\DataTables\Shop\CategoriesDataTable;
|
use App\Repositories\Shop\TagGroups;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
class CategoryController extends Controller
|
class CategoryController extends Controller
|
||||||
{
|
{
|
||||||
|
|
||||||
public function index(CategoriesDataTable $dataTable)
|
public function index(CategoriesDataTable $dataTable)
|
||||||
{
|
{
|
||||||
return $dataTable->render('Shop.Admin.Categories.list');
|
return $dataTable->render('Admin.Shop.Categories.list');
|
||||||
}
|
|
||||||
|
|
||||||
public function getDatatable(Request $request)
|
|
||||||
{
|
|
||||||
return Categories::getTables($request->all());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function create()
|
public function create()
|
||||||
{
|
{
|
||||||
$data = [];
|
$data = [
|
||||||
$data['category_id'] = 0;
|
'category_id' => 0,
|
||||||
$data['categories'] = Categories::getOptions();
|
'categories' => Categories::getOptions(),
|
||||||
return view('Shop.Admin.Categories.create', $data);
|
'tags_list' => TagGroups::getTreeTags(),
|
||||||
|
];
|
||||||
|
|
||||||
|
return view('Admin.Shop.Categories.create', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function store(Request $request)
|
public function store(Request $request)
|
||||||
{
|
{
|
||||||
$ret = Categories::store($request->all());
|
$ret = Categories::storeFull($request->all());
|
||||||
return redirect()->route('Shop.Admin.Categories.index');
|
|
||||||
|
return redirect()->route('Admin.Shop.Categories.index');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function show($id)
|
public function show($id)
|
||||||
{
|
{
|
||||||
$data = Categories::get($id);
|
$data = Categories::get($id);
|
||||||
return view('Shop.Admin.Categories.view', $data);
|
|
||||||
|
return view('Admin.Shop.Categories.view', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function edit($id)
|
public function edit($id)
|
||||||
{
|
{
|
||||||
$data = Categories::get($id)->toArray();
|
$data['category'] = Categories::getFull($id);
|
||||||
$data['categories'] = Categories::getOptions();
|
$data['categories'] = Categories::getOptions();
|
||||||
return view('Shop.Admin.Categories.edit', $data);
|
$data['tags_list'] = TagGroups::getTreeTags();
|
||||||
}
|
|
||||||
|
|
||||||
public function update(Request $request)
|
return view('Admin.Shop.Categories.edit', $data);
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function destroy($id)
|
public function destroy($id)
|
||||||
@@ -62,6 +57,7 @@ class CategoryController extends Controller
|
|||||||
{
|
{
|
||||||
$id = $id ? $id : $request->input('id');
|
$id = $id ? $id : $request->input('id');
|
||||||
$data['images'] = Categories::getImages($id);
|
$data['images'] = Categories::getImages($id);
|
||||||
|
|
||||||
return view('components.uploader.mini-gallery-items', $data);
|
return view('components.uploader.mini-gallery-items', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,6 +65,7 @@ class CategoryController extends Controller
|
|||||||
{
|
{
|
||||||
$id = $request->input('id');
|
$id = $request->input('id');
|
||||||
$index = $request->input('index');
|
$index = $request->input('index');
|
||||||
|
|
||||||
return Categories::deleteImage($id, $index);
|
return Categories::deleteImage($id, $index);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,7 +74,21 @@ class CategoryController extends Controller
|
|||||||
$node_id = $request->input('node_id');
|
$node_id = $request->input('node_id');
|
||||||
$target_id = $request->input('target_id');
|
$target_id = $request->input('target_id');
|
||||||
$type = $request->input('type');
|
$type = $request->input('type');
|
||||||
|
|
||||||
return Categories::moveTree($node_id, $target_id, $type);
|
return Categories::moveTree($node_id, $target_id, $type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function toggleVisible(Request $request)
|
||||||
|
{
|
||||||
|
$data = Categories::toggleVisible($request->input('id'), $request->input('visible') === 'true' ? 1 : 0);
|
||||||
|
|
||||||
|
return response()->json(['error' => 0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function toggleHomepage(Request $request)
|
||||||
|
{
|
||||||
|
$data = Categories::toggleHomepage($request->input('id'), $request->input('homepage') === 'true' ? 1 : 0);
|
||||||
|
|
||||||
|
return response()->json(['error' => 0]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
41
app/Http/Controllers/Admin/Shop/ContentController.php
Normal file
41
app/Http/Controllers/Admin/Shop/ContentController.php
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\Admin\Shop\ContentsDataTable;
|
||||||
|
use App\Repositories\Shop\Contents;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class ContentController extends Controller
|
||||||
|
{
|
||||||
|
public function index(ContentsDataTable $dataTable)
|
||||||
|
{
|
||||||
|
return $dataTable->render('Admin.Shop.Contents.list');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
return view('Admin.Shop.Contents.create');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$ret = Contents::store($request->all());
|
||||||
|
|
||||||
|
return redirect()->route('Admin.Shop.Contents.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$data = [
|
||||||
|
'content' => Contents::get($id),
|
||||||
|
];
|
||||||
|
|
||||||
|
return view('Admin.Shop.Contents.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
return Contents::destroy($id);
|
||||||
|
}
|
||||||
|
}
|
||||||
13
app/Http/Controllers/Admin/Shop/Controller.php
Normal file
13
app/Http/Controllers/Admin/Shop/Controller.php
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||||
|
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||||
|
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||||
|
use Illuminate\Routing\Controller as BaseController;
|
||||||
|
|
||||||
|
class Controller extends BaseController
|
||||||
|
{
|
||||||
|
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\Admin\Shop\CustomerAddressesDataTable;
|
||||||
|
use App\Repositories\Shop\CustomerAddresses;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class CustomerAddressController extends Controller
|
||||||
|
{
|
||||||
|
public function index(CustomerAddressesDataTable $dataTable)
|
||||||
|
{
|
||||||
|
return $dataTable->render('Admin.Shop.CustomerAddresses.list');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
$data = [
|
||||||
|
'with_country' => false,
|
||||||
|
];
|
||||||
|
|
||||||
|
return view('Admin.Shop.CustomerAddresses.create', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$ret = CustomerAddresses::store($request->all());
|
||||||
|
|
||||||
|
return redirect()->route('Admin.Shop.CustomerAddresses.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show($id)
|
||||||
|
{
|
||||||
|
$data = [
|
||||||
|
'customer' => CustomerAddresses::get($id),
|
||||||
|
];
|
||||||
|
|
||||||
|
return view('Admin.Shop.CustomerAddresses.view', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$data = [
|
||||||
|
'customer' => CustomerAddresses::edit($id),
|
||||||
|
];
|
||||||
|
|
||||||
|
return view('Admin.Shop.CustomerAddresses.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
return CustomerAddresses::destroy($id);
|
||||||
|
}
|
||||||
|
}
|
||||||
60
app/Http/Controllers/Admin/Shop/CustomerController.php
Normal file
60
app/Http/Controllers/Admin/Shop/CustomerController.php
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\Admin\Shop\CustomerAddressesDataTable;
|
||||||
|
use App\Datatables\Admin\Shop\CustomerInvoicesDataTable;
|
||||||
|
use App\Datatables\Admin\Shop\CustomerOrdersDataTable;
|
||||||
|
use App\Datatables\Admin\Shop\CustomersDataTable;
|
||||||
|
use App\Repositories\Shop\Customers;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class CustomerController extends Controller
|
||||||
|
{
|
||||||
|
public function index(CustomersDataTable $dataTable)
|
||||||
|
{
|
||||||
|
$data = Customers::init();
|
||||||
|
|
||||||
|
return $dataTable->render('Admin.Shop.Customers.list', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
$data = Customers::init();
|
||||||
|
|
||||||
|
return view('Admin.Shop.Customers.create', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$ret = Customers::storeFull($request->all());
|
||||||
|
|
||||||
|
return redirect()->route('Admin.Shop.Customers.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show($id)
|
||||||
|
{
|
||||||
|
$data = [
|
||||||
|
'customer' => Customers::get($id),
|
||||||
|
];
|
||||||
|
|
||||||
|
return view('Admin.Shop.Customers.view', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$data = Customers::init() + [
|
||||||
|
'customer' => Customers::edit($id),
|
||||||
|
'customer_addresses' => (new CustomerAddressesDataTable())->html(),
|
||||||
|
'customer_invoices' => (new CustomerInvoicesDataTable())->html(),
|
||||||
|
'customer_orders' => (new CustomerOrdersDataTable())->html(),
|
||||||
|
];
|
||||||
|
|
||||||
|
return view('Admin.Shop.Customers.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
return Customers::destroy($id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\Admin\Shop\CustomerInvoicesDataTable;
|
||||||
|
use App\Repositories\Shop\Invoices;
|
||||||
|
|
||||||
|
class CustomerInvoiceController extends Controller
|
||||||
|
{
|
||||||
|
public function index(CustomerInvoicesDataTable $dataTable)
|
||||||
|
{
|
||||||
|
return $dataTable->render('Admin.Shop.CustomerInvoices.list');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show($id)
|
||||||
|
{
|
||||||
|
$data = [
|
||||||
|
'invoice' => Invoices::get($id),
|
||||||
|
];
|
||||||
|
|
||||||
|
return view('Admin.Shop.CustomerInvoices.view', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
return Invoices::destroy($id);
|
||||||
|
}
|
||||||
|
}
|
||||||
28
app/Http/Controllers/Admin/Shop/CustomerOrderController.php
Normal file
28
app/Http/Controllers/Admin/Shop/CustomerOrderController.php
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\Admin\Shop\CustomerOrdersDataTable;
|
||||||
|
use App\Repositories\Shop\Orders;
|
||||||
|
|
||||||
|
class CustomerOrderController extends Controller
|
||||||
|
{
|
||||||
|
public function index(CustomerOrdersDataTable $dataTable)
|
||||||
|
{
|
||||||
|
return $dataTable->render('Admin.Shop.CustomerOrders.list');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show($id)
|
||||||
|
{
|
||||||
|
$data = [
|
||||||
|
'order' => Orders::get($id),
|
||||||
|
];
|
||||||
|
|
||||||
|
return view('Admin.Shop.CustomerOrders.view', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
return Orders::destroy($id);
|
||||||
|
}
|
||||||
|
}
|
||||||
24
app/Http/Controllers/Admin/Shop/DashboardController.php
Normal file
24
app/Http/Controllers/Admin/Shop/DashboardController.php
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Repositories\Shop\Dashboards;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class DashboardController extends Controller
|
||||||
|
{
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->middleware('auth');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function index(Request $request)
|
||||||
|
{
|
||||||
|
$data = $request->all();
|
||||||
|
$data = Dashboards::getStats($data);
|
||||||
|
dump($data);
|
||||||
|
|
||||||
|
return view('Admin.Shop.Dashboard.index', $data);
|
||||||
|
}
|
||||||
|
}
|
||||||
60
app/Http/Controllers/Admin/Shop/DeliveryController.php
Normal file
60
app/Http/Controllers/Admin/Shop/DeliveryController.php
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\Admin\Shop\DeliveriesDataTable;
|
||||||
|
use App\Repositories\Shop\Deliveries;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class DeliveryController extends Controller
|
||||||
|
{
|
||||||
|
public function index(DeliveriesDataTable $dataTable)
|
||||||
|
{
|
||||||
|
$data = Deliveries::init();
|
||||||
|
|
||||||
|
return $dataTable->render('Admin.Shop.Deliveries.list', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
$data = Deliveries::init();
|
||||||
|
|
||||||
|
return view('Admin.Shop.Deliveries.create', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$ret = Deliveries::store($request->all());
|
||||||
|
|
||||||
|
return redirect()->route('Admin.Shop.Deliveries.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show($id)
|
||||||
|
{
|
||||||
|
$data = [
|
||||||
|
'delivery' => Deliveries::getArray($id),
|
||||||
|
];
|
||||||
|
|
||||||
|
return view('Admin.Shop.Deliveries.view', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$data = Deliveries::init();
|
||||||
|
$data['delivery'] = Deliveries::getArray($id);
|
||||||
|
|
||||||
|
return view('Admin.Shop.Deliveries.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
return Deliveries::destroy($id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function toggleActive(Request $request)
|
||||||
|
{
|
||||||
|
$data = Deliveries::toggleActive($request->input('id'), $request->input('active') === 'true' ? 1 : 0);
|
||||||
|
|
||||||
|
return response()->json(['error' => 0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\Admin\Shop\DeliveryPackagesDataTable;
|
||||||
|
use App\Repositories\Shop\DeliveryPackages;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class DeliveryPackageController extends Controller
|
||||||
|
{
|
||||||
|
public function index(DeliveryPackagesDataTable $dataTable)
|
||||||
|
{
|
||||||
|
return $dataTable->render('Admin.Shop.DeliveryPackages.list');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
return view('Admin.Shop.DeliveryPackages.create');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$ret = DeliveryPackages::store($request->all());
|
||||||
|
|
||||||
|
return redirect()->route('Admin.Shop.DeliveryPackages.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$data['package'] = DeliveryPackages::get($id)->toArray();
|
||||||
|
|
||||||
|
return view('Admin.Shop.DeliveryPackages.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
return DeliveryPackages::destroy($id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\Admin\Shop\DeliveryTypeCalculationsDataTable;
|
||||||
|
use App\Repositories\Shop\DeliveryTypeCalculations;
|
||||||
|
use App\Repositories\Shop\DeliveryTypes;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class DeliveryTypeCalculationController extends Controller
|
||||||
|
{
|
||||||
|
public function index(DeliveryTypeCalculationsDataTable $dataTable)
|
||||||
|
{
|
||||||
|
return $dataTable->render('Admin.Shop.DeliveryTypeCalculations.list');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
$data = [
|
||||||
|
'delivery_types' => DeliveryTypes::getOptions(),
|
||||||
|
];
|
||||||
|
|
||||||
|
return view('Admin.Shop.DeliveryTypeCalculations.create', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$ret = DeliveryTypeCalculations::store($request->all());
|
||||||
|
|
||||||
|
return redirect()->route('Admin.Shop.DeliveryTypeCalculations.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$data = [
|
||||||
|
'calcul' => DeliveryTypeCalculations::get($id)->toArray(),
|
||||||
|
'delivery_types' => DeliveryTypes::getOptions(),
|
||||||
|
];
|
||||||
|
|
||||||
|
return view('Admin.Shop.DeliveryTypeCalculations.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
return DeliveryTypeCalculations::destroy($id);
|
||||||
|
}
|
||||||
|
}
|
||||||
40
app/Http/Controllers/Admin/Shop/DeliveryTypeController.php
Normal file
40
app/Http/Controllers/Admin/Shop/DeliveryTypeController.php
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\Admin\Shop\DeliveryTypesDataTable;
|
||||||
|
use App\Repositories\Shop\DeliveryTypes;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class DeliveryTypeController extends Controller
|
||||||
|
{
|
||||||
|
public function index(DeliveryTypesDataTable $dataTable)
|
||||||
|
{
|
||||||
|
return $dataTable->render('Admin.Shop.DeliveryTypes.list');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
return view('Admin.Shop.DeliveryTypes.create');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$ret = DeliveryTypes::store($request->all());
|
||||||
|
|
||||||
|
return redirect()->route('Admin.Shop.DeliveryTypes.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$data = [];
|
||||||
|
$data['delivery'] = DeliveryTypes::get($id)->toArray();
|
||||||
|
|
||||||
|
return view('Admin.Shop.DeliveryTypes.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
return DeliveryTypes::destroy($id);
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
app/Http/Controllers/Admin/Shop/HomeController.php
Normal file
BIN
app/Http/Controllers/Admin/Shop/HomeController.php
Normal file
Binary file not shown.
49
app/Http/Controllers/Admin/Shop/InvoiceController.php
Normal file
49
app/Http/Controllers/Admin/Shop/InvoiceController.php
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin\Shop;
|
||||||
|
|
||||||
|
use App\Datatables\Admin\Shop\InvoicesDataTable;
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Repositories\Shop\Invoices;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class InvoiceController extends Controller
|
||||||
|
{
|
||||||
|
public function index(InvoicesDataTable $dataTable)
|
||||||
|
{
|
||||||
|
return $dataTable->render('Admin.Shop.Invoices.list');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
return view('Admin.Shop.Invoices.create');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$ret = Invoices::store($request->all());
|
||||||
|
|
||||||
|
return redirect()->route('Admin.Shop.Invoices.index');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show($id)
|
||||||
|
{
|
||||||
|
$data = [];
|
||||||
|
$data['invoice'] = Invoices::getFull($id)->toArray();
|
||||||
|
|
||||||
|
return view('Admin.Shop.Invoices.view', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$data = Invoices::init();
|
||||||
|
$data['invoice'] = Invoices::getFull($id)->toArray();
|
||||||
|
|
||||||
|
return view('Admin.Shop.Invoices.edit', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
return Invoices::delete($id);
|
||||||
|
}
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user