Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0ebb698c54 | ||
|
|
3621289fee | ||
|
|
544db390ef | ||
|
|
f357d716b7 | ||
|
|
a49bee1a52 | ||
|
|
286bfd14ea | ||
|
|
068288ddd1 | ||
|
|
30d4c85250 | ||
|
|
6170e5f499 | ||
|
|
b1d56d85c0 | ||
|
|
3c76533541 | ||
|
|
076c03d6c6 | ||
|
|
4f1b4d90a6 | ||
|
|
10f916f262 | ||
|
|
744581bad9 | ||
|
|
b80fe490dc | ||
|
|
179e35a88b | ||
|
|
28b825db07 | ||
|
|
d8c72cf249 | ||
|
|
c4250cc201 | ||
|
|
f54f78b03e | ||
|
|
97a9c1c4e3 | ||
|
|
6ca6e89cd5 | ||
|
|
f5d09537b9 | ||
|
|
a5c34cc6a0 | ||
|
|
5c9fe38c4b | ||
|
|
feff65ab36 | ||
|
|
c8a354e868 | ||
|
|
ccd46e79fc |
@@ -1,6 +1,7 @@
|
|||||||
*.n
|
*.n
|
||||||
*.php
|
*.php
|
||||||
config.xml
|
config.xml
|
||||||
|
/package-lock.json
|
||||||
www/plugin/*
|
www/plugin/*
|
||||||
tmp/*
|
tmp/*
|
||||||
*node_modules*
|
*node_modules*
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
1.6.0
|
||||||
@@ -50,7 +50,7 @@ compile:
|
|||||||
echo "compile Cagette.net with plugins"; \
|
echo "compile Cagette.net with plugins"; \
|
||||||
haxe cagetteAllPlugins.hxml; \
|
haxe cagetteAllPlugins.hxml; \
|
||||||
else \
|
else \
|
||||||
echo "compile Cagette.net core"; \
|
echo "compile CagettePéi core"; \
|
||||||
haxe cagette.hxml; \
|
haxe cagette.hxml; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,170 @@
|
|||||||
# Cagette péi
|
CAGETTE PEI
|
||||||
|
===========
|
||||||
|
|
||||||
Fourche du logiciel [Cagette.net](https://github.com/CagetteNet) à partir de la version 0.9.2 Novembre 2018
|
Fourche du logiciel [Cagette.net](https://github.com/CagetteNet) à partir de la version 0.9.2 Novembre 2018
|
||||||
|
|
||||||
|
Certaines portions du code source de Cagette.net n'étant plus disponibles en téléchargement,
|
||||||
|
j'ai repris sur la base d'un existant pour adapter au marché local réunionnais et leurs AMAPéi.
|
||||||
|
|
||||||
|
## INSTALL FROM SCRATCH (debian-buster)
|
||||||
|
|
||||||
|
* apt install -y curl
|
||||||
|
* curl -sL https://deb.nodesource.com/setup_8.x | bash -
|
||||||
|
* apt install -y nodejs=8.17.0-1nodesource1
|
||||||
|
* apt install -y sudo haxe apache2 make git imagemagick gettext libapache2-mod-neko mariadb-server
|
||||||
|
* mysql -u root <<EOF
|
||||||
|
CREATE DATABASE cagettepei;
|
||||||
|
GRANT ALL ON cagettepei.* TO 'cagettepei'@'%' IDENTIFIED BY 'cagettepei';
|
||||||
|
EOF
|
||||||
|
* cd /var/www
|
||||||
|
* git clone https://git.artcode.re/cagetters/cagettepei.git
|
||||||
|
* cd cagettepei
|
||||||
|
* make install ENV=dev # first time
|
||||||
|
* make compile # classes
|
||||||
|
* make templates # templates + i18n
|
||||||
|
* vim /etc/apache2/sites-available/cagettepei.conf
|
||||||
|
```
|
||||||
|
<VirtualHost *:80>
|
||||||
|
ServerName cagettepei
|
||||||
|
DirectoryIndex index.n
|
||||||
|
DocumentRoot /var/www/cagettepei/www/
|
||||||
|
</VirtualHost>
|
||||||
|
```
|
||||||
|
* sed -i '/<Directory \/var\/www\/>/,/<\/Directory>/ s/AllowOverride None/AllowOverride All/' /etc/apache2/apache2.conf
|
||||||
|
* a2dissite 000-default.conf
|
||||||
|
* a2ensite cagettepei.conf
|
||||||
|
* a2enmod neko rewrite
|
||||||
|
* systemctl restart apache2
|
||||||
|
|
||||||
|
## CONFIGURATION
|
||||||
|
|
||||||
|
* cd /var/www/cagettepei
|
||||||
|
* vim config.xml
|
||||||
|
```
|
||||||
|
<config
|
||||||
|
host="<DOMAIN.TLD>"
|
||||||
|
key="<SECRET_PHRASE>"
|
||||||
|
name = "CagettePéi"
|
||||||
|
default_email = "<EMAIL>"
|
||||||
|
webmaster_email = "<EMAIL>"
|
||||||
|
database="mysql://cagettepei:cagettepei@localhost/cagettepei"
|
||||||
|
|
||||||
|
smtp_host="localhost"
|
||||||
|
smtp_port="25"
|
||||||
|
smtp_user=""
|
||||||
|
smtp_pass=""
|
||||||
|
|
||||||
|
lang="fr"
|
||||||
|
langs="fr"
|
||||||
|
langnames="Français"
|
||||||
|
maintain="0"
|
||||||
|
debug="0"
|
||||||
|
sqllog="0"
|
||||||
|
cache="1"
|
||||||
|
cachetpl="0"
|
||||||
|
/>
|
||||||
|
```
|
||||||
|
|
||||||
|
ADMIN RESET PASSWORD
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
* # go to http://localhost for ERROR + table regeneration, then
|
||||||
|
* cd /var/www/cagettepei
|
||||||
|
* SECRET=$(grep key= config.xml | cut -d= -f2 | cut -d'"' -f2)
|
||||||
|
* echo "insert into User values (1,'fr',MD5('${SECRET}cagettepei'),1,'Administrateur','Cagette Péi', 'admin', null, null, null, null, null, null, null, null, null, now(), now(),6,null, null)" | mysql -h localhost -u cagettepei -pcagettepei cagettepei
|
||||||
|
* # connect with admin / cagettepei
|
||||||
|
|
||||||
|
|
||||||
|
* # change admin password
|
||||||
|
* echo "update User set pass=MD5('${SECRET}cagettepei') where id=1" | mysql -h localhost -u cagettepei -pcagettepei cagettepei
|
||||||
|
|
||||||
|
|
||||||
|
SYSTEMD-TIMERS
|
||||||
|
--------------
|
||||||
|
|
||||||
|
* vim /var/www/cagettepei-batch
|
||||||
|
```
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
minute);;
|
||||||
|
daily);;
|
||||||
|
*) echo "expected [minute|daily]" && exit 1;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
SELECTOR=$1
|
||||||
|
|
||||||
|
for i in /var/www/cagettepei-* ; do
|
||||||
|
if [[ -d $i ]]; then
|
||||||
|
cd $i/www
|
||||||
|
echo "cron-$SELECTOR in: $i"
|
||||||
|
neko index.n cron/$SELECTOR
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
```
|
||||||
|
|
||||||
|
* chmod +x /var/www/cagettepei-batch
|
||||||
|
* vim /etc/systemd/system/cagettepei-batch-minute.service
|
||||||
|
```
|
||||||
|
[Unit]
|
||||||
|
Description=Run batch cagettepei every minute
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=www-data
|
||||||
|
SyslogIdentifier=cagettepei
|
||||||
|
ExecStart=/var/www/cagettepei-batch minute
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
```
|
||||||
|
* vim /etc/systemd/system/cagettepei-batch-day.service
|
||||||
|
```
|
||||||
|
[Unit]
|
||||||
|
Description=Run batch cagettepei every day
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=www-data
|
||||||
|
SyslogIdentifier=cagettepei
|
||||||
|
ExecStart=/var/www/cagettepei-batch daily
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
```
|
||||||
|
* vim /etc/systemd/system/cagettepei-batch-minute.timer
|
||||||
|
```
|
||||||
|
[Unit]
|
||||||
|
Description=Timer for batch cagettepei every minute
|
||||||
|
Requires=apache2.service
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
OnCalendar=minutely
|
||||||
|
Unit=cagettepei-batch-minute.service
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=timers.target
|
||||||
|
```
|
||||||
|
* vim /etc/systemd/system/cagettepei-batch-day.timer
|
||||||
|
```
|
||||||
|
[Unit]
|
||||||
|
Description=Timer for batch cagettepei every day
|
||||||
|
Requires=apache2.service
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
OnCalendar=daily
|
||||||
|
Unit=cagettepei-batch-day.service
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=timers.target
|
||||||
|
```
|
||||||
|
* systemctl daemon-reload
|
||||||
|
* systemctl edit apache2 # bind the 2 timers to apache2 cagette
|
||||||
|
```
|
||||||
|
[Unit]
|
||||||
|
BindsTo = cagettepei-batch-minute.timer cagettepei-batch-day.timer
|
||||||
|
```
|
||||||
|
* systemctl enable cagettepei-batch-minute.timer cagettepei-batch-day.timer
|
||||||
|
* systemctl start cagettepei-batch-minute.timer cagettepei-batch-day.timer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -23,9 +23,9 @@
|
|||||||
-lib tink_typecrawler:0.7.0
|
-lib tink_typecrawler:0.7.0
|
||||||
|
|
||||||
## GIT
|
## GIT
|
||||||
-lib sugoi:git:git@artcode.re:cagetters/sugoi.git
|
-lib sugoi:git:https://git.artcode.re/cagetters/sugoi.git
|
||||||
-lib record-macros:git:git@artcode.re:cagetters/record-macros.git
|
-lib record-macros:git:https://git.artcode.re/cagetters/record-macros.git
|
||||||
-lib dbadmin:git:git@artcode.re:cagetters/dbadmin.git
|
-lib dbadmin:git:https://git.artcode.re/cagetters/dbadmin.git
|
||||||
|
|
||||||
## SCRIPT
|
## SCRIPT
|
||||||
-cp common
|
-cp common
|
||||||
|
|||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
-dce no
|
-dce no
|
||||||
-cp common
|
-cp common
|
||||||
-cp js
|
-cp js
|
||||||
-lib sugoi:git:git@artcode.re:cagetters/sugoi.git
|
-lib sugoi:git:https://git.artcode.re/cagetters/sugoi.git
|
||||||
-lib hxleaflet:git:git@artcode.re:cagetters/hxleaflet.git
|
-lib hxleaflet:git:https://git.artcode.re/cagetters/hxleaflet.git
|
||||||
-lib react:1.4.0
|
-lib react:1.4.0
|
||||||
-lib react-router-4:0.2.3
|
-lib react-router-4:0.2.3
|
||||||
-lib modular:0.10.15
|
-lib modular:0.10.15
|
||||||
|
|||||||
+3
-3
@@ -3,9 +3,9 @@
|
|||||||
database = "mysql://<USER>:<PASSWORD>@<HOST>/<DBNAME>"
|
database = "mysql://<USER>:<PASSWORD>@<HOST>/<DBNAME>"
|
||||||
host = "<URL without http>"
|
host = "<URL without http>"
|
||||||
name = "<HTML head title>"
|
name = "<HTML head title>"
|
||||||
default_email = "<default email>"
|
default_email = "<EMAIL>"
|
||||||
|
webmaster_email = "<EMAIL>"
|
||||||
key="carotteMagique"
|
key = "<SECRET_PHRASE>"
|
||||||
|
|
||||||
maintain="0"
|
maintain="0"
|
||||||
cache="1"
|
cache="1"
|
||||||
|
|||||||
@@ -142,9 +142,11 @@
|
|||||||
<a href="http://www.cagette.net/wiki" target="_blank">::_("Documentation")::</a>
|
<a href="http://www.cagette.net/wiki" target="_blank">::_("Documentation")::</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
::if (user!=null && user.isAmapManager()):: <a href="https://cagette.uservoice.com" target="_blank">::_("Propose features")::</a> ::end::
|
<a href="https://pad1.zourit.net/p/4a3b09afd25b4fdcb3f0a9598db21e61" target="_blank">Proposer une amélioration</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="https://pad1.zourit.net/p/4a3b09afd25b4fdcb3f0a9598db21e61" target="_blank">Soumettre une anomalie</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<!--<p style="position: absolute;display: block;top: 96px;width: 700px;">
|
<!--<p style="position: absolute;display: block;top: 96px;width: 700px;">
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ table.table td{
|
|||||||
<hr/>
|
<hr/>
|
||||||
|
|
||||||
<div style="color:#666;font-size:12px;">
|
<div style="color:#666;font-size:12px;">
|
||||||
::_("This e-mail was sent from"):: <a href="http://::HOST::">::_("Cagette.net")::</a>.
|
> ::_("This e-mail was sent from"):: <a href="http://::raw HOST::">::_("Cagette.net")::</a>.
|
||||||
|
|
||||||
::if group!=null::
|
::if group!=null::
|
||||||
<br/>
|
<br/>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<div style="max-width:400px;margin:auto;border:solid 1px #AAA;border-radius:8px;padding:12px;text-align:center;font-family:Arial;">
|
<div style="max-width:400px;margin:auto;border:solid 1px #AAA;border-radius:8px;padding:12px;text-align:center;font-family:Arial;">
|
||||||
|
|
||||||
<img src="http://::HOST::/img/logo2.png" title="Cagette.net" />
|
<img src="http://::HOST::/img/logo2.png" title="CagettePéi" />
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
::_("Hello"):: $$nullSafe(::name::),
|
::_("Hello"):: $$nullSafe(::name::),
|
||||||
|
|||||||
+4
-5
@@ -1,9 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "Cagette.net",
|
"name": "CagettePei",
|
||||||
"description": "le logiciel libre du circuit court",
|
"description": "le logiciel libre du circuit court",
|
||||||
"author": "François Barbut <francois@alilo.fr>",
|
"license": "AGPL-3.0",
|
||||||
"license": "GPL-2.0",
|
|
||||||
"homepage": "http://www.cagette.net",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bootstrap": "^3.3.4",
|
"bootstrap": "^3.3.4",
|
||||||
"eonasdan-bootstrap-datetimepicker": "^4.7.14",
|
"eonasdan-bootstrap-datetimepicker": "^4.7.14",
|
||||||
@@ -48,5 +46,6 @@
|
|||||||
},
|
},
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/bablukid/cagette/issues"
|
"url": "https://github.com/bablukid/cagette/issues"
|
||||||
}
|
},
|
||||||
|
"version": "1.6.0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,6 +87,17 @@ class Distribution extends Controller
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getUser(uid:Int):db.User {
|
||||||
|
return db.User.manager.get(uid, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getBasket(userId, placeId, date){
|
||||||
|
var user = getUser(userId);
|
||||||
|
var place = db.Place.manager.get(placeId, false);
|
||||||
|
return db.Basket.getOrCreate(user, place, date);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Attendance sheet to print ( mutidistrib )
|
* Attendance sheet to print ( mutidistrib )
|
||||||
*/
|
*/
|
||||||
@@ -174,18 +185,25 @@ class Distribution extends Controller
|
|||||||
var data = new Array<Dynamic>();
|
var data = new Array<Dynamic>();
|
||||||
|
|
||||||
for (o in orders3) {
|
for (o in orders3) {
|
||||||
|
|
||||||
|
|
||||||
|
var basket = getBasket(o.userId,view.place.id,view.date);
|
||||||
|
|
||||||
data.push( {
|
data.push( {
|
||||||
"name":o.userName,
|
"NUM": basket.num,
|
||||||
"productName":o.productName,
|
"ADHERENT":o.userName,
|
||||||
"price":view.formatNum(o.productPrice),
|
"PRODUIT":o.productName,
|
||||||
"quantity":o.quantity,
|
"QTÉ":o.quantity,
|
||||||
"fees":view.formatNum(o.fees),
|
// "price":view.formatNum(o.productPrice),
|
||||||
"total":view.formatNum(o.total),
|
// "fees":view.formatNum(o.fees),
|
||||||
"paid":o.paid
|
// "total":view.formatNum(o.total),
|
||||||
|
// "paid":o.paid
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
sugoi.tools.Csv.printCsvDataFromObjects(data, ["name", "productName", "price", "quantity","fees","total", "paid"],"Export-commandes-"+date.toString().substr(0,10)+"-Cagette");
|
sugoi.tools.Csv.printCsvDataFromObjects(data, ["NUM","ADHERENT", "PRODUIT", "QTÉ"],"Export-commandes-"+date.toString().substr(0,10)+"-Cagette");
|
||||||
|
//sugoi.tools.Csv.printCsvDataFromObjects(data, ["NUM","ADHERENT", "PRODUIT", "QTÉ","price","fees","total","paid"],"Export-commandes-"+date.toString().substr(0,10)+"-Cagette");
|
||||||
|
//sugoi.tools.Csv.printCsvDataFromObjects(data, ["NUM","ADHERENT", "PRODUIT", "price", "quantity","fees","total", "paid"],"Export-commandes-"+date.toString().substr(0,10)+"-Cagette");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 27 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 27 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
+12
-1130
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user