Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8fe3153c10 | ||
|
|
de0f10425b | ||
|
|
4bd7c3d174 | ||
|
|
ad1ae04624 | ||
|
|
dad6babe97 | ||
|
|
240c63d9fd | ||
|
|
d6675758ff | ||
|
|
61ce852dbc | ||
|
|
789a4eb7ec | ||
|
|
2b0f3557fc | ||
|
|
10688b9892 | ||
|
|
c86eafa130 | ||
|
|
b2b7e88e3c | ||
|
|
c078d7cf16 | ||
|
|
f2c6c05a00 | ||
|
|
c163807c96 | ||
|
|
5cbc81a07a | ||
|
|
22a78d1fef | ||
|
|
6eb02e94ce | ||
|
|
5116f6b60d | ||
|
|
9edfa4f40e | ||
|
|
4b9fd45d92 | ||
|
|
42b07fea6a | ||
|
|
04a526e728 | ||
|
|
e28efeab7e | ||
|
|
bc939a5bdb | ||
|
|
4a052ea707 | ||
|
|
f139fcfefb | ||
|
|
347a81dc66 | ||
|
|
d142fc1eac | ||
|
|
e039ed4fe5 | ||
|
|
44d2248ba5 | ||
|
|
34e7527442 | ||
|
|
ecffe9bb4e | ||
|
|
6e7382633f | ||
|
|
bb50c92230 | ||
|
|
98dffaebed |
+2
-2
@@ -25,11 +25,11 @@ lang/es/tmp/*.n
|
||||
|
||||
www/lang/*.mo
|
||||
|
||||
www/file/*
|
||||
|
||||
www/js/app.js
|
||||
www/js/libs.js
|
||||
|
||||
www/file/*
|
||||
|
||||
www/css/.sass-cache
|
||||
www/css/*.css
|
||||
!www/css/bootstrap.min.css
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
1.11.1
|
||||
1.13.6
|
||||
|
||||
@@ -73,8 +73,9 @@ templates:
|
||||
haxe cagette.hxml -D i18n_generation
|
||||
@make LANG=fr ctemplates
|
||||
msgfmt www/lang/texts_fr.po -o www/lang/texts_fr.mo
|
||||
|
||||
chown www-data:www-data -R www
|
||||
chown www-data:www-data -R lang/fr
|
||||
chown www-data:www-data -R lang
|
||||
|
||||
ctemplates:
|
||||
(cd lang/$(LANG)/tpl; temploc2 -macros macros.mtt -output ../tmp/ *.mtt */*.mtt */*/*.mtt)
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
CAGETTE PEI
|
||||
===========
|
||||
|
||||
Cagette Péi est un logiciel libre qui favorise les circuits courts.
|
||||
Il a été adapté pour les besoins des AMAPs sur le marché réunionnais.
|
||||
|
||||
> <french>
|
||||
> 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 à partir de cette date,
|
||||
> j'ai repris sur la base d'un existant pour adapter au marché local réunionnais et leurs AMAPéi.
|
||||
> Fourche du logiciel [Cagette.net](https://github.com/CagetteNet) à partir de la version 0.9.2 Novembre 2018. Certaines portions de code n'étant plus disponibles en téléchargement à partir de cette date, le logiciel a été repris, adapté puis réactualisé. Pour plus d'information, contact@artcode.re
|
||||
> </french>
|
||||
|
||||

|
||||
|
||||
## PREREQUISITE MARIADB
|
||||
|
||||
```bash
|
||||
@@ -28,30 +30,24 @@ curl -L 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 sendemail libio-socket-ssl-perl libnet-ssleay-perl
|
||||
|
||||
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
|
||||
|
||||
vim /etc/apache2/sites-available/cagettepei.conf
|
||||
```
|
||||
|
||||
|
||||
```
|
||||
<VirtualHost *:80>
|
||||
ServerName cagettepei
|
||||
DirectoryIndex index.n
|
||||
DocumentRoot /var/www/cagettepei/www/
|
||||
|
||||
CustomLog ${APACHE_LOG_DIR}/cagettepei/access.log combined
|
||||
ErrorLog ${APACHE_LOG_DIR}/cagettepei/debug.log
|
||||
ErrorLogFormat "[%{uc}t] %M"
|
||||
DocumentRoot /var/www/cagettepei/www
|
||||
DirectoryIndex index.n
|
||||
CustomLog ${APACHE_LOG_DIR}/cagettepei/access.log combined
|
||||
</VirtualHost>
|
||||
```
|
||||
|
||||
|
||||
```bash
|
||||
sed -i '/<Directory \/var\/www\/>/,/<\/Directory>/ s/AllowOverride None/AllowOverride All/' /etc/apache2/apache2.conf
|
||||
a2dissite 000-default.conf
|
||||
@@ -69,18 +65,18 @@ vim config.xml
|
||||
```
|
||||
```
|
||||
<config
|
||||
host="<DOMAIN.TLD>"
|
||||
database="mysql://cagettepei:cagettepei@localhost/cagettepei"
|
||||
key="<SECRET_PHRASE>"
|
||||
host = "<DOMAIN.TLD>"
|
||||
database = "mysql://cagettepei:cagettepei@localhost/cagettepei"
|
||||
key = "<SECRET_PHRASE>"
|
||||
default_email = "<EMAIL>"
|
||||
webmaster_email = "<EMAIL>"
|
||||
|
||||
debug="0"
|
||||
sqllog="0"
|
||||
maintain="0"
|
||||
debug = "0"
|
||||
sqllog = "0"
|
||||
maintain = "0"
|
||||
|
||||
cache="1"
|
||||
cachetpl="0"
|
||||
cache = "1"
|
||||
cachetpl = "0"
|
||||
/>
|
||||
```
|
||||
|
||||
@@ -91,7 +87,7 @@ go to http://localhost for ERROR + table regeneration, then
|
||||
|
||||
```
|
||||
cd /var/www/cagettepei
|
||||
SECRET=$(grep key= config.xml | cut -d= -f2 | cut -d'"' -f2)
|
||||
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
|
||||
```
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@
|
||||
::_("HELP")::
|
||||
<ul>
|
||||
<li>
|
||||
<a href="http://www.cagette.net/wiki" target="_blank">::_("Documentation")::</a>
|
||||
<a href="https://wiki.cagette.net/doku.php" target="_blank">::_("Documentation")::</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://pad1.zourit.net/p/4a3b09afd25b4fdcb3f0a9598db21e61" target="_blank">Proposer une amélioration</a>
|
||||
@@ -153,7 +153,13 @@
|
||||
</div>
|
||||
|
||||
<div class="row" id="subfooter">
|
||||
<span>version cagettepei-<a target="_blank" href="https://git.artcode.re/cagetters/cagettepei/src/tag/::VERSION::">::VERSION::</a></span>
|
||||
<p>
|
||||
version cagettepei-<a target="_blank" href="https://git.artcode.re/cagetters/cagettepei/src/tag/::VERSION::">::VERSION::</a>
|
||||
</p>
|
||||
::if BANDEAU_REGION::
|
||||
<img src='/img/bandeau_region_france_relance.png' alt='bandeau Région Réunion' width='250'></img>
|
||||
::end::
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
+1
-51
@@ -1,51 +1 @@
|
||||
{
|
||||
"name": "cagette-pei",
|
||||
"description": "le logiciel libre du circuit court",
|
||||
"license": "AGPL-3.0",
|
||||
"dependencies": {
|
||||
"bootstrap": "^3.3.4",
|
||||
"eonasdan-bootstrap-datetimepicker": "^4.7.14",
|
||||
"geolib": "^2.0.24",
|
||||
"haxe-modular": "^0.7.0",
|
||||
"jquery": "^2.2.4",
|
||||
"leaflet": "^1.3.1",
|
||||
"react": "^15.6.1",
|
||||
"react-bootstrap-typeahead": "1.4.2",
|
||||
"react-datetime": "^2.9.0",
|
||||
"react-dom": "^15.6.1",
|
||||
"react-leaflet": "^1.8.0",
|
||||
"react-places-autocomplete": "^6.0.2",
|
||||
"react-router": "^4.2.0",
|
||||
"react-router-dom": "^4.2.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-preset-es2015": "^6.24.1",
|
||||
"babel-preset-react": "^6.24.1",
|
||||
"babelify": "^7.3.0",
|
||||
"browserify": "^14.4.0",
|
||||
"cross-env": "^5.1.1",
|
||||
"node-sass": "^4.5.3",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"uglify-js": "^3.1.9",
|
||||
"watchify": "^3.9.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "npm-run-all --parallel build:*",
|
||||
"build:js": "haxe cagetteJs.hxml",
|
||||
"build:sass": "node-sass www/css -o www/css",
|
||||
"watch:sass": "npm run build:sass -- --watch",
|
||||
"build2": "babel src -d lib",
|
||||
"libs:dev": "browserify js/libs/libs.js -o www/js/libs.js -d",
|
||||
"libs:prod": "cross-env NODE_ENV=production browserify js/libs/libs.js | uglifyjs -c -m > www/js/libs.js",
|
||||
"test": "haxe testsJS.hxml && node js/test/tests.js",
|
||||
"prepush": "npm test"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/bablukid/cagette.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/bablukid/cagette/issues"
|
||||
},
|
||||
"version": "1.11.1"
|
||||
}
|
||||
{"name": "cagette-pei", "description": "le logiciel libre du circuit court", "license": "AGPL-3.0", "dependencies": {"bootstrap": "^3.3.4", "eonasdan-bootstrap-datetimepicker": "^4.7.14", "geolib": "^2.0.24", "haxe-modular": "^0.7.0", "jquery": "^2.2.4", "leaflet": "^1.3.1", "react": "^15.6.1", "react-bootstrap-typeahead": "1.4.2", "react-datetime": "^2.9.0", "react-dom": "^15.6.1", "react-leaflet": "^1.8.0", "react-places-autocomplete": "^6.0.2", "react-router": "^4.2.0", "react-router-dom": "^4.2.2"}, "devDependencies": {"babel-preset-es2015": "^6.24.1", "babel-preset-react": "^6.24.1", "babelify": "^7.3.0", "browserify": "^14.4.0", "cross-env": "^5.1.1", "node-sass": "^4.5.3", "npm-run-all": "^4.1.2", "uglify-js": "^3.1.9", "watchify": "^3.9.0"}, "scripts": {"build": "npm-run-all --parallel build:*", "build:js": "haxe cagetteJs.hxml", "build:sass": "node-sass www/css -o www/css", "watch:sass": "npm run build:sass -- --watch", "build2": "babel src -d lib", "libs:dev": "browserify js/libs/libs.js -o www/js/libs.js -d", "libs:prod": "cross-env NODE_ENV=production browserify js/libs/libs.js | uglifyjs -c -m > www/js/libs.js", "test": "haxe testsJS.hxml && node js/test/tests.js", "prepush": "npm test"}, "repository": {"type": "git", "url": "git+https://github.com/bablukid/cagette.git"}, "bugs": {"url": "https://github.com/bablukid/cagette/issues"}, "version": "1.13.6"}
|
||||
|
||||
+2
-2
@@ -203,7 +203,7 @@ class App extends sugoi.BaseApp {
|
||||
out.set("percent", "Pourcentage");
|
||||
out.set("pinned", "Mets en avant les produits");
|
||||
|
||||
out.set("CagetteNetwork", "Me lister dans l'annuaire des groupes Cagette.net");
|
||||
out.set("CagetteNetwork", "Me lister dans l'annuaire des groupes");
|
||||
out.set("unitType", "Unité");
|
||||
out.set("qt", "Quantité");
|
||||
out.set("Unit", "Pièce");
|
||||
@@ -280,7 +280,7 @@ class App extends sugoi.BaseApp {
|
||||
var e = new sugoi.mail.Mail();
|
||||
e.setSubject(subject);
|
||||
e.setRecipient(to);
|
||||
e.setSender(App.config.get("default_email"), t._("Cagette.net"));
|
||||
e.setSender(App.config.get("default_email"), t._("CagettePéi"));
|
||||
var html = App.current.processTemplate("mail/message.mtt", {text: html, group: group});
|
||||
e.setHtmlBody(html);
|
||||
App.sendMail(e);
|
||||
|
||||
@@ -30,7 +30,7 @@ class Contract extends Controller {
|
||||
@tpl("contract/default.mtt")
|
||||
function doDefault() {
|
||||
// Create the list of links to change the language
|
||||
var langs = App.config.get("langs").split(";");
|
||||
var langs = App.config.get("langs", "fr").split(";");
|
||||
var langNames = App.config.get("langnames", "Français").split(";");
|
||||
var i = 0;
|
||||
var langLinks = "";
|
||||
|
||||
@@ -54,7 +54,7 @@ class Group extends controller.Controller
|
||||
form.addElement(new StringInput("userLastName", t._("Your lastname") ,"",true));
|
||||
form.addElement(new StringInput("userEmail", t._("Your e-mail"), "", true));
|
||||
}
|
||||
form.addElement(new sugoi.form.elements.TextArea("msg", t._("Leave a message")));
|
||||
form.addElement(new sugoi.form.elements.TextArea("msg", t._("Leave a message"),"",false));
|
||||
|
||||
if (form.isValid()){
|
||||
try{
|
||||
|
||||
@@ -29,7 +29,10 @@ class Main extends Controller {
|
||||
if ( app.user!=null && group == null) {
|
||||
throw Redirect("/user/choose");
|
||||
}else if (app.user == null && (group==null || group.regOption!=db.Amap.RegOption.Open) ) {
|
||||
throw Redirect("/user/login");
|
||||
|
||||
if (db.Amap.manager.get(1, false) != null) throw Redirect("/group/1");
|
||||
else throw Redirect("/user/login");
|
||||
|
||||
}
|
||||
|
||||
view.amap = group;
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
package controller.admin;
|
||||
|
||||
import haxe.web.Dispatch;
|
||||
import Common;
|
||||
|
||||
class Admin extends Controller {
|
||||
|
||||
public function new() {
|
||||
super();
|
||||
view.category = 'admin';
|
||||
|
||||
//trigger a "Nav" event
|
||||
// trigger a "Nav" event
|
||||
var nav = new Array<Link>();
|
||||
var e = Nav(nav,"admin");
|
||||
var e = Nav(nav, "admin");
|
||||
app.event(e);
|
||||
view.nav = e.getParameters()[0];
|
||||
|
||||
}
|
||||
|
||||
@tpl("admin/default.mtt")
|
||||
@@ -24,44 +23,36 @@ class Admin extends Controller {
|
||||
@tpl("admin/emails.mtt")
|
||||
function doEmails() {
|
||||
var browse = function(index:Int, limit:Int) {
|
||||
return sugoi.db.BufferedMail.manager.search($sdate==null,{limit:[index,limit],orderBy:-cdate},false);
|
||||
return sugoi.db.BufferedMail.manager.search($sdate == null, {limit: [index, limit], orderBy: -cdate}, false);
|
||||
}
|
||||
|
||||
var count = sugoi.db.BufferedMail.manager.count($sdate==null);
|
||||
view.browser = new sugoi.tools.ResultsBrowser(count,10,browse);
|
||||
var count = sugoi.db.BufferedMail.manager.count($sdate == null);
|
||||
view.browser = new sugoi.tools.ResultsBrowser(count, 10, browse);
|
||||
view.num = count;
|
||||
|
||||
}
|
||||
|
||||
@tpl("form.mtt")
|
||||
function doSmtp() {
|
||||
|
||||
var f = new sugoi.form.Form("emails");
|
||||
var data = [
|
||||
{label:"SMTP",value:"smtp"},
|
||||
{label:"Mandrill API",value:"mandrill"},
|
||||
];
|
||||
var data = [{label: "SMTP", value: "smtp"}, {label: "Mandrill API", value: "mandrill"},];
|
||||
|
||||
var mailer = sugoi.db.Variable.get("mailer")==null ? "smtp" : sugoi.db.Variable.get("mailer");
|
||||
var host = sugoi.db.Variable.get("smtp_host")==null ? App.config.get("smtp_host") : sugoi.db.Variable.get("smtp_host");
|
||||
var port = sugoi.db.Variable.get("smtp_port")==null ? App.config.get("smtp_port") : sugoi.db.Variable.get("smtp_port");
|
||||
var user = sugoi.db.Variable.get("smtp_user")==null ? App.config.get("smtp_user") : sugoi.db.Variable.get("smtp_user");
|
||||
var pass = sugoi.db.Variable.get("smtp_pass")==null ? App.config.get("smtp_pass") : sugoi.db.Variable.get("smtp_pass");
|
||||
var mailer = sugoi.db.Variable.get("mailer") == null ? "smtp" : sugoi.db.Variable.get("mailer");
|
||||
var host = sugoi.db.Variable.get("smtp_host") == null ? "<SMTP_SERVER>" : sugoi.db.Variable.get("smtp_host");
|
||||
var port = sugoi.db.Variable.get("smtp_port") == null ? "587" : sugoi.db.Variable.get("smtp_port");
|
||||
var user = sugoi.db.Variable.get("smtp_user") == null ? "" : sugoi.db.Variable.get("smtp_user");
|
||||
var pass = sugoi.db.Variable.get("smtp_pass") == null ? "" : sugoi.db.Variable.get("smtp_pass");
|
||||
|
||||
|
||||
f.addElement(new sugoi.form.elements.StringSelect("mailer", "Mailer", data, mailer ));
|
||||
f.addElement(new sugoi.form.elements.StringSelect("mailer", "Mailer", data, mailer));
|
||||
f.addElement(new sugoi.form.elements.StringInput("smtp_host", "host", host));
|
||||
f.addElement(new sugoi.form.elements.StringInput("smtp_port", "port", port));
|
||||
f.addElement(new sugoi.form.elements.StringInput("smtp_user", "user", user));
|
||||
f.addElement(new sugoi.form.elements.StringInput("smtp_pass", "pass", pass));
|
||||
|
||||
|
||||
if (f.isValid()){
|
||||
for ( k in ["mailer","smtp_host","smtp_port","smtp_user","smtp_pass"]){
|
||||
if (f.isValid()) {
|
||||
for (k in ["mailer", "smtp_host", "smtp_port", "smtp_user", "smtp_pass"]) {
|
||||
sugoi.db.Variable.set(k, f.getValueOf(k));
|
||||
}
|
||||
throw Ok("/admin/emails", t._("Configuration updated") );
|
||||
|
||||
throw Ok("/admin/emails", t._("Configuration updated"));
|
||||
}
|
||||
|
||||
view.title = t._("Email service configuration");
|
||||
@@ -72,67 +63,60 @@ class Admin extends Controller {
|
||||
d.dispatch(new controller.admin.Plugins());
|
||||
}
|
||||
|
||||
|
||||
@tpl("admin/taxo.mtt")
|
||||
function doTaxo(){
|
||||
|
||||
function doTaxo() {
|
||||
view.categ = db.TxpCategory.manager.all();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Display errors logged in DB
|
||||
*/
|
||||
@tpl("admin/errors.mtt")
|
||||
function doErrors( args:{?user: Int, ?like: String, ?empty:Bool} ) {
|
||||
function doErrors(args:{?user:Int, ?like:String, ?empty:Bool}) {
|
||||
view.now = Date.now();
|
||||
|
||||
view.u = args.user!=null ? db.User.manager.get(args.user,false) : null;
|
||||
view.like = args.like!=null ? args.like : "";
|
||||
view.u = args.user != null ? db.User.manager.get(args.user, false) : null;
|
||||
view.like = args.like != null ? args.like : "";
|
||||
|
||||
var sql = "";
|
||||
if( args.user!=null ) sql += " AND uid="+args.user;
|
||||
//if( args.like!=null && args.like != "" ) sql += " AND error like "+sys.db.Manager.cnx.quote("%"+args.like+"%");
|
||||
if (args.user != null)
|
||||
sql += " AND uid=" + args.user;
|
||||
// if( args.like!=null && args.like != "" ) sql += " AND error like "+sys.db.Manager.cnx.quote("%"+args.like+"%");
|
||||
if (args.empty) {
|
||||
sys.db.Manager.cnx.request("truncate table Error");
|
||||
}
|
||||
|
||||
var errorsStats = sys.db.Manager.cnx.request("select count(id) as c, DATE_FORMAT(date,'%y-%m-%d') as day from Error where date > NOW()- INTERVAL 1 MONTH "+sql+" group by day order by day").results();
|
||||
var errorsStats = sys.db.Manager.cnx.request("select count(id) as c, DATE_FORMAT(date,'%y-%m-%d') as day from Error where date > NOW()- INTERVAL 1 MONTH "
|
||||
+ sql
|
||||
+ " group by day order by day")
|
||||
.results();
|
||||
view.errorsStats = errorsStats;
|
||||
|
||||
view.browser = new sugoi.tools.ResultsBrowser(
|
||||
sugoi.db.Error.manager.unsafeCount("SELECT count(*) FROM Error WHERE 1 "+sql),
|
||||
20,
|
||||
function(start, limit) { return sugoi.db.Error.manager.unsafeObjects("SELECT * FROM Error WHERE 1 "+sql+" ORDER BY date DESC LIMIT "+start+","+limit,false); }
|
||||
);
|
||||
view.browser = new sugoi.tools.ResultsBrowser(sugoi.db.Error.manager.unsafeCount("SELECT count(*) FROM Error WHERE 1 " + sql), 20,
|
||||
function(start, limit) {
|
||||
return sugoi.db.Error.manager.unsafeObjects("SELECT * FROM Error WHERE 1 " + sql + " ORDER BY date DESC LIMIT " + start + "," + limit, false);
|
||||
});
|
||||
}
|
||||
|
||||
@tpl("admin/graph.mtt")
|
||||
function doGraph(?key:String,?year:Int,?month:Int){
|
||||
function doGraph(?key:String, ?year:Int, ?month:Int) {
|
||||
var from = new Date(year, month, 1, 0, 0, 0);
|
||||
var to = new Date(year, month + 1, 0, 23, 59, 59);
|
||||
|
||||
|
||||
var from = new Date(year,month,1,0,0,0);
|
||||
var to = new Date(year,month+1,0,23,59,59);
|
||||
|
||||
if(app.params.exists("recompute")){
|
||||
|
||||
switch(key){
|
||||
if (app.params.exists("recompute")) {
|
||||
switch (key) {
|
||||
case "basket":
|
||||
for( d in 1...to.getDate()){
|
||||
var _from = new Date(year,month,d,0,0,0);
|
||||
var _to = new Date(year,month,d,23,59,59);
|
||||
var value = db.Basket.manager.count($cdate>=_from && $cdate<=_to);
|
||||
var g = db.Graph.record(key,value, _from );
|
||||
for (d in 1...to.getDate()) {
|
||||
var _from = new Date(year, month, d, 0, 0, 0);
|
||||
var _to = new Date(year, month, d, 23, 59, 59);
|
||||
var value = db.Basket.manager.count($cdate >= _from && $cdate <= _to);
|
||||
var g = db.Graph.record(key, value, _from);
|
||||
// trace(value,_from,g);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var data = db.Graph.getRange(key,from,to);
|
||||
var data = db.Graph.getRange(key, from, to);
|
||||
view.data = data;
|
||||
view.from = from;
|
||||
view.to = to;
|
||||
@@ -140,55 +124,46 @@ class Admin extends Controller {
|
||||
|
||||
var averageValue = 0.0;
|
||||
var total = 0.0;
|
||||
for( d in data) total += d.value;
|
||||
averageValue = total/data.length;
|
||||
for (d in data)
|
||||
total += d.value;
|
||||
averageValue = total / data.length;
|
||||
view.total = total;
|
||||
view.averageValue = averageValue;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
function doFixDistribValidation() {
|
||||
|
||||
Sys.println("===== Liste des distributions ayant été re-validées ====<br>");
|
||||
|
||||
//Get the current group
|
||||
// Get the current group
|
||||
var group = app.user.amap;
|
||||
//Get all the contracts for this given group
|
||||
var contractIds = Lambda.map(group.getContracts(),function(x) return x.id);
|
||||
//Get all the validated distributions for this given group
|
||||
var validatedDistribs = db.Distribution.manager.search( ($contractId in contractIds) && $validated == true, {orderBy:date}, false);
|
||||
for (distrib in validatedDistribs){
|
||||
|
||||
// Get all the contracts for this given group
|
||||
var contractIds = Lambda.map(group.getContracts(), function(x) return x.id);
|
||||
// Get all the validated distributions for this given group
|
||||
var validatedDistribs = db.Distribution.manager.search(($contractId in contractIds) && $validated == true, {orderBy: date}, false);
|
||||
for (distrib in validatedDistribs) {
|
||||
service.PaymentService.validateDistribution(distrib);
|
||||
Sys.println(distrib.toString() + "<br>");
|
||||
|
||||
}
|
||||
|
||||
Sys.println("===== Fin de la liste ====");
|
||||
|
||||
}
|
||||
|
||||
function doCheckDistribValidation() {
|
||||
|
||||
Sys.println("===== Liste des distributions validées ayant des opérations/paiements non validés ====<br>");
|
||||
|
||||
//Get the current group
|
||||
// Get the current group
|
||||
var group = app.user.amap;
|
||||
//Get all the contracts for this given group
|
||||
var contractIds = Lambda.map(group.getContracts(),function(x) return x.id);
|
||||
//Get all the validated distributions for this given group
|
||||
var validatedDistribs = db.Distribution.manager.search( ($contractId in contractIds) && $validated == true, {orderBy:date}, false);
|
||||
for (distrib in validatedDistribs){
|
||||
|
||||
for (user in distrib.getUsers()){
|
||||
|
||||
// Get all the contracts for this given group
|
||||
var contractIds = Lambda.map(group.getContracts(), function(x) return x.id);
|
||||
// Get all the validated distributions for this given group
|
||||
var validatedDistribs = db.Distribution.manager.search(($contractId in contractIds) && $validated == true, {orderBy: date}, false);
|
||||
for (distrib in validatedDistribs) {
|
||||
for (user in distrib.getUsers()) {
|
||||
var basket = db.Basket.get(user, distrib.place, distrib.date);
|
||||
if (basket == null || basket.isValidated()) continue;
|
||||
if (basket == null || basket.isValidated())
|
||||
continue;
|
||||
|
||||
for (order in basket.getOrders()){
|
||||
for (order in basket.getOrders()) {
|
||||
if (!order.paid) {
|
||||
Sys.println(order.distribution.toString() + "<br>");
|
||||
Sys.println(order.toString() + "<br>");
|
||||
@@ -196,28 +171,22 @@ class Admin extends Controller {
|
||||
}
|
||||
|
||||
var operation = basket.getOrderOperation(false);
|
||||
if (operation != null){
|
||||
|
||||
if (operation != null) {
|
||||
if (operation.pending) {
|
||||
Sys.println(distrib.toString() + "<br>");
|
||||
Sys.println(operation.toString() + "<br>");
|
||||
}
|
||||
|
||||
for ( payment in basket.getPayments()){
|
||||
|
||||
if (payment.pending){
|
||||
for (payment in basket.getPayments()) {
|
||||
if (payment.pending) {
|
||||
Sys.println(distrib.toString() + "<br>");
|
||||
Sys.println(payment.toString() + "<br>");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Sys.println("===== Fin de la liste ====");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
+14
-21
@@ -1,38 +1,34 @@
|
||||
package form;
|
||||
|
||||
import sugoi.form.elements.RadioGroup;
|
||||
import Common;
|
||||
|
||||
class ColorRadioGroup extends RadioGroup
|
||||
{
|
||||
|
||||
public function new(name:String, label:String,selected:String)
|
||||
{
|
||||
class ColorRadioGroup extends RadioGroup {
|
||||
public function new(name:String, label:String, selected:String) {
|
||||
var data = [];
|
||||
var i = 0;
|
||||
for (c in db.CategoryGroup.COLORS) {
|
||||
data.push( { value:Std.string(c), label:Std.string(i) } );
|
||||
data.push({value: Std.string(c), label: Std.string(i)});
|
||||
i++;
|
||||
}
|
||||
|
||||
super(name, label, data, selected, "1", false, true);
|
||||
}
|
||||
|
||||
override public function render():String
|
||||
{
|
||||
override public function render():String {
|
||||
var s = "";
|
||||
var n = parentForm.name + "_" +name;
|
||||
var n = parentForm.name + "_" + name;
|
||||
|
||||
var c = 0;
|
||||
if (data != null)
|
||||
{
|
||||
for (row in data)
|
||||
{
|
||||
if (data != null) {
|
||||
for (row in data) {
|
||||
var radio = "<input type=\"radio\" name=\"" + n + "\" id=\"" + n + c + "\" value=\"" + row.label + "\" "
|
||||
+ (row.label == Std.string(value) ? "checked" : "") + " />\n";
|
||||
var img = "<div style='margin-right:16px;width:32px;height:32px;background:"
|
||||
+ App.current.view.intToHex(Std.parseInt(row.value))
|
||||
+ ";'></div>";
|
||||
|
||||
var radio = "<input type=\"radio\" name=\""+n+"\" id=\""+n+c+"\" value=\"" + row.label + "\" " + (row.label == Std.string(value) ? "checked":"") +" />\n";
|
||||
|
||||
var img = "<div style='margin-right:16px;width:32px;height:32px;background:"+App.current.view.intToHex(Std.parseInt(row.value))+";'></div>";
|
||||
|
||||
s += "<label for=\"" + n+c + "\" class='checkbox' style='display: inline-block;'>"+radio + " "+img+" </label>";
|
||||
s += "<label for=\"" + n + c + "\" class='checkbox' style='display: inline-block;'>" + radio + " " + img + " </label>";
|
||||
|
||||
c++;
|
||||
}
|
||||
@@ -40,7 +36,4 @@ class ColorRadioGroup extends RadioGroup
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -13,6 +13,8 @@ class WaitingListService{
|
||||
var w = new db.WaitingList();
|
||||
w.user = user;
|
||||
w.group = group;
|
||||
if (message == null ) message = "";
|
||||
//message = "souscription = " + message;
|
||||
w.message = message;
|
||||
w.insert();
|
||||
|
||||
|
||||
@@ -20,12 +20,14 @@ class BaseView implements Dynamic {
|
||||
this.HOST = App.config.HOST;
|
||||
this.DATA_HOST = App.config.DATA_HOST;
|
||||
this.DEBUG = App.config.DEBUG;
|
||||
this.BANDEAU_REGION = App.config.BANDEAU_REGION;
|
||||
this.NAME = App.config.NAME;
|
||||
this.isAdmin = app.user != null && app.user.isAdmin();
|
||||
|
||||
//Access basic functions in views
|
||||
this.Std = Std;
|
||||
this.Math = Math;
|
||||
this.Config = App.config;
|
||||
|
||||
|
||||
if ( App.config.SQL_LOG ) {
|
||||
|
||||
@@ -11,6 +11,7 @@ class Config {
|
||||
public var TPL:String;
|
||||
public var TPL_TMP:String;
|
||||
public var DEBUG:Bool;
|
||||
public var BANDEAU_REGION:Bool;
|
||||
public var HOST:String;
|
||||
public var NAME:String;
|
||||
public var KEY:String;
|
||||
@@ -28,6 +29,7 @@ class Config {
|
||||
TPL = PATH + "lang/" + LANG + "/tpl/";
|
||||
TPL_TMP = PATH + "lang/" + LANG + "/tmp/";
|
||||
DEBUG = get("debug", "0") == "1";
|
||||
BANDEAU_REGION = get("bandeau_region", "0") == "1";
|
||||
HOST = get("host");
|
||||
KEY = get("key");
|
||||
DATA_HOST = get("dataHost", "data." + HOST);
|
||||
|
||||
+591
-640
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
ErrorDocument 404 /index.n
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 153 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 212 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 112 KiB |
@@ -14,6 +14,7 @@ msgstr ""
|
||||
"Plural-Forms: nplurals=2; plural=n > 1;\n"
|
||||
"X-Generator: Poedit 2.0.6\n"
|
||||
|
||||
|
||||
#: src/payment/Cash.hx:294
|
||||
msgid "Cash"
|
||||
msgstr "Espèces / Carte Bancaire"
|
||||
|
||||
Reference in New Issue
Block a user