Compare commits

...

376 Commits

Author SHA1 Message Date
Valentin Lab
ccb0399d91 new: doc: added `AGENTS.md` and small addition of a french paragraph 2025-10-10 08:20:13 +02:00
Valentin Lab
062d3a9141 fix: add delivery cost on load if delivery is selected 2025-10-05 12:38:19 +02:00
Valentin Lab
9ba8f4acf4 fix: make the selected channel apply changes to product each time 2025-10-05 12:33:08 +02:00
Valentin Lab
e080d98e81 fix: display only delivery types that have a price and auto-select first 2025-10-05 10:09:03 +02:00
Valentin Lab
bd63a92604 fix: make delivery option on checkout stick to the current sale channel 2025-10-05 09:56:33 +02:00
Valentin Lab
dc05eb31ac new: add channel management 2025-10-05 09:39:27 +02:00
Valentin Lab
5bee7c5e50 fix: make sale channel description field editable 2025-10-05 05:26:20 +02:00
Valentin Lab
31500f3386 new: make admin delivery edition can toggle off public and active states 2025-10-05 03:32:08 +02:00
Valentin Lab
0f58dfe1f4 fix: make save button avoid error 500 in delivery method admin page 2025-10-05 03:28:03 +02:00
Valentin Lab
c0737e3bce new: make the eye icon work to see an invoice in admin customer view 2025-10-04 15:37:28 +02:00
Valentin Lab
7913576f1a fix: remove 404 about javascript file in admin console 2025-10-04 14:39:07 +02:00
Valentin Lab
d88b8c8a70 new: keep cart when login in 2025-10-04 14:13:48 +02:00
Valentin Lab
f2a87f4d12 new: make click in choices of search box load the page of the product 2025-10-04 13:54:21 +02:00
Valentin Lab
c338a8afc7 fix: make invoices creation resistant to missing address if this still happens 2025-10-04 12:55:11 +02:00
Valentin Lab
29c21367d7 new: make invoice still keep the old addresses when their address gets deleted in profile 2025-10-04 12:39:13 +02:00
Valentin Lab
09b6c3cf28 fix: make the button to add an address unusable when the address form is open 2025-10-04 12:19:24 +02:00
Valentin Lab
a34905f34e new: add persistence of default address selection 2025-10-04 11:59:57 +02:00
Valentin Lab
8d8528f6fb new: display the default address checkbox on profile load 2025-10-04 11:59:57 +02:00
Valentin Lab
e69487f73e fix: make the address appear when added 2025-10-04 11:59:57 +02:00
Valentin Lab
a2da0a8a12 fix: prevent deleting last address for each kind 2025-10-04 11:59:57 +02:00
Valentin Lab
b7634e07c0 fix: prevent 404 when deleting an adress 2025-10-04 11:06:43 +02:00
Valentin Lab
ece0b433fd fix: prevent error 500 on profile edition 2025-10-04 10:51:41 +02:00
Valentin Lab
c94d815e5a fix: move `build directory to resources/shop` 2025-10-04 10:13:38 +02:00
Valentin Lab
0d0e7c4652 fix: repair favicon links and provide one from https://www.jardinenvie.com 2025-10-04 09:41:15 +02:00
Valentin Lab
0e9d758e6b fix: finalize payments and clear cart after Paybox success
This captures the Paybox verification flow, duplicate-payment guard, and cart cleanup.
2025-10-04 09:17:53 +02:00
Valentin Lab
883d2d634d fix: do not call debugbar if not available (when in prod) 2025-09-29 11:32:19 +02:00
Valentin Lab
1503f21b3b new: add docker build reproducible code 2025-09-29 11:22:02 +02:00
Valentin Lab
17fa80b96b fix: pkg: repair grunt 2025-09-25 13:58:09 +02:00
ludo
92c9975e81 fix: fix 2025-04-21 10:57:31 +02:00
ludo
b214d8dc74 fixes 2025-03-18 13:06:02 +01:00
ludo
08fc49cb61 fixes 2025-02-15 12:12:42 +01:00
ludo
0f32386406 remove browsershot 2025-01-03 16:05:05 +01:00
ludo
4023fd9ee4 fix contents 2025-01-03 16:04:19 +01:00
ludo
1e32fd7cf1 fix calculation on indirect articles by tags 2025-01-03 14:45:23 +01:00
ludo
870fc6c806 refactor scopes 2025-01-03 14:09:22 +01:00
ludo
045641e687 fixes 2025-01-03 03:46:45 +01:00
ludo
38e477ee5f fixes 2024-06-17 21:56:42 +02:00
ludo
561cd2248c fixes on addresses 2024-04-29 22:01:45 +02:00
ludo
0a538ee1a2 fix on producter 2024-03-11 19:31:22 +01:00
ludo
e490c27837 fix on tags 2024-03-11 19:02:57 +01:00
ludo
e92f38f6c3 fixes on auth customers 2024-03-11 18:48:25 +01:00
ludo
296dc4fde2 fix route 2024-03-11 18:38:23 +01:00
ludo
e4e2126ada fixes 2024-03-03 22:52:00 +01:00
ludo
44391e817c Core classes removed by error 2024-03-03 14:53:54 +01:00
ludo
5359375210 fixes 2024-03-03 14:44:35 +01:00
ludo
c15a6e380f minor fixes 2024-02-23 08:35:41 +01:00
ludo
3acb69abe4 cleaning day 2024-02-22 21:28:33 +01:00
ludo
00fc978217 coding style 2024-02-22 19:35:51 +01:00
ludo
7a33245c1e add monitoring 2024-02-22 19:33:56 +01:00
ludo
927be4ea77 add seo 2024-02-19 23:51:32 +01:00
ludo
b0b87db86d add shop cart storage 2024-02-07 21:54:58 +01:00
ludo
53448d7907 fixes 2024-02-07 21:11:17 +01:00
ludo
e920157c0b add health route 2024-02-07 21:07:19 +01:00
ludo
8f905ce1eb add health route 2024-02-07 21:05:48 +01:00
ludo
b95da54240 add health 2024-02-07 21:01:02 +01:00
ludo
e6ad147790 fix 2024-02-07 20:43:58 +01:00
ludo
5fc8d3dc57 move autocomplete for customer 2024-02-07 20:41:04 +01:00
ludo
4caf069011 force https on docker 2024-02-07 20:31:51 +01:00
ludo
d0e97ccd08 add restore backup 2024-02-05 22:36:45 +01:00
ludo
38ce69b525 fix on worker with php 8.2 2024-02-05 22:04:17 +01:00
ludo
b67e91d228 fix ports 2024-02-05 21:48:07 +01:00
ludo
94f84a7a85 fix on docker 2024-02-05 21:38:40 +01:00
ludo
54ab6b0231 fix on docker 2024-02-05 21:34:29 +01:00
ludo
9e30118088 add watermark on zoom, update display of article nature on shelve (change icon to text 2024-02-04 22:09:53 +01:00
ludo
6c88e43b74 add datatbles for invoices, add pdf icon, refactor icons components, add autocomplete on search, adapt searching to meilisearch 2024-02-04 02:51:38 +01:00
ludo
5c20e6d5d0 add new search engine 2024-01-31 23:45:58 +01:00
ludo
79af996c63 add metrics 2024-01-30 23:24:00 +01:00
ludo
c0c4146c9c add migration to catrt storage, update SCOUT 2024-01-29 23:45:55 +01:00
ludo
84bc5f2e67 add new metrics, graph metrics, prepare basket to storage 2024-01-29 23:44:49 +01:00
ludo
72f5da4555 add graphs for stats 2024-01-29 22:39:57 +01:00
ludo
349204307f Merge branch 'master' of https://gitlab.huma.net/ludo/opensem 2024-01-28 20:28:39 +01:00
ludo
36459de793 fix articles datatables, enhance statistics 2024-01-28 19:56:13 +01:00
Ludovic CANDELLIER
d432827bab restrict ports to be compatible with legacy version 2024-01-23 00:01:15 +01:00
Ludovic CANDELLIER
930695166d add certbot 2024-01-22 23:05:39 +01:00
Ludovic CANDELLIER
8c39035cdc add slave1 2024-01-22 23:04:23 +01:00
Ludovic CANDELLIER
6a1d8ba80a remove highcharts 2024-01-22 23:01:33 +01:00
Ludovic CANDELLIER
6f8340b90b remove old models 2024-01-22 22:52:03 +01:00
ludo
c5f06a608c update 2024-01-22 22:50:56 +01:00
ludo
50111787aa Merge branch 'master' of https://gitlab.huma.net/ludo/opensem 2024-01-22 22:47:39 +01:00
ludo
b80c2a8d41 update migrations 2024-01-22 22:47:20 +01:00
Ludovic CANDELLIER
2eea4ec73d update docker 2024-01-22 22:14:36 +01:00
ludo
88a57a9c32 refactoring on Articles, minor fixes 2024-01-21 11:42:42 +01:00
ludo
7e5b1fea89 render invoice in pdf 2024-01-07 23:16:29 +01:00
ludo
c053221662 fixing styles 2024-01-07 20:42:37 +01:00
ludo
25b8fc40c5 fix devops error 2024-01-05 01:30:46 +01:00
ludo
d33dd6e755 coding styles 2024-01-04 15:54:18 +01:00
ludo
04f92c9695 fix on payment by cb 2024-01-04 15:43:02 +01:00
ludo
7c8546e450 update payments and vat mentions 2023-12-21 23:04:42 +01:00
ludo
585d42264f fix parameters for invoices 2023-12-21 16:57:40 +01:00
ludo
9f4ef99ce2 fix greedy replace 2023-12-12 21:40:24 +01:00
ludo
501f3a5ab9 minor fixes 2023-12-11 21:09:48 +01:00
ludo
0ff39c1401 adjust deliveries by customer 2023-12-11 21:07:49 +01:00
ludo
71ecb13af0 change homepages to contents, add new methods to deliveries and sale_channels by customer 2023-12-09 23:55:50 +01:00
ludo
7561a8e8ba minor fixes 2023-12-09 21:02:28 +01:00
ludo
bbf4bc4232 enhance invoice display 2023-12-03 02:20:41 +01:00
ludo
5d5ea92127 better management of shipping and basket summary display 2023-12-03 00:40:47 +01:00
ludo
a84995e0ce add basket on merchandise form 2023-11-25 20:42:15 +01:00
ludo
fcc564b6d8 update 2023-11-25 20:23:21 +01:00
ludo
be468304c9 fix invoice payment 2023-11-25 19:33:41 +01:00
ludo
b812a78f9f add payments by invoice 2023-11-25 16:21:35 +01:00
ludo
0ec0b8e85b fix on merchandises with validator 2023-11-25 16:21:02 +01:00
ludo
9d520abfcf try to refresh total with recalculation by delivery and delivery_type 2023-11-16 00:00:05 +01:00
ludo
174c4ca0e2 add shipping to order, methods to calculate, little refactoring 2023-11-15 23:20:42 +01:00
ludo
216c408596 fixes 2023-11-14 00:25:58 +01:00
ludo
3cdb30a0dc little refactoring 2023-11-14 00:11:31 +01:00
ludo
5bcf265cda add validator, optimizations 2023-11-13 23:03:12 +01:00
ludo
7ec1d3e89b fix on weight 2023-11-13 00:40:41 +01:00
ludo
741f389620 Fix on addresses 2023-11-13 00:02:21 +01:00
ludo
37f1ebbb59 fix on product null 2023-11-08 17:07:53 +01:00
ludo
81974d38ab fix if no icon 2023-11-08 16:55:26 +01:00
ludo
cc9672ddca fix basket 2023-10-31 17:05:41 +01:00
ludo
12903b6029 add filter not collapsed if filter is on 2023-10-17 17:47:25 +02:00
ludo
e6b15e2438 fix on customer auth, fix filters on shelves, refactor for article_nature, add slug 2023-10-17 17:20:30 +02:00
Ludovic CANDELLIER
002644cb97 Supprimer le fichier .env du répertoire docker 2023-09-13 23:10:04 +02:00
Ludovic CANDELLIER
dfe7625995 add docker version 2023-09-13 23:04:55 +02:00
Ludovic CANDELLIER
53feef282f coding style 2023-09-13 22:53:37 +02:00
Ludovic CANDELLIER
69478e3c74 minor fix on updating status of order, upgrade datatables 2023-09-13 22:17:49 +02:00
Ludovic CANDELLIER
ab8ab8eba1 adapt display of article_natures 2023-09-12 23:39:28 +02:00
Ludovic CANDELLIER
de5f3d665d adapt display of article natures by disponibility of offers in shelve 2023-09-12 23:27:56 +02:00
Ludovic CANDELLIER
afaf0cc629 add methods to get icon on article natures 2023-09-12 23:00:36 +02:00
Ludovic CANDELLIER
419a4c2b9a refactor datatables admin 2023-08-29 23:31:15 +02:00
Ludovic CANDELLIER
d750cdced7 refactoring of admin datatables 2023-08-29 22:56:37 +02:00
Ludovic CANDELLIER
01f9c9ae7c fix orders datatables on profile, fix deliveries for profile (public & active) 2023-08-29 22:15:37 +02:00
Ludovic CANDELLIER
043b7d7215 fixes on login 2023-08-28 22:58:11 +02:00
Ludovic CANDELLIER
f85df32c67 fixes 2023-08-28 21:48:04 +02:00
Ludovic CANDELLIER
6f2a985edc fixes, add weight 2023-08-01 21:55:17 +02:00
Ludovic CANDELLIER
5f1ff26196 fixes 2023-07-16 18:09:40 +02:00
Ludovic CANDELLIER
ddb4520621 fix shipping 2023-07-16 17:54:44 +02:00
Ludovic CANDELLIER
c619f540f8 fixes on bad pint 2023-07-16 15:07:15 +02:00
Ludovic CANDELLIER
39c80ce6d1 add shipping rules 2023-07-16 14:45:42 +02:00
Ludovic CANDELLIER
297dcc62d2 add mail tracker 2023-07-04 23:33:13 +02:00
Ludovic CANDELLIER
b011f40b2f add multiple addresses on customer edition 2023-07-04 23:32:41 +02:00
Ludovic CANDELLIER
fdbf819bf5 rollback to retrieve buttons 2023-07-04 19:24:31 +02:00
Ludovic CANDELLIER
f4738377c7 fixes on mail templates, change order edit layout, add DeliveryTypes, DeliveryTypeCalculations & DeliveryPackages 2023-05-24 23:30:29 +02:00
Ludovic CANDELLIER
99bdf09be7 add package to date scopes & browsershot 2023-05-09 21:51:48 +02:00
Ludovic CANDELLIER
b283363543 finish implementing mails 2023-04-17 00:27:03 +02:00
Ludovic CANDELLIER
6649c32501 add methods to detect distinct product type et article nature on shelve 2023-04-01 22:01:15 +02:00
Ludovic CANDELLIER
bc1cf1190b simplify variables names for templates, refactor to be multi-model 2023-03-28 00:17:04 +02:00
Ludovic CANDELLIER
3dc6c70c4d Enhance modal 2023-03-27 23:12:57 +02:00
Ludovic CANDELLIER
6e4f93dd65 fix on article based on old merchandise 2023-03-27 21:05:37 +02:00
Ludovic CANDELLIER
ba8f87cff4 add basket on rows, uniformize baskets 2023-03-21 23:16:47 +01:00
Ludovic CANDELLIER
efb3fe9670 fix recalculation on basket, fix quick add on basket 2023-03-21 22:41:48 +01:00
Ludovic CANDELLIER
23e6ca35ca cosmetic fixes, enhance profile, fix mails, ... 2023-03-14 23:33:14 +01:00
Ludovic CANDELLIER
695d23a139 fix active hierarchy in menu and megamenu 2023-03-14 21:46:57 +01:00
Ludovic CANDELLIER
3943fc033f add datatables on orders 2023-02-28 08:42:53 +01:00
Ludovic CANDELLIER
bb77a199eb remove buggy package for logging mail / incompatible with laravel 9 2023-02-27 23:16:45 +01:00
Ludovic CANDELLIER
808e60e41b quick add to basket on shelves 2023-02-27 23:16:15 +01:00
Ludovic CANDELLIER
260eccc1f1 adapt to laravel 9 2023-02-27 23:15:16 +01:00
Ludovic CANDELLIER
abed17b3f0 fix modal 2023-02-27 22:02:19 +01:00
Ludovic CANDELLIER
3ad83b870a fixe menu 2023-02-27 21:45:28 +01:00
Ludovic CANDELLIER
241b255b1c fix typo 2023-02-17 22:27:07 +01:00
Ludovic CANDELLIER
d2ec87c374 fix typo on Admin 2023-02-17 22:22:04 +01:00
Ludovic CANDELLIER
24b86652aa fix on sale_channel get_default 2023-02-17 22:08:13 +01:00
Ludovic CANDELLIER
923f988aba fix on sale_channel get_default 2023-02-17 22:07:43 +01:00
Ludovic CANDELLIER
0778fdc10a fix if default sale channel empty 2023-02-17 21:47:36 +01:00
Ludovic CANDELLIER
900aa413a2 Fix on invoices, add delivery reference, wip on dashboard concurrency requests designed on template 2023-02-17 00:05:03 +01:00
Ludovic CANDELLIER
820a200e88 remove debug mode 2023-02-14 00:30:30 +01:00
Ludovic CANDELLIER
186e3de863 Add overlay on css, adapt shelves, fix bienvenue mail on laravel 9 methods 2023-02-14 00:20:00 +01:00
Ludovic CANDELLIER
7722b73be9 upgrade to version 9 2023-02-13 23:47:01 +01:00
Ludovic CANDELLIER
685160ddf5 enhance components, add mailtemplate, add traits for translations, for stats 2023-02-13 22:52:39 +01:00
Ludovic CANDELLIER
7449229ff7 change icons, css, add routing to merchandise, add mail templater, fixes 2023-02-12 23:34:48 +01:00
Ludovic CANDELLIER
c5ae71544a fix megamenu on hover for yellow background 2023-02-12 00:11:25 +01:00
Ludovic CANDELLIER
926996166b change registration or connection in order page, change filter on shelve page, add new api to get article_nature by product_type, css fixes 2023-02-10 23:11:48 +01:00
Ludovic CANDELLIER
fd8e89e33c fix on empty images on merchandise 2023-02-09 23:49:17 +01:00
Ludovic CANDELLIER
503efc6f25 add cookie consent, change search for product_type empty 2023-02-07 23:25:59 +01:00
Ludovic CANDELLIER
e8ae460bab fix debug mode 2023-02-06 23:52:20 +01:00
Ludovic CANDELLIER
bb1e1a6b18 remove order alphabetically because is against reordering tree 2023-02-06 23:48:50 +01:00
Ludovic CANDELLIER
02b2d3e410 fix col, because bug on 2 lines for long menu 2023-02-05 23:22:44 +01:00
Ludovic CANDELLIER
72870680cf fix 2023-02-05 23:16:00 +01:00
Ludovic CANDELLIER
f3289334f3 fix css and html structure 2023-02-05 22:57:47 +01:00
Ludovic CANDELLIER
12e5dbb721 enhance css 2023-02-05 21:40:05 +01:00
Ludovic CANDELLIER
b42ae14428 enhance addresses 2023-01-01 22:45:27 +01:00
Ludovic CANDELLIER
ea5350a0a6 fix on login 2023-01-01 21:24:40 +01:00
Ludovic CANDELLIER
90d78bc3e3 fix 2022-12-29 19:23:28 +01:00
Ludovic CANDELLIER
a85e5f2921 fixes 2022-12-29 17:13:43 +01:00
Ludovic CANDELLIER
5e6af2e5f8 fix design, add addresses 2022-12-29 16:16:09 +01:00
Ludovic CANDELLIER
11aaaa024c fix 2022-12-22 18:17:50 +01:00
Ludovic CANDELLIER
fd1ab5cf04 fix 2022-12-22 18:16:25 +01:00
Ludovic CANDELLIER
a03befbf44 fix 2022-12-22 12:10:44 +01:00
Ludovic CANDELLIER
ce7755ffe3 fix description on shelves 2022-12-22 01:17:01 +01:00
Ludovic CANDELLIER
17792fce40 fix cache css 2022-12-22 01:12:40 +01:00
Ludovic CANDELLIER
9698ba54d0 fixes 2022-12-22 01:09:11 +01:00
Ludovic CANDELLIER
ae39681cb0 fix layout 2022-12-21 18:33:15 +01:00
Ludovic CANDELLIER
9895266798 remove dump 2022-11-24 17:51:37 +01:00
Ludovic CANDELLIER
c1a9c21e52 fix routes 2022-11-24 17:48:08 +01:00
Ludovic CANDELLIER
3a18679a1c fix on better routes 2022-11-24 17:41:57 +01:00
Ludovic CANDELLIER
6ef31f286e fix 2022-11-24 16:07:40 +01:00
Ludovic CANDELLIER
52193994a3 fixes on invoices relations and revisions 2022-11-20 00:21:38 +01:00
Ludovic CANDELLIER
71c0489862 Merge branch 'master' of https://gitlab.huma.net/ludo/opensem 2022-11-19 23:43:39 +01:00
Ludovic CANDELLIER
d33b5eea52 fix editing orders 2022-11-19 23:43:12 +01:00
Ludovic CANDELLIER
782809829b reorganize 2022-11-11 13:24:24 +01:00
Ludovic CANDELLIER
ebe7ba5f6c restart 2022-11-11 13:05:40 +01:00
Ludovic CANDELLIER
dae8156164 [WIP] Working on orders & invoices 2022-08-19 22:04:44 +02:00
Ludovic CANDELLIER
1880b25407 [WIP] Finish the order process 2022-08-18 18:20:44 +02:00
Ludo
5819f51f79 Add new file 2022-08-02 14:21:10 +00:00
Ludovic CANDELLIER
01f56204b7 fixes 2022-07-04 00:35:43 +02:00
Ludovic CANDELLIER
eadea3958d [WIP] Order process with interactive methods 2022-07-03 23:36:33 +02:00
Ludovic CANDELLIER
719e4481d7 [WIP] Order process 2022-07-03 22:38:08 +02:00
Ludovic CANDELLIER
eae2cdf345 fix on array 2022-07-03 10:48:42 +02:00
Ludovic CANDELLIER
ab145dd60f fix 2022-07-03 09:31:45 +02:00
Ludovic CANDELLIER
8054bffb43 begin order form with registration 2022-06-26 23:33:39 +02:00
Ludovic CANDELLIER
d50ecd674e fix selector on filters 2022-06-22 22:40:04 +02:00
Ludovic CANDELLIER
1703082b3e Refactor article getter for descriptions & tags, minor fixes on tags 2022-06-22 22:28:18 +02:00
Ludovic CANDELLIER
35310b049e change for description by level of data 2022-06-16 22:59:26 +02:00
Ludovic CANDELLIER
4801ff4338 missing file 2022-06-14 22:29:18 +02:00
Ludovic CANDELLIER
b2987e5eed fixes 2022-06-14 22:24:24 +02:00
Ludovic CANDELLIER
8b334bc8ed new routes 2022-06-13 23:30:06 +02:00
Ludovic CANDELLIER
79c717ae6c [WIP] begin of new display for article, shelves 2022-06-13 23:29:05 +02:00
Ludovic CANDELLIER
8abf391a53 change display on categories 2022-05-31 23:21:04 +02:00
Ludovic CANDELLIER
cc2798a78e Works for friday & saturday 2022-05-29 00:46:04 +02:00
Ludovic CANDELLIER
ce9f613b66 Add new component, add flags on filter 2022-05-09 23:14:50 +02:00
Ludovic CANDELLIER
3370b8061c modify filter calculation 2022-05-09 22:33:18 +02:00
Ludovic CANDELLIER
8c898bf63b fixes on merchandise 2022-05-02 08:34:40 +02:00
Ludovic CANDELLIER
fedf463f15 fix on empty picture 2022-04-25 23:43:25 +02:00
Ludovic CANDELLIER
73508f6b46 Fix on merchandises 2022-04-25 23:31:24 +02:00
Ludovic CANDELLIER
c79facd0ca Fixes on available offers in category childrens for building menu 2022-04-25 22:36:43 +02:00
Ludovic CANDELLIER
3ba5a833b2 fix on shelve with available offers 2022-04-25 21:59:53 +02:00
Ludovic CANDELLIER
c77db883c2 fix on empty shelve 2022-04-25 20:46:18 +02:00
Ludovic CANDELLIER
904110d10f fix 2022-04-25 20:29:50 +02:00
Ludovic CANDELLIER
3c8fab27da Add plus on products 2022-04-25 20:02:28 +02:00
Ludovic CANDELLIER
ee0954931f Add producers 2022-04-25 11:07:02 +02:00
Ludovic CANDELLIER
d399b72120 Add new data in getBasket context 2022-04-24 23:49:28 +02:00
Ludovic CANDELLIER
6fc6451f6f Add new data in getBasket context 2022-04-24 23:20:52 +02:00
Ludovic CANDELLIER
f3e9ccaa46 'fixes' 2022-04-24 22:07:31 +02:00
Ludovic CANDELLIER
1fc860715f fixes 2022-04-22 02:32:53 +02:00
Ludovic CANDELLIER
6837954fc9 Filters collapsed, customer auth and register, fix on basket recalculation 2022-04-20 00:16:16 +02:00
Ludovic CANDELLIER
483aa59750 fix on basket 2022-04-17 00:16:36 +02:00
Ludovic CANDELLIER
f460865a57 Multi-images component, refactoring medias functions 2022-04-16 19:33:17 +02:00
Ludovic CANDELLIER
4d31b1682c Add count function for images herited 2022-04-16 13:58:09 +02:00
Ludovic CANDELLIER
ee148a27ed Add management of merchandises, enhance imageable trait 2022-04-16 11:40:19 +02:00
Ludovic CANDELLIER
79e5a6388a Build form for merchandise 2022-04-14 23:41:58 +02:00
Ludovic CANDELLIER
165262abfa Add merchandise, fix articletosell with src for images 2022-04-14 23:20:09 +02:00
Ludovic CANDELLIER
2f77b5fc23 wip 3d 2022-04-13 23:49:48 +02:00
Ludovic CANDELLIER
8afb3467f8 enhance add to basket 2022-04-01 00:11:15 +02:00
Ludovic CANDELLIER
e3c60e7cde Add homepage 2022-03-30 22:23:57 +02:00
Ludovic CANDELLIER
7187a312eb fix 2022-03-30 18:02:19 +02:00
Ludovic CANDELLIER
e208dc910b fix 2022-03-30 18:01:01 +02:00
Ludovic CANDELLIER
d4bb94a487 Fix slider 2022-03-30 17:54:50 +02:00
Ludovic CANDELLIER
e77ed62066 fix 2022-03-30 16:43:10 +02:00
Ludovic CANDELLIER
8dddd4d99b fix 2022-03-30 16:42:46 +02:00
Ludovic CANDELLIER
edf43ff270 fix 2022-03-30 16:38:49 +02:00
Ludovic CANDELLIER
36c6402f04 Fixes on grouping 2022-03-30 16:34:08 +02:00
Ludovic CANDELLIER
8ba8d9a276 Fix 2022-03-30 16:03:26 +02:00
Ludovic CANDELLIER
cdce15a29f fix 2022-03-30 16:01:12 +02:00
Ludovic CANDELLIER
c12b45f8ad fix 2022-03-30 15:59:31 +02:00
Ludovic CANDELLIER
081df4d5d0 Fix on tarif with sale_channel 2022-03-30 15:46:10 +02:00
Ludovic CANDELLIER
2d86f162a0 Try to fix price_lists by sale_channel 2022-03-30 00:36:58 +02:00
Ludovic CANDELLIER
c2b7315abf fix empty 2022-03-24 15:07:55 +01:00
Ludovic CANDELLIER
7b265d3b47 fix empty 2022-03-24 15:06:51 +01:00
Ludovic CANDELLIER
c90dd98319 Add calculations on basket 2022-03-24 14:57:39 +01:00
Ludovic CANDELLIER
193f5cf4ad Add toggle for homepage 2022-03-24 10:08:23 +01:00
Ludovic CANDELLIER
930eeaede8 Manage homepage by article, modify article template, enhance basket (add selector) 2022-03-24 00:48:26 +01:00
Ludovic CANDELLIER
36a63f3b14 Add variations, slider, fix cart ... 2022-03-21 21:52:12 +01:00
Ludovic CANDELLIER
d9dba1c515 Fix on default sale channel 2022-03-07 22:58:40 +01:00
Ludovic CANDELLIER
411b47f78d inherited description 2022-03-07 22:50:33 +01:00
Ludovic CANDELLIER
a550278f39 Fix name with spaces 2022-03-07 22:19:57 +01:00
Ludovic CANDELLIER
d715d726db Add method to get image with parent for article 2022-03-07 22:10:59 +01:00
Ludovic CANDELLIER
60acbc7939 add constaint on stock 2022-03-07 20:17:50 +01:00
Ludovic CANDELLIER
6a634c10ca Fixes on articles by sale_channel 2022-02-22 23:03:29 +01:00
Ludovic CANDELLIER
308f226ca0 fix empty 2022-02-22 22:46:10 +01:00
Ludovic CANDELLIER
c0aeda7554 fix 2022-02-22 22:41:50 +01:00
Ludovic CANDELLIER
3633581ebf Add prices and filtering by sale_channel with default 2022-02-22 22:32:46 +01:00
Ludovic CANDELLIER
15539f27a6 Add new search of articles 2022-02-21 09:09:36 +01:00
Ludovic CANDELLIER
0a9d03e214 Add price taxed 2022-02-20 21:59:19 +01:00
Ludovic CANDELLIER
36f16921bb change construction of articles/offers 2022-02-20 21:38:21 +01:00
Ludovic CANDELLIER
cbe397be6a fix 2022-02-18 09:48:02 +01:00
Ludovic CANDELLIER
8dc409bd78 Fix visible 2022-02-18 09:46:20 +01:00
Ludovic CANDELLIER
56659c73bb Fix save 2022-02-17 16:27:44 +01:00
Ludovic CANDELLIER
accc94f56b fix empty 2022-02-17 12:42:46 +01:00
Ludovic CANDELLIER
64f5663da5 fix empty 2022-02-17 12:30:17 +01:00
Ludovic CANDELLIER
c6ba4aaa24 active visible on shelves 2022-02-17 12:27:20 +01:00
Ludovic CANDELLIER
020954a7cc fix 2022-02-17 12:14:22 +01:00
Ludovic CANDELLIER
61be4a6769 fix on new tariff_unities 2022-02-17 12:03:01 +01:00
Ludovic CANDELLIER
cf9439852f Fix old methods 2022-02-17 11:52:19 +01:00
Ludovic CANDELLIER
5bf3b7ec7b change old route 2022-02-17 11:44:47 +01:00
Ludovic CANDELLIER
715e228b41 Fix save 2022-02-17 11:42:11 +01:00
Ludovic CANDELLIER
91675dc83b Upgrade package category and dependencies for php8.0 2022-02-17 11:38:19 +01:00
Ludovic CANDELLIER
e0addd61ce fix unsetted 2022-02-17 09:44:30 +01:00
Ludovic CANDELLIER
66cc7a6054 Fix 2022-02-16 09:42:08 +01:00
Ludovic CANDELLIER
2d6b092b64 Fix categories & varieties 2022-02-16 09:17:51 +01:00
Ludovic CANDELLIER
9ab19b0e4d fix name 2022-02-15 13:55:28 +01:00
Ludovic CANDELLIER
6110b42ce2 change template 2022-02-15 13:52:03 +01:00
Ludovic CANDELLIER
82a345c4c7 Fix 2022-02-15 13:19:30 +01:00
Ludovic CANDELLIER
c0a80aa62b fix search 2022-02-09 09:25:48 +01:00
Ludovic CANDELLIER
b325a44ee2 Add method to get offers by articles with siblings, enhance display 2022-01-30 22:48:04 +01:00
Ludovic CANDELLIER
88d87ceaab Fix bug on select2 in modal filters, add filters by tags and shelves on articles 2022-01-30 15:04:08 +01:00
Ludovic CANDELLIER
ba04007f86 fix roles 2022-01-30 00:30:21 +01:00
Ludovic CANDELLIER
81dcd273ce fix 2022-01-25 23:32:39 +01:00
Ludovic CANDELLIER
d899d3dcaa fix on image 2022-01-25 23:27:55 +01:00
Ludovic CANDELLIER
9f6d21ef04 Add no visual 2022-01-25 22:59:17 +01:00
Ludovic CANDELLIER
bdefa235eb Fixes on tag_Groups and variations, add migrations 2022-01-25 22:25:18 +01:00
Ludovic CANDELLIER
545c242bba fix on empty articles 2022-01-24 00:47:45 +01:00
Ludovic CANDELLIER
e241486143 Fix on home 2022-01-24 00:32:46 +01:00
Ludovic CANDELLIER
2f81f1d61d better integration of filters 2022-01-24 00:31:23 +01:00
Ludovic CANDELLIER
4d3ffa2ca3 Add toggle by rows/by cards 2022-01-23 23:16:56 +01:00
Ludovic CANDELLIER
f237882757 Add display of shelve 2022-01-23 22:49:23 +01:00
Ludovic CANDELLIER
090dcd6f24 fixes 2022-01-23 21:48:37 +01:00
Ludovic CANDELLIER
6db343c6b2 Add filter by sale_channel, add method to get prices by offer, sale_channel and quantity 2022-01-23 21:37:54 +01:00
Ludovic CANDELLIER
d46347a66f fix 2022-01-23 09:02:43 +01:00
Ludovic CANDELLIER
ab8f68e4bc fixes on tags with slug 2022-01-22 22:05:18 +01:00
Ludovic CANDELLIER
8c9fc66b89 Add tariff unities management 2022-01-22 19:26:35 +01:00
Ludovic CANDELLIER
2be53d581e Fixes size of description on article, fix save form on Families and genres 2022-01-22 17:53:24 +01:00
Ludovic CANDELLIER
26f3fc3d2c Display filters, and fix css for article 2022-01-22 13:12:43 +01:00
Ludovic CANDELLIER
efff4f0341 fix 2022-01-19 22:43:32 +01:00
Ludovic CANDELLIER
b3f2aa36be Add parameters to display by rows 2022-01-18 23:46:06 +01:00
Ludovic CANDELLIER
cdc88b43df Add display articles by rows, and display article in full mode 2022-01-18 23:39:27 +01:00
Ludovic CANDELLIER
ecbb7b62c9 Fix on data for article, problem with id on polymorphic 2022-01-18 00:08:04 +01:00
Ludovic CANDELLIER
b1a2e70d12 Add deep relations 2022-01-14 00:03:21 +01:00
Ludovic CANDELLIER
b2f5cc4a45 invert query from offers->articles to articles->offers 2022-01-05 22:05:30 +01:00
Ludovic CANDELLIER
8a1573d425 [WIP] Add thumb on offers, refactor categories, try to fix counter on relations polymorphic with eage loader, bad pattern ! 2021-12-17 00:30:07 +01:00
Ludovic CANDELLIER
cb0b2e4aa0 fixes 2021-11-24 23:04:13 +01:00
Ludovic CANDELLIER
7092cf23fc Manage address and deliveries 2021-11-24 20:57:12 +01:00
Ludovic CANDELLIER
e434220c16 Fix 2021-11-24 16:15:56 +01:00
Ludovic CANDELLIER
0858804095 fix on server 2021-11-24 15:56:02 +01:00
Ludovic CANDELLIER
5f7e90d22d Fix on php 7.4 2021-11-24 15:53:17 +01:00
Ludovic CANDELLIER
6dce60d227 Fixes for deliveries vs sale_channels 2021-11-23 23:37:47 +01:00
Ludovic CANDELLIER
f6668a6dd3 fixes 2021-11-07 23:41:17 +01:00
Ludovic CANDELLIER
dd396a86aa fixes 2021-11-07 19:58:38 +01:00
Ludovic CANDELLIER
f3b6504723 Fixes 2021-11-07 17:16:35 +01:00
Ludovic CANDELLIER
41cab61bda change last_nulls on mysql , is compatible with mariadb ? 2021-11-04 16:59:11 +01:00
Ludovic CANDELLIER
c76996db86 Fix 2021-11-04 16:37:42 +01:00
Ludovic CANDELLIER
f5716c6530 Add filters 2021-11-01 23:42:53 +01:00
Ludovic CANDELLIER
459d35e8a1 Minor fixes on traits 2021-11-01 18:50:17 +01:00
Ludovic CANDELLIER
e9ce44481a Add thumbs views in datatables with traits 2021-11-01 18:37:25 +01:00
Ludovic CANDELLIER
18f1f8a13a add offers count, & minor fixes code standards 2021-11-01 16:26:31 +01:00
Ludovic CANDELLIER
e97f54f126 Minor fixes, coding standards 2021-11-01 00:50:10 +01:00
Ludovic CANDELLIER
0d0e4deb16 Refactoring, change menu, add many features 2021-10-30 02:22:51 +02:00
Ludovic CANDELLIER
da51da2530 Fix 2021-10-26 21:51:47 +02:00
Ludovic CANDELLIER
c024bdc31e Fix 2021-10-26 21:47:00 +02:00
Ludovic CANDELLIER
4ec0558cd8 Synchro back-office, fix on tariffs 2021-10-26 21:41:46 +02:00
Ludovic CANDELLIER
48d89d338c refactor, better class namespace intergration 2021-10-04 14:09:51 +02:00
Ludovic CANDELLIER
0f23d5cd56 fixes 2021-10-04 13:49:45 +02:00
Ludovic CANDELLIER
9380d99688 downgrade for incompatibility with depedencies 2021-09-22 22:15:38 +02:00
Ludovic CANDELLIER
06fb42e7c7 Saving for offers 2021-09-22 22:14:39 +02:00
Ludovic CANDELLIER
66a830eec0 fix 2021-09-22 21:03:42 +02:00
Ludovic CANDELLIER
0e73c8109b Fix tags with group name 2021-09-22 21:03:19 +02:00
Ludovic CANDELLIER
5e4c9963c6 Remove duplicate migrations 2021-09-22 21:02:45 +02:00
Ludovic CANDELLIER
f9070b2ec8 Upgrade boilerplate 2021-09-22 21:01:43 +02:00
Ludovic CANDELLIER
8107078ea7 Add relations in tables, add saving states for datatables, minor fixes 2021-09-14 23:14:03 +02:00
Ludovic CANDELLIER
be3b6bc0a8 [WIP] Tentative d'ajout des tarifs dans le tableau 2021-09-09 00:30:36 +02:00
Ludovic CANDELLIER
290602057a fixes 2021-09-09 00:03:24 +02:00
Ludovic CANDELLIER
a1a3ccb227 fix filter on prices by tariff 2021-09-01 10:25:59 +02:00
Ludovic CANDELLIER
e9002fb494 add description on variations 2021-09-01 09:10:58 +02:00
Ludovic CANDELLIER
cffec143e0 fix adding price for count(prices) > 3 2021-08-31 23:33:10 +02:00
Ludovic CANDELLIER
385873a0cf Fix on refreshing description & images from products 2021-08-31 23:12:18 +02:00
Ludovic CANDELLIER
8842b7eea7 Add refreshing for inherited data 2021-08-30 22:59:50 +02:00
Ludovic CANDELLIER
0cd0e1f126 Enhance categories, add tags, parent 2021-08-26 17:45:37 +02:00
Ludovic CANDELLIER
7c01366281 Fix menu catalogue, fix path for price modal 2021-08-26 15:59:56 +02:00
Ludovic CANDELLIER
fa193a8089 Fix variation 2021-08-26 15:53:41 +02:00
Ludovic CANDELLIER
27c5663ba1 Fix translation yet forced on tags 2021-08-26 13:42:58 +02:00
Ludovic CANDELLIER
cfd8086586 Fixes on tag updating 2021-08-26 09:54:37 +02:00
Ludovic CANDELLIER
c3a05640ab Fixes 2021-08-24 23:41:10 +02:00
Ludovic CANDELLIER
ca691c8fdd Fix translation 2021-08-24 22:50:18 +02:00
Ludovic CANDELLIER
47ff07451f Fix translations typo case 2021-08-24 22:40:22 +02:00
Ludovic CANDELLIER
5bbf63b33f Fix tree 2021-08-24 22:26:37 +02:00
Ludovic CANDELLIER
768c7e88f9 Fix relationship 2021-08-24 20:42:51 +02:00
Ludovic CANDELLIER
23b8914187 fix segregation of article 2021-08-24 20:28:57 +02:00
Ludovic CANDELLIER
aee50813e4 Fix admin path 2021-08-24 19:14:29 +02:00
Ludovic CANDELLIER
331b7647de Fix css 2021-08-24 19:03:52 +02:00
Ludovic CANDELLIER
b1494477a2 Fix package eloquent-macro unavailable for now 2021-08-24 16:40:31 +02:00
Ludovic CANDELLIER
31b671bcdd remove old files 2021-08-24 16:27:05 +02:00
Ludovic CANDELLIER
9e2226a776 Fix on preview mode 2021-08-23 23:56:46 +02:00
Ludovic CANDELLIER
9ca510086b comments 2021-08-21 19:48:21 +02:00
Ludovic CANDELLIER
7ec40145de Rename Admin views directory, add some functions on models 2021-07-27 22:12:58 +02:00
Ludovic CANDELLIER
734ec87b89 Fixes on adding price & errors 2021-07-27 17:33:18 +02:00
Ludovic CANDELLIER
0d421226fa Add new version in repository 2021-07-25 23:19:27 +02:00
Ludovic CANDELLIER
d174fe1c81 MCD 2021-06-05 18:00:10 +02:00
Ludovic CANDELLIER
64abc46d99 [WIP] Refactor project 2021-05-21 00:21:05 +02:00
Ludovic CANDELLIER
f4ab8e71a8 v1 2021-05-07 00:14:27 +02:00
Ludovic CANDELLIER
763577bf87 Fixes 2021-04-19 21:45:17 +02:00
Ludovic CANDELLIER
226153f744 Fixes on article preview 2021-04-16 00:04:00 +02:00
Ludovic CANDELLIER
e298320119 Fixes on widget uploder 2021-04-15 23:58:51 +02:00
Ludovic CANDELLIER
b90d633e6e Add preview from father, add new features 2021-04-11 00:36:41 +02:00
Ludovic CANDELLIER
31e60dee45 Fix typo 2021-04-08 16:59:06 +02:00
Ludovic CANDELLIER
0dd3df2984 Fix Typo 2021-04-08 16:57:50 +02:00
Ludovic CANDELLIER
d53e9f5a4f Fix 2021-04-08 16:18:21 +02:00
1788 changed files with 115289 additions and 25811 deletions

9
.dockerignore Normal file
View File

@@ -0,0 +1,9 @@
.git
.gitlab
Dockerfile
node_modules
storage/logs
storage/framework/cache/data
.dockerignore
build.sh
opensem-*.tar.xz

View File

@@ -0,0 +1 @@

74
AGENTS.md Normal file
View File

@@ -0,0 +1,74 @@
# Repository Guidelines
## Project Structure & Module Organization
OpenSem builds on Laravel 9.
Core application code lives in `app/`, while HTTP routes reside in
`routes/` and Blade views in `resources/views/`. Reusable front-end
assets (JS, SCSS, images) sit under `resources/` and are compiled into
`public/` via Laravel Mix.
Database blueprints are versioned in `database/migrations/` with seeds
in `database/seeders/`.
Tests are organised in `tests/Unit/` and `tests/Feature/`; keep large
fixtures in `tests/Fixtures/` to avoid polluting source directories.
## Build, Test, and Development Commands
- `composer install` — install PHP dependencies defined in
`composer.json`.
- `php artisan serve` — start a local HTTP server on port 8000.
- `npm install && npm run dev` — install Node tooling and build UI
assets for development.
- `npm run prod` — generate minified production assets in `public/`.
- `php artisan migrate --seed` — apply database schema and load
default data for demo instances.
- `./build.sh` — builds a `.tar.xz` that contains the production and
deployement ready source to be deployed.
## Coding Style & Naming Conventions
Follow PSR-12 with four-space indentation and `snake_case` database
columns. Controllers, models, and Livewire components use StudlyCase
class names; private methods remain `camelCase`. Run `composer run
inspect` before opening a PR to execute `phpcs` and `phpstan`. For
front-end changes, keep Blade sections in lowercase kebab IDs (for
example, `@section('order-summary')`).
## Testing Guidelines
Use PHPUnit via `php artisan test`; target deterministic tests with
clear Arrange/Act/Assert blocks. Feature tests should mirror top-level
route names (e.g., `OrdersTest.php`). Unit tests belong in
`tests/Unit/` and should stub external services. When adding
migrations or service integrations, include coverage that exercises
failure paths. For granular checks, `./vendor/bin/phpunit --filter
FooTest` is acceptable, but always run the full suite before pushing.
## Commit & Pull Request Guidelines
Commits in this repo mix Conventional Commit prefixes (`new:`, `fix:`,
`chg:`); `fix: prevent null totals`. Keep messages in the imperative
mood and reference ticket IDs when available.
Pull requests must describe scope, list schema or configuration
changes, and note any manual follow-up (cron, storage links,
queues).
Attach screenshots or terminal logs when touching UI or console
output, and ensure CI scripts (when available) pass.
## Environment & Security Notes
Copy `.env.example` to `.env` and run `php artisan key:generate`
before local work. Never commit `.env`, `storage/`, or database dumps
containing sensitive data. Use the Docker resources in `docker/` only
for reproducible environments; keep secrets in your host overrides,
not in version control.

103
Dockerfile Normal file
View 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 /

View File

@@ -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']
} }
}, },
}); });

View File

@@ -1,10 +1,19 @@
## A propos de OpenSem ## A propos de OpenSem
OpenSem est une solution de commerce électronique et un ERP développé pour les besoins exprimés. OpenSem est une solution de commerce électronique et un ERP développé
pour les besoins exprimés.
Développée par Ludovic Candellier en étroite relation avec
Jardin'Envie.
L'application est écrite en PHP et est basée sur Laravel.
## About Laravel ## About Laravel
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as: Laravel is a web application framework with expressive, elegant
syntax. We believe development must be an enjoyable and creative
experience to be truly fulfilling. Laravel takes the pain out of
development by easing common tasks used in many web projects, such as:
- [Simple, fast routing engine](https://laravel.com/docs/routing). - [Simple, fast routing engine](https://laravel.com/docs/routing).
- [Powerful dependency injection container](https://laravel.com/docs/container). - [Powerful dependency injection container](https://laravel.com/docs/container).
@@ -14,12 +23,21 @@ Laravel is a web application framework with expressive, elegant syntax. We belie
- [Robust background job processing](https://laravel.com/docs/queues). - [Robust background job processing](https://laravel.com/docs/queues).
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting). - [Real-time event broadcasting](https://laravel.com/docs/broadcasting).
Laravel is accessible, powerful, and provides tools required for large, robust applications. Laravel is accessible, powerful, and provides tools required for
large, robust applications.
## Learning Laravel ## Learning Laravel
Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework. Laravel has the most extensive and thorough
[documentation](https://laravel.com/docs) and video tutorial library
of all modern web application frameworks, making it a breeze to get
started with the framework.
If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 1500 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library. If you don't feel like reading, [Laracasts](https://laracasts.com) can
help. Laracasts contains over 1500 video tutorials on a range of
topics including Laravel, modern PHP, unit testing, and
JavaScript. Boost your skills by digging into our comprehensive video
library.
The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). The Laravel framework is open-sourced software licensed under the [MIT
license](https://opensource.org/licenses/MIT).

22
app/Charts/Shop/Order.php Normal file
View 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']);
}
}

View 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;
}
}

View 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)]);
}
}
}

View 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]);
}
}
}

View 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]);
}
}
}

View File

@@ -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');
} }
} }

View 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;
}

View File

@@ -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(),
];
}
}

View File

@@ -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(),
];
}
}

View File

@@ -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(),
];
}
}

View File

@@ -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');
}
}

View File

@@ -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(),
];
}
}

View File

@@ -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(),
];
}
}

View File

@@ -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(),
];
}
}

View File

@@ -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(),
];
}
}

View File

@@ -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(),
];
}
}

View File

@@ -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(),
];
}
}

View File

@@ -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(),
];
}
}

View File

@@ -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(),
];
}
}

View File

@@ -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(),
];
}
}

View File

@@ -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(),
];
}
}

View File

@@ -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(),
];
}
}

View File

@@ -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(),
];
}
}

View 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(),
];
}
}

View 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'),
];
}
}

View 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(),
];
}
}

View 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(),
];
}
}

View 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(),
];
}
}

View 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(),
];
}
}

View 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(),
];
}
}

View 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 = 'customer_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(),
];
}
}

View 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(),
];
}
}

View 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(),
];
}
}

View 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(),
];
}
}

View 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(),
];
}
}

View File

@@ -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(),
];
}
}

View 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(),
];
}
}

View 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(),
];
}
}

View 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(),
];
}
}

View 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(),
];
}
}

View 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(),
];
}
}

View 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(),
];
}
}

View 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(),
];
}
}

View 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(),
];
}
}

View 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(),
];
}
}

View 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(),
];
}
}

View 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(),
];
}
}

View 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(),
];
}
}

View 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(),
];
}
}

View 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(),
];
}
}

View 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(),
];
}
}

View 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(),
];
}
}

View 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(),
];
}
}

View 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(),
];
}
}

View File

@@ -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(),
]; ];
} }
} }

View 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(),
];
}
}

View 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(),
];
}
}

View 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');
}
}

View 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(),
];
}
}

View 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(),
];
}
}

View 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(),
];
}
}

View 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(),
];
}
}

View 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(),
];
}
}

View File

@@ -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.

View 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;
}

View 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);
}
}

View 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);
}
}

View 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);
}
}

View 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);
}
}

View File

@@ -0,0 +1,9 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller as ParentController;
class Controller extends ParentController
{
}

View 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]);
}
}

View File

@@ -0,0 +1,9 @@
<?php
namespace App\Http\Controllers\Admin\Core;
use App\Http\Controllers\Controller as ParentController;
class Controller extends ParentController
{
}

View File

@@ -0,0 +1,9 @@
<?php
namespace App\Http\Controllers\Admin\Core\Mail;
use App\Http\Controllers\Controller as ParentController;
class Controller extends ParentController
{
}

View 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);
}
}

View File

@@ -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);
}
}

View File

@@ -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);
} }
} }

View 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]);
}
}

View 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);
}
}

View File

@@ -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]);
}
} }

View 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);
}
}

View 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;
}

View File

@@ -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);
}
}

View 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);
}
}

View File

@@ -0,0 +1,19 @@
<?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 destroy($id)
{
return Invoices::destroy($id);
}
}

View 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);
}
}

View 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);
}
}

View 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]);
}
}

View File

@@ -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);
}
}

View File

@@ -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);
}
}

View 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);
}
}

Some files were not shown because too many files have changed in this diff Show More