From: Kilian Saffran Date: Wed, 24 Jun 2020 06:24:05 +0000 (+0200) Subject: v20200624 X-Git-Url: http://cloud.dks.lu/git/?a=commitdiff_plain;h=f9db9ecc5f915087ac3351ca43c6f3d02ba74c7c;p=dks_lu.git v20200624 --- diff --git a/.gitignore b/.gitignore index eee9c0b..618bed7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ -apps/node_modules/* -.DSStore +cms/lib/perl5 +apps/lib + diff --git a/.htaccess b/.htaccess deleted file mode 100644 index 5f8b6c7..0000000 --- a/.htaccess +++ /dev/null @@ -1,10 +0,0 @@ -RewriteEngine On - -DirectoryIndex index.cgi index.html -AddHandler cgi-script .cgi -#devmode end -RewriteCond %{REQUEST_FILENAME} !-f -RewriteCond %{REQUEST_FILENAME} !-d - -RewriteRule "^(.*)$" "index.cgi" [NC,L,QSA] - diff --git a/TODO/modules_todo/bilan/accountingyear.html b/TODO/modules_todo/bilan/accountingyear.html deleted file mode 100644 index f090cb7..0000000 --- a/TODO/modules_todo/bilan/accountingyear.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - Bilan - - - - - - - - - - - - - - - -
-
-
- du année: - -
-
- montants à visualiser: - -
-
-
-
-
- -
- - - - - - - - - - - - - - - - - diff --git a/TODO/modules_todo/bilan/js/accountingyear.js b/TODO/modules_todo/bilan/js/accountingyear.js deleted file mode 100644 index 481a9ac..0000000 --- a/TODO/modules_todo/bilan/js/accountingyear.js +++ /dev/null @@ -1,501 +0,0 @@ -//Source-code licensed under EUPL v1.2 ( Copyright 2019 By DKS s.à r.l. - Kilian Saffran - Luxembourg ) - -var pconfig = {}; -var cdate = null; -var initdate = new Date(); -initdate.setDate(1); -var winh= window.innerHeight -120; -var tblacc = null; -var curchilduuid = ''; -var crecheuuid = null; -var importpath = null; -//var lictype = apppref.getpreference("support.lictype"); -//var amonth = ['','Janvier','Février','Mars','Avril','Mai','Juin','Juillet','Aôut','Septembre','Novembre','Décembre']; -//var amonth = ['','Janv','Févr','Mars','Avril','Mai','Juin','Juil','Aôut','Sept','Nov','Déc']; -var defamountcolors ={ "invoiced":"#003300","payed":"#660066","benefit":"#663300","openinvoices":"#cc0000","income":"#000000"}; -//"preview":"#ff6600","calculated":"#003366", -var defamounttitles ={ - //"calculated":"calculées", - "invoiced":"facturées", - "payed":"payées", - "benefit":"prestations", - "openinvoices":"factures ouverts", - "income":"revenu (facturées + prestations)" - //"preview":"prévision" - }; - -function initdata(){ - load_helpers(); - var configdata = apppref.getpreference("pageconfig.accountingyear"); - if (configdata != '') { - pconfig = JSON.parse(configdata); - } - if (!pconfig.printlayout) { - pconfig.printlayout = 'list'; - apppref.setpreference("pageconfig.accountingyear",pconfig); - } - if (!pconfig.amountcolors) { - pconfig.amountcolors = defamountcolors; - } - if (!pconfig.filteramount) { - pconfig.filteramount = ["calculated","openinvoices","income"]; - } - if ((!pconfig) || (!pconfig.accyear)){ - pconfig.accyear=new Date().toLocaleFormat("%Y"); - apppref.setpreference("pageconfig.accountingyear",pconfig); - } - //if (lictype != "free"){ - // $("#mnuacc").css({"position":"absolute","z-index":"1000"}); - //} - set_selectyears(); - load_amount_selection("filter_amounts"); - - - set_infoheader( "Année " + pconfig.accyear); - load_accounting_table(); - -} - -function print_list(){ - globelreq.send_request({page:'preview2',data:{page: 'accounting'}}); -} - -function load_accounting_table(){ - - - var daterangesql = "select case when strftime('%Y',date(yeardaybegin)) == '"+pconfig.accyear+"' then yeardaybegin else strftime('%Y-%m-%d',date(date(yeardaybegin),'+7 days')) end as yeardaybegin,"+ - "strftime('%Y-%m-%d',date(date(yeardayend),'+6 days')) as yeardayend "+ - "from ( " + - "select case when strftime('%w','"+pconfig.accyear+"-01-01') = '1' then strftime('%Y-%m-%d','"+pconfig.accyear+"-01-01') else strftime('%Y-%m-%d', date(date('"+pconfig.accyear+"-01-01','-7 days'),'weekday 1')) end as yeardaybegin, "+ - "case when strftime('%w','"+pconfig.accyear+"-12-31') = '1' then strftime('%Y-%m-%d','"+pconfig.accyear+"-12-31') else strftime('%Y-%m-%d', date(date('"+pconfig.accyear+"-12-31','-7 days'),'weekday 1')) end as yeardayend "+ - ");"; - var daterange = appdb.dbquery(daterangesql); - daterange = daterange.sqldata[0]; - var ydaybegin = daterange.yeardaybegin; - var ydayend = daterange.yeardayend; - - var accsql = "SELECT childname, CAST(substr(calmonth,1,2) as int) as calmonth, substr(calmonth,4) as calyear, "; - //if ((pconfig.filteramount.indexOf("calculated") != -1) ){ - // accsql += "case when substr(calmonth,4) || substr(calmonth,1,2) <= strftime('%Y%m',date('now')) then printf(\"%.2f\",SUM(weektotalhourcosts + weektotallunchcosts)) else null end AS calculatedamount, "; - //} - //if ((pconfig.filteramount.indexOf("preview") != -1) ){ - // accsql += "case when substr(calmonth,4) || substr(calmonth,1,2) > strftime('%Y%m',date('now')) then printf(\"%.2f\",SUM(weektotalhourcosts + weektotallunchcosts)) else null end AS previewamount, "; - //} - if (pconfig.filteramount.indexOf("invoiced") != -1) { - accsql += "case when invoiceamount is not null then printf(\"%.2f\",invoiceamount) else null end as invoicedamount, "; - } - if (pconfig.filteramount.indexOf("payed") != -1) { - accsql += "case when payedamount is not null then printf(\"%.2f\",payedamount) else null end as payedamount, "; - } - if (pconfig.filteramount.indexOf("benefit") != -1) { - accsql += "case when benefitamount is not null then printf(\"%.2f\",benefitamount) else null end as benefitamount, "; - } - if (pconfig.filteramount.indexOf("openinvoices") != -1) { - accsql += "case when invoiceamount is not null and (payedamount is null or payedamount < invoiceamount) is not null then printf(\"%.2f\",invoiceamount - coalesce(payedamount,0.00)) else null end as openinvoicesamount, "; - } - if (pconfig.filteramount.indexOf("income") != -1) { - accsql += "case when benefitamount is not null or invoiceamount is not null then printf(\"%.2f\",coalesce(benefitamount,0.00) + coalesce(invoiceamount,0.00)) else null end as incomeamount, "; - } - -accsql += "null as nouse FROM ( SELECT childname, ttl.childuuid, calmonth, sumdurationcalweek * weekhourcosts AS weektotalhourcosts, sumlunchcalweek * weeklunchcosts AS weektotallunchcosts, acc.invoiceamount, acc.payedamount, benefitamount " + -"FROM ( SELECT pch.childname, pch.childuuid, px.calweek, px.calmonth, px.sumdurationcalweek, px.sumlunchcalweek, " + - -"CASE WHEN px.sumdurationcalweek IS NOT NULL AND pch.checkservicenumber IS NOT NULL THEN ( SELECT coalesce(wc0.costsperhour,0.00) FROM costs wc0 WHERE wc0.startdate < date('"+ydaybegin+"','+' || caldays || ' days') and wc0.weeklyhourslimit <= px.sumdurationcalweek ORDER BY wc0.startdate DESC,wc0.weeklyhourslimit DESC LIMIT 1 ) WHEN px.sumdurationcalweek IS NOT NULL AND pch.checkservicenumber IS NULL THEN ( SELECT coalesce(wc0.costperhourfallback,0.00) FROM costs wc0 WHERE wc0.startdate < date('"+ydaybegin+"','+' || caldays || ' days') and wc0.weeklyhourslimit <= px.sumdurationcalweek ORDER BY wc0.startdate DESC,wc0.weeklyhourslimit DESC LIMIT 1 ) ELSE NULL END AS weekhourcosts,"+ - -"CASE WHEN px.sumlunchcalweek IS NOT NULL THEN ( SELECT coalesce(wc0.dailylunchcosts,0.00) FROM costs wc0 WHERE wc0.startdate < date('"+ydaybegin+"','+' || caldays || ' days') and wc0.weeklyhourslimit <= px.sumdurationcalweek ORDER BY wc0.startdate DESC,wc0.weeklyhourslimit DESC LIMIT 1) ELSE NULL END AS weeklunchcosts " + - -"FROM ( SELECT COALESCE(ch.prename,'') || ' ' || COALESCE(ch.surname,'') || '
(' || COALESCE(ch.checkservicenumber,'') || ')' AS childname, ch.uuid AS childuuid,ch.checkservicenumber FROM childs ch JOIN planning pl ON ( ch.uuid=pl.childuuid) ) pch " + -"LEFT JOIN ( SELECT childuuid, calweek,case when strftime('%w',date(calyear ||'-01-01')) in ('1','2','3','4') then (cast(calweek as int)*7)-7 else (cast(calweek as int)*7) end as caldays, calmonth, sumlunchcalweek, " + -"COALESCE(SUM(monduration + tueduration + wedduration + thuduration + friduration),0.0) AS sumdurationcalweek " + -"FROM ( SELECT childuuid, daydate,calmonth,calyear, " + -"CASE WHEN strftime('%w',DATE(calyear ||'-01-01')) IN ('1', '2', '3', '4') THEN CASE WHEN calweek < '10' THEN '0' ELSE '' END || CAST(calweek AS INT)+1 ELSE calweek END AS calweek, " + -"MAX(monlunch) + MAX(tuelunch) + MAX(wedlunch) + MAX(thulunch) + MAX(frilunch) AS sumlunchcalweek, " + -"MAX(monduration) + MAX(monduration2) AS monduration, " + -"MAX(tueduration) + MAX(tueduration2) AS tueduration, " + -"MAX(wedduration) + MAX(wedduration2) AS wedduration, " + -"MAX(thuduration) + MAX(thuduration2) AS thuduration, " + -"MAX(friduration) + MAX(friduration2) AS friduration " + -"FROM ( SELECT xx.childuuid, xx.daydate, strftime('%Y',xx.daydate) AS calyear, " + -"CASE WHEN strftime('%w',xx.daydate)='0' THEN strftime('%W',DATE(xx.daydate,'-6 days')) ELSE strftime('%W',DATE(DATE(xx.daydate),'-' || strftime('%w',DATE(xx.daydate)) || ' days', '+1 day')) END AS calweek, " + -"CASE WHEN strftime('%w',xx.daydate)='0' THEN strftime('%m.%Y',DATE(xx.daydate,'-6 days')) ELSE strftime('%m.%Y',DATE(DATE(xx.daydate),'-' || strftime('%w',DATE(xx.daydate)) || ' days', '+1 day')) END AS calmonth, " + -"CASE WHEN lunch=1 AND status IN (1,5) AND strftime('%w',daydate) = '1' THEN 1 ELSE 0 END AS monlunch, " + -"CASE WHEN lunch=1 AND status IN (1,5) AND strftime('%w',daydate) = '2' THEN 1 ELSE 0 END AS tuelunch, " + -"CASE WHEN lunch=1 AND status IN (1,5) AND strftime('%w',daydate) = '3' THEN 1 ELSE 0 END AS wedlunch, " + -"CASE WHEN lunch=1 AND status IN (1,5) AND strftime('%w',daydate) = '4' THEN 1 ELSE 0 END AS thulunch, " + -"CASE WHEN lunch=1 AND status IN (1,5) AND strftime('%w',daydate) = '5' THEN 1 ELSE 0 END AS frilunch, " + -"CASE WHEN xx.status IS NOT NULL AND strftime('%w',xx.daydate) = '1' AND xx.daydate BETWEEN xx.datebegin AND xx.dateend THEN CAST(( (( CAST(SUBSTR(xx.montimeend,1,2) AS INT) *3600)+( CAST(SUBSTR(xx.montimeend,4,2) AS INT) *60))- ((CAST(SUBSTR(xx.montimebegin,1,2) AS INT) *3600)+( CAST(SUBSTR(xx.montimebegin,4, 2) AS INT) *60)) ) / 3600 AS REAL) ELSE 0.0 END AS monduration, " + -"CASE WHEN xx.status IS NOT NULL AND strftime('%w',xx.daydate) = '2' AND xx.daydate BETWEEN xx.datebegin AND xx.dateend THEN CAST(( (( CAST(SUBSTR(xx.tuetimeend,1,2) AS INT) *3600)+( CAST(SUBSTR(xx.tuetimeend,4,2) AS INT) *60))- ((CAST(SUBSTR(xx.tuetimebegin,1,2) AS INT) *3600)+( CAST(SUBSTR(xx.tuetimebegin,4, 2) AS INT) *60)) ) / 3600 AS REAL) ELSE 0.0 END AS tueduration, " + -"CASE WHEN xx.status IS NOT NULL AND strftime('%w',xx.daydate) = '3' AND xx.daydate BETWEEN xx.datebegin AND xx.dateend THEN CAST(( (( CAST(SUBSTR(xx.wedtimeend,1,2) AS INT) *3600)+( CAST(SUBSTR(xx.wedtimeend,4,2) AS INT) *60))- ((CAST(SUBSTR(xx.wedtimebegin,1,2) AS INT) *3600)+( CAST(SUBSTR(xx.wedtimebegin,4, 2) AS INT) *60)) ) / 3600 AS REAL) ELSE 0.0 END AS wedduration, " + -"CASE WHEN xx.status IS NOT NULL AND strftime('%w',xx.daydate) = '4' AND xx.daydate BETWEEN xx.datebegin AND xx.dateend THEN CAST(( (( CAST(SUBSTR(xx.thutimeend,1,2) AS INT) *3600)+( CAST(SUBSTR(xx.thutimeend,4,2) AS INT) *60))- ((CAST(SUBSTR(xx.thutimebegin,1,2) AS INT) *3600)+( CAST(SUBSTR(xx.thutimebegin,4, 2) AS INT) *60)) ) / 3600 AS REAL) ELSE 0.0 END AS thuduration, " + -"CASE WHEN xx.status IS NOT NULL AND strftime('%w',xx.daydate) = '5' AND xx.daydate BETWEEN xx.datebegin AND xx.dateend THEN CAST(( (( CAST(SUBSTR(xx.fritimeend,1,2) AS INT) *3600)+( CAST(SUBSTR(xx.fritimeend,4,2) AS INT) *60))- ((CAST(SUBSTR(xx.fritimebegin,1,2) AS INT) *3600)+( CAST(SUBSTR(xx.fritimebegin,4, 2) AS INT) *60)) ) / 3600 AS REAL) ELSE 0.0 END AS friduration, " + -"CASE WHEN xx.status IS NOT NULL AND strftime('%w',xx.daydate) = '1' AND xx.daydate BETWEEN xx.datebegin AND xx.dateend AND xx.montimebegin2 IS NOT NULL AND xx.montimeend2 IS NOT NULL THEN CAST(( (( CAST(SUBSTR(xx.montimeend2,1,2) AS INT) *3600)+( CAST(SUBSTR(xx.montimeend2,4,2) AS INT) *60))- ((CAST(SUBSTR(xx.montimebegin2,1 ,2) AS INT) *3600)+( CAST(SUBSTR (xx.montimebegin2,4,2) AS INT) *60)) ) / 3600 AS REAL) ELSE 0.0 END AS monduration2, " + -"CASE WHEN xx.status IS NOT NULL AND strftime('%w',xx.daydate) = '1' AND xx.daydate BETWEEN xx.datebegin AND xx.dateend AND xx.tuetimebegin2 IS NOT NULL AND xx.tuetimeend2 IS NOT NULL THEN CAST(( (( CAST(SUBSTR(xx.tuetimeend2,1,2) AS INT) *3600)+( CAST(SUBSTR(xx.tuetimeend2,4,2) AS INT) *60))- ((CAST(SUBSTR(xx.tuetimebegin2,1 ,2) AS INT) *3600)+( CAST(SUBSTR (xx.tuetimebegin2,4,2) AS INT) *60)) ) / 3600 AS REAL) ELSE 0.0 END AS tueduration2, " + -"CASE WHEN xx.status IS NOT NULL AND strftime('%w',xx.daydate) = '1' AND xx.daydate BETWEEN xx.datebegin AND xx.dateend AND xx.wedtimebegin2 IS NOT NULL AND xx.wedtimeend2 IS NOT NULL THEN CAST(( (( CAST(SUBSTR(xx.wedtimeend2,1,2) AS INT) *3600)+( CAST(SUBSTR(xx.wedtimeend2,4,2) AS INT) *60))- ((CAST(SUBSTR(xx.wedtimebegin2,1 ,2) AS INT) *3600)+( CAST(SUBSTR (xx.wedtimebegin2,4,2) AS INT) *60)) ) / 3600 AS REAL) ELSE 0.0 END AS wedduration2, " + -"CASE WHEN xx.status IS NOT NULL AND strftime('%w',xx.daydate) = '1' AND xx.daydate BETWEEN xx.datebegin AND xx.dateend AND xx.thutimebegin2 IS NOT NULL AND xx.thutimeend2 IS NOT NULL THEN CAST(( (( CAST(SUBSTR(xx.thutimeend2,1,2) AS INT) *3600)+( CAST(SUBSTR(xx.thutimeend2,4,2) AS INT) *60))- ((CAST(SUBSTR(xx.thutimebegin2,1 ,2) AS INT) *3600)+( CAST(SUBSTR (xx.thutimebegin2,4,2) AS INT) *60)) ) / 3600 AS REAL) ELSE 0.0 END AS thuduration2, " + -"CASE WHEN xx.status IS NOT NULL AND strftime('%w',xx.daydate) = '1' AND xx.daydate BETWEEN xx.datebegin AND xx.dateend AND xx.fritimebegin2 IS NOT NULL AND xx.fritimeend2 IS NOT NULL THEN CAST(( (( CAST(SUBSTR(xx.fritimeend2,1,2) AS INT) *3600)+( CAST(SUBSTR(xx.fritimeend2,4,2) AS INT) *60))- ((CAST(SUBSTR(xx.fritimebegin2,1 ,2) AS INT) *3600)+( CAST(SUBSTR (xx.fritimebegin2,4,2) AS INT) *60)) ) / 3600 AS REAL) ELSE 0.0 END AS friduration2, " + -"NULL AS nouse FROM ( " + -"SELECT vacancydate AS daydate, CAST('0' AS BOOLEAN) AS lunch, 1 AS status, pl.* FROM vacancy va LEFT JOIN planning pl ON ( va.vacancydate BETWEEN pl.datebegin AND pl.dateend) WHERE va.vacancydateto is null and va.vacancydate BETWEEN '"+ydaybegin+"' AND '"+ydayend+"' AND strftime('%w',va.vacancydate) NOT IN ('0', '6') GROUP BY va.vacancydate, pl.childuuid " + -"UNION " + -"SELECT pr.daydate, pr.lunch, pr.status, pl.* FROM presence" + -" pr JOIN planning pl ON ( pr.childuuid=pl.childuuid) WHERE pr.daydate BETWEEN '"+ydaybegin+"' AND "; - -if (pconfig.filteramount.indexOf("preview") != -1) { - accsql += "(select max(zz.daydate) from presence zz where strftime('%Y-%m',zz.daydate) = strftime('%Y-%m',date('now')))" - accsql += " UNION " + -"SELECT tmp.daydate, CASE WHEN pa.monlunch='1' AND strftime('%w',tmp.daydate) = '1' THEN 1 " + -"WHEN pa.tuelunch='1' AND strftime('%w',tmp.daydate) = '2' THEN 1 " + -"WHEN pa.wedlunch='1' AND strftime('%w',tmp.daydate) = '3' THEN 1 " + -"WHEN pa.thulunch='1' AND strftime('%w',tmp.daydate) = '4' THEN 1 " + -"WHEN pa.frilunch='1' AND strftime('%w',tmp.daydate) = '5' THEN 1 else 0 end as lunch, 1 as status , pa.* " + -"FROM (select daydate from ( "; - accsql += getsqldaterange(ydaybegin,ydayend); - accsql += ") dd where dd.daydate not in (select vacancydate from vacancy where vacancydateto is null) and dd.daydate > (select max(yy.daydate) from presence yy where strftime('%Y-%m',yy.daydate) = strftime('%Y-%m',date('now')) ) and strftime('%w',dd.daydate) not in ('0','6') ) tmp " + -"LEFT JOIN planning pa ON ( tmp.daydate BETWEEN pa.datebegin AND pa.dateend) "; - -}else { - accsql += "'"+ydayend+"'"; -} -accsql += ") xx " + -"WHERE xx.daydate BETWEEN '"+ydaybegin+"' AND '"+ydayend+"' "; -if (pconfig.filteramount.indexOf("preview") == -1) { - accsql += " and strftime('%Y-%m',xx.daydate) <= strftime('%Y-%m',date('now')) "; -} -accsql += ") GROUP BY childuuid,calweek) GROUP BY childuuid,calweek) px " + -"ON ( pch.childuuid=px.childuuid) GROUP BY px.childuuid,px.calweek ) ttl " + -"LEFT JOIN accounting acc ON ( ttl.childuuid = acc.childuuid AND ttl.calmonth=strftime('%m.%Y',acc.accmonth)) WHERE calweek IS NOT NULL) " + -"GROUP BY childname,calmonth ORDER BY childname,calmonth;"; - - var accdata = appdb.dbquery(accsql); - //dump(accsql + "\n"); - var headerdata = getlabels("childname,jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec,total"); - $("#tbl_accounting").html(""); - - var hrow = headerdata; - var tdclass= new Array(); - var tblheader = ''; - - for (var h=0;h'+ headerdata[h].title+''; - } - tblheader += ''; - - $("#tbl_accounting").append("" + tblheader + ""); - $("#tbl_accounting").append("" + tblheader + ""); - $("#tbl_accounting").append(""); - - var curchild = ""; - - var tbody = ""; - var trcells = []; - var colmonthsum = new Array(12); - for (var i in accdata.sqldata){ - var row = accdata.sqldata[i]; - if (curchild != row.childname) { - if (i != 0) { - var cells = []; - - for (var t in trcells){ - if (trcells.length > 0) { - if (t == 12) { - for (var s in trcells[t]){ - if (trcells[t][s] == 0) { - trcells[t][s] = ''; - } else { - trcells[t][s] = '' + trcells[t][s].toFixed(2) + ""; - } - } - } - cells[t] = trcells[t].join("
"); - }else { - cells[t] = ""; - } - } - - tbody += "" + cells.join("") +''; - } - tbody += '' + row.childname + ''; - trcells = [[],[],[],[],[],[],[],[],[],[],[],[],[]]; - - } - var cmon = parseInt(row.calmonth)-1; - for (var x in pconfig.filteramount){ - - trcells[cmon][x] = ((row[pconfig.filteramount[x] + "amount"] != '')?'' +row[pconfig.filteramount[x] + "amount"] + "":""); - if (!trcells[12][x]) { - trcells[12][x] = 0; - } - trcells[12][x] = trcells[12][x] + ((row[pconfig.filteramount[x] + "amount"] != '')?parseFloat(row[pconfig.filteramount[x] + "amount"]):0.00); - } - - curchild = row.childname; - } - var cells = []; - - for (var t in trcells){ - if (trcells.length > 0) { - if (t == 12) { - for (var s in trcells[t]){ - if (trcells[t][s] == 0) { - trcells[t][s] = ''; - } else { - trcells[t][s] = '' + trcells[t][s].toFixed(2) + ""; - } - } - } - cells[t] = trcells[t].join("
"); - }else { - cells[t] = ""; - } - } - - tbody += "" + cells.join("") +''; - $("#tbl_accounting").append(tbody); - $("#tbl_accounting").append(""); - - winh = window.innerHeight -130 - ((pconfig.filteramount.length == 0)? 80:pconfig.filteramount.length*16); - tblacc = $("#tbl_accounting").dataTable({ - "language": { - "url": "../../js/locale/datatable_fr.json" - }, - "paging": false, - "ordering": true, - "bAutoWidth": false, - "scrollY": winh + "px", - "scrollCollapse": true, - "info": false, - "filter": true, - "destroy": true, - "footerCallback": function ( row, data, start, end, display ) { - var api = this.api(), data; - - var formatfootercell = function(r){ - var afil = 0; - var dspa = new Array(); - //dump(r + "\n"); - for (var x=0;x' + r[x].toFixed(2)+ ""); - afil++; - } - } - return dspa.join('
'); - } - //var emptarray - var nospan = /\d+\.\d+/g; - var intVal = function ( i ) { - var spl = []; - - if ((!i) || (i == '') ) { - for (var x = 0;x/g,'').replace(//g,''); - spl = i.split("
"); - - if (!spl) { - spl =new Array(); - } - for (var x = spl.length;x"+y+""); - } - -} - -function load_amount_selection(objid) { - for (var s in defamounttitles){ - $('#' + objid).append(''); - } - - if (pconfig.filteramount) { - $('#' + objid).multiselect({enableHTML: true,numberDisplayed:8,nonSelectedText:"Tous",allSelectedText: 'Tous'}); - $('#' + objid).multiselect('select',pconfig.filteramount); - } else { - $('#' + objid).multiselect({enableHTML: true,numberDisplayed:8,nonSelectedText:"Tous",allSelectedText: 'Tous'}); - } -} - -function onselamount() { - if ($('#filter_amounts').val()) { - pconfig.filteramount = $('#filter_amounts').val(); - }else { - pconfig.filteramount = ["invoiced","payed","openinvoices","income","benefit"]; - } - apppref.setpreference("pageconfig.accountingyear",pconfig); - load_accounting_table(); -} - -function set_accyear(){ - pconfig.accyear = $('#accyear').val(); - apppref.setpreference("pageconfig.accountingyear",pconfig); - globelreq.send_request({ - page: 'accountingyear', - module: 'accounting', - data: null, - header: 'Bilan annuelle' - }); -} - - - - diff --git a/TODO/modules_todo/bychild/accountingchild.html b/TODO/modules_todo/bychild/accountingchild.html deleted file mode 100644 index 5376458..0000000 --- a/TODO/modules_todo/bychild/accountingchild.html +++ /dev/null @@ -1,194 +0,0 @@ - - - - - - - Décompte Enfant - - - - - - - - - - - - - - - - -
-
-
- du année: - - -
-
- du enfant: - -
- - -
-
- - - - - - - - - - - - - -
MoisRéférencefacturé €payé €prestation €
-
-
- - - - - - - - - - - - - - - - - - diff --git a/TODO/modules_todo/forms/forms.xul b/TODO/modules_todo/forms/forms.xul deleted file mode 100644 index 54eeef0..0000000 --- a/TODO/modules_todo/forms/forms.xul +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/TODO/modules_todo/forms/img/doc.png b/TODO/modules_todo/forms/img/doc.png deleted file mode 100644 index 32dbbec..0000000 Binary files a/TODO/modules_todo/forms/img/doc.png and /dev/null differ diff --git a/TODO/modules_todo/forms/img/form.png b/TODO/modules_todo/forms/img/form.png deleted file mode 100644 index 0de6475..0000000 Binary files a/TODO/modules_todo/forms/img/form.png and /dev/null differ diff --git a/TODO/modules_todo/forms/js/forms.js b/TODO/modules_todo/forms/js/forms.js deleted file mode 100644 index a585c62..0000000 --- a/TODO/modules_todo/forms/js/forms.js +++ /dev/null @@ -1,93 +0,0 @@ -//Source-code licensed under EUPL v1.2 ( Copyright 2019 By DKS s.à r.l. - Kilian Saffran - Luxembourg ) - -var wh= window.screen.height -400; -var myfiles = null; -var delform = null; -var cruuid = null; -var candelete = 0; -function initdata(){ - curcfg.loadconfig(apppref.getpreference("support.database.currentdb.num")); - load_table_forms(); - set_infoheader(""); - if (system.appinfo().ID.indexOf("director")){ - candelete = 1; - } - } - -function load_table_forms(){ - var cname = appdb.dbquery("select uuid from creche LIMIT 1;"); - cruuid = cname.sqldata[0].uuid; - - myfiles = system.getReports(cruuid); - var atbody = new Array(); - for (var i=0;i'; - //} - row.push('' + btndelete); - row.push(fname); - atbody.push(row); - } - - } - - $("#tbl_forms").html(""); - - - - var headerdata = getlabels("action,description"); - $("#tbl_forms").html(""); - $("#tbl_forms").dataTable({ - "language": { - "url": "../../js/locale/datatable_fr.json" - }, - "data": atbody, - "columns": headerdata, - "paging": false, - "scrollY": wh + "px", - "scrollCollapse": true, - "ordering": true, - "info": false, - "filter": false, - "destroy": true - }); -} - -function preview_report(fi){ - var ff = system.openFile(myfiles[fi].path); -} - - -function delete_report(fi) { - delform = fi; - confirm_delete_forms(); -} - -function dlg_addform(){ - $("#edit_forms").modal('show'); -} - -function confirm_delete_forms(){ - $("#confirm_delete_forms").modal('show'); - return false; -} - -function delete_forms(){ - OS.File.remove(myfiles[delform].path); - setTimeout(function(){load_table_forms();$("#confirm_delete_forms").modal('hide');},3000); - delform = null; - return false; -} - -function save_forms(){ - var file = $("#frmeditforms #file").val(); - var path = FileUtils.File(curcfg.path.local + system.sep() +"reports" + system.sep() + cruuid); - var newlocation= path.path + system.sep() + system.getFileName(file); - OS.File.copy(file, newlocation); - setTimeout(function(){load_table_forms();$("#edit_forms").modal('hide');},3000); -} diff --git a/TODO/modules_todo/logbook/img/logbook.png b/TODO/modules_todo/logbook/img/logbook.png deleted file mode 100644 index a8c9914..0000000 Binary files a/TODO/modules_todo/logbook/img/logbook.png and /dev/null differ diff --git a/TODO/modules_todo/logbook/js/logactivity.js b/TODO/modules_todo/logbook/js/logactivity.js deleted file mode 100644 index 5f6082e..0000000 --- a/TODO/modules_todo/logbook/js/logactivity.js +++ /dev/null @@ -1,326 +0,0 @@ -//Source-code licensed under EUPL v1.2 ( Copyright 2019 By DKS s.à r.l. - Kilian Saffran - Luxembourg ) -var pconfig = {}; -var winh= window.innerHeight -170; -var tbllog = null; -var crecheuuid = null; -var initdate = new Date(); -var deluuid = ""; -var amonth = ['', 'Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Aôut', 'Septembre', 'Octobre','Novembre', 'Décembre']; -var myhostname = system.hostname(); - -function initdata(){ - - load_helpers(); - var configdata = apppref.getpreference("pageconfig.logactivity"); - //dump("cfdata:" + configdata +"\n"); - if ((configdata) && (configdata !== '')){ - pconfig = JSON.parse(configdata); - } - //dump("logactivity Page new loaded!\n"); - //if (!pconfig.printlayout) { - pconfig.printlayout = 'book'; - apppref.setpreference("pageconfig.logactivity",pconfig); - //} - var ccreche = appdb.dbquery("select uuid from creche LIMIT 1;"); - crecheuuid = ccreche.sqldata[0].uuid; - var edith = 270; - loadtextareas(edith); - myhostname = system.hostname(); - if (pconfig.logmonth) { - - initdate = new Date(encodeparam(pconfig.logmonth, 'month').replace(/'/g, '')); - $("#logmonth").val(pconfig.logmonth); - } else { - $("#logmonth").val(initdate.toLocaleFormat('%m.%Y')); - - pconfig.logmonth=initdate.toLocaleFormat("%m.%Y"); - apppref.setpreference("pageconfig.logactivity",pconfig); - } - var acttitle = ""; - if (pconfig.activityuuid){ - var chdata = appdb.dbquery("select logtitle from activitylog where uuid='"+ pconfig.activityuuid +"'"); - if (chdata.sqldata.length > 0){ - acttitle = chdata.sqldata[0].logtitle + " - "; - } - } - //dump(JSON.stringify(pconfig) + "\n"); - set_infoheader(acttitle + " Mois: " + amonth[parseInt(pconfig.logmonth.substring(0, 3))] + " " + pconfig.logmonth.substring(3, 8)); - - $('#logmonth').on('dp.hide', function(e) { - set_logmonth(); - }); - $("#btnedit").hide(); - $("#btnprotection").hide(); - $("#btndelete").hide(); - load_logactivity_table(); - -} - - - -function load_logactivity_table(){ - var mins = initdate.getTimezoneOffset() * -1;//dump("cur timezoneoffset:" + + "\n"); - if (mins > 0){ - mins = '+' + mins; - } - var logsql = "SELECT uuid, logtitle, strftime('%d.%m.%Y',logdatefrom) as logdatefrom, strftime('%d.%m.%Y',logdateto) as logdateto,'' || lastmodified || '' || strftime('%d.%m.%Y %H:%M',lastmodified,'"+mins+" minutes') as lastmodified,editor FROM activitylog where date(logdatefrom) between date('"+initdate.toLocaleFormat("%Y-%m")+"-01') and date('"+initdate.toLocaleFormat("%Y-%m")+"-01','+1 month','-1 day') or logdateto between date('"+initdate.toLocaleFormat("%Y-%m")+"-01') and date('"+initdate.toLocaleFormat("%Y-%m")+"-01','+1 month','-1 day');"; - var logdata = appdb.dbquery(logsql); - var headerdata = getlabels("activity,lastmodified,editor"); - $("#tbl_logactivity").html(""); - - var tblheader = ''; - - for (var h in headerdata){ - if ((headerdata[h].keyname == 'act') && (headerdata[h].class.indexOf('action1btn') == -1)){ - headerdata[h].class +=" action1btn"; - } - - tblheader += ''+ headerdata[h].title+''; - - } - tblheader += ''; - - - $("#tbl_logactivity").append("" + tblheader + ""); - $("#tbl_logactivity").append("" + tblheader + ""); - $("#tbl_logactivity").append(""); - - - for (var i in logdata.sqldata){ - var sel = ""; - var row = logdata.sqldata[i]; - if (pconfig.activityuuid && row.uuid == pconfig.activityuuid) { - sel = "selected"; - load_activitylog(); - } - // - //!= '')?'':'') +row.editor - var tr = '' + row.logtitle + '
' + row.logdatefrom +' - ' + row.logdateto + ''+ - ''+ row.lastmodified+''+''+ row.editor +''+ - ''; - - $("#tbl_logactivity").append(tr); - } - - $("#tbl_logactivity").append(""); - - - tbllog = $("#tbl_logactivity").dataTable({ - "language": { - "url": "../../js/locale/datatable_fr.json" - }, - "paging": false, - "ordering": true, - "bAutoWidth": false, - "scrollY": winh + "px", - "scrollCollapse": true, - "info": false, - "filter": false, - "destroy": true, - }); - - - - $('#tbl_logactivity').on( 'order.dt', function () { - pconfig.order= tbllog.fnSettings().aaSorting; - apppref.setpreference("pageconfig.logactivity",pconfig); - - } ); - - if (pconfig.order) { - - tbllog.fnSort(pconfig.order); - } - - $('#tbl_logactivity tbody').on( 'click', 'tr', function () { - //dump("select activity\n"); - if ( $(this).hasClass('selected') ) { - // $(this).removeClass('selected'); - } - else { - //dump("select activity\n"); - $("#btnedit").hide(); - $("#btnprotection").hide(); - $("#btndelete").hide(); - tbllog.$('tr.selected').removeClass('selected'); - $(this).addClass('selected'); - var curactivity = $(this).attr('data-activity'); - pconfig.activityuuid = curactivity; - var actlogsql = "SELECT editor FROM activitylog where uuid='"+ pconfig.activityuuid+"';"; - var adata = appdb.dbquery(actlogsql); - - if (adata.sqldata[0].editor == '' || adata.sqldata[0].editor == myhostname){ - $("#btnedit").show(); - $("#btndelete").show(); - } - if (adata.sqldata[0].editor != '' && adata.sqldata[0].editor != myhostname){ - $("#btnprotection").show(); - } - //setforeigneditor($(this).attr('data-editor')); - apppref.setpreference("pageconfig.logactivity",pconfig); - load_activitylog(); - } - } ); - -} - - - -function newlogactivity(){ - var nuuid = appdb.generate_uuid(); - var sql = "INSERT INTO activitylog (uuid,logtitle,logdatefrom,logdateto) VALUES ('"+nuuid+"','nouvelle Activité',date('"+initdate.toISOString().substring(0,10)+"'),date('"+initdate.toISOString().substring(0,10)+"'));"; - appdb.dbexec(sql); - pconfig.activityuuid=nuuid; - apppref.setpreference("pageconfig.logactivity",pconfig); - edit_activitylog(); - //load_logactivity_table(); -} - -function load_activitylog(){ - $("#btnedit").hide(); - $("#btnprotection").hide(); - $("#btndelete").hide(); - var actlogsql = "SELECT uuid, strftime('%d.%m.%Y',logdatefrom) as logdatefrom, strftime('%d.%m.%Y',logdateto) as logdateto, logtitle, logmessage,editor FROM activitylog where uuid='"+ pconfig.activityuuid+"';"; - var adata = appdb.dbquery(actlogsql); - var inftitle = ""; - if (adata.sqldata.length > 0){ - $("#activityloguuid").val(adata.sqldata[0].uuid); - $("#activitylogmessage").html(htmlUnescape(adata.sqldata[0].logmessage)) - $("#activitylogtitle").html(adata.sqldata[0].logtitle); - $("#activitylogdatefrom").html(adata.sqldata[0].logdatefrom); - $("#activitylogdateto").html(adata.sqldata[0].logdateto); - if (adata.sqldata[0].editor == '' || adata.sqldata[0].editor == myhostname){ - $("#btnedit").show(); - $("#btndelete").show(); - } - if (adata.sqldata[0].editor != '' && adata.sqldata[0].editor != myhostname){ - $("#btnprotection").show(); - } - - inftitle=adata.sqldata[0].logtitle; - }else { - $("#activityloguuid").val(0); - $("#activitylogmessage").html(""); - $("#activitylogtitle").html(''); - $("#activitylogdatefrom").html(''); - $("#activitylogdateto").html(''); - } - - set_infoheader(inftitle + " Mois: " + amonth[parseInt(pconfig.logmonth.substring(0, 3))] + " " + pconfig.logmonth.substring(3, 8)); - -} - -function edit_activitylog(){ - var actlogsql = "SELECT uuid, strftime('%d.%m.%Y',logdatefrom) as logdatefrom, strftime('%d.%m.%Y',logdateto) as logdateto, logtitle, logmessage,editor FROM activitylog where uuid='"+ pconfig.activityuuid+"';"; - - var adata = appdb.dbquery(actlogsql); - //dump("EDIT: " + JSON.stringify(chdata) + "\n"); - if ((adata.sqldata[0].editor != '') && (adata.sqldata[0].editor != myhostname)){ - system.popup("cette activité est bloqué par l'editeur: " + adata.sqldata[0].editor); - load_logactivity_table(); - return; - } - seteditorhost(); - if (adata.sqldata.length > 0){ - $('#frmeditactivitylog #loguuid').val(adata.sqldata[0].uuid); - $("#frmeditactivitylog #logtitle").val(adata.sqldata[0].logtitle); - $("#frmeditactivitylog #logdatefrom").val(adata.sqldata[0].logdatefrom); - $("#frmeditactivitylog #logdateto").val(adata.sqldata[0].logdateto); - $("#frmeditactivitylog #logmessage").summernote('reset'); - $("#frmeditactivitylog #logmessage").summernote('code',htmlUnescape(adata.sqldata[0].logmessage)); - } - $("#edit_activitylog").modal('show'); -} - -function save_activitylog(){ - var lsql = ""; - //dump($('#frmeditactivitylog #logdateto').val() + " - " + $('#frmeditactivitylog #logdatefrom').val() + "\n"); - $("#activityloguuid").val($("#frmeditactivitylog #loguuid").val()); - //var tmpdate = encodeparam(pconfig.logdate, 'date').replace(/'/g, ''); - var dt = encodeparam($("#frmeditactivitylog #logdateto").val(),"date"); - var df = encodeparam($("#frmeditactivitylog #logdatefrom").val(),"date"); - var ltitle = encodeparam($('#frmeditactivitylog #logtitle').val(),"text"); - var lmessage = encodeparam($('#frmeditactivitylog #logmessage').val(),"richtextarea"); - var uid = $("#frmeditactivitylog #loguuid").val(); - //dump(df + " - " + dt + "\n"); - var lsql = "UPDATE activitylog set logtitle="+ltitle+ - ",logmessage="+lmessage+ - ",logdatefrom=date("+df+")"+ - ",logdateto=date("+dt+") where uuid='"+uid+"';"; - //dump(lsql + "\n"); - appdb.dbexec(lsql); - removeeditorhost(); - load_logactivity_table(); - //load_activitylog(); - $("#edit_activitylog").modal('hide'); -} - -function confirm_delete_activity() { - - deluuid = $("#activityloguuid").val(); - $('#confirm_delete_logactivity').modal('show'); -} - -function delete_logactivity() { - appdb.dbexec("delete from activitylog where uuid='"+ deluuid+"';"); - load_logactivity_table(); - $('#confirm_delete_logactivity').modal('hide'); -} - -function onnextmonth() { - var tmpmonth = new Date(encodeparam(pconfig.logmonth, 'month').replace(/'/g, '')); - var nmonth = new Date(tmpmonth.getFullYear(), tmpmonth.getMonth() + 1, tmpmonth.getDate()); - pconfig.logmonth = nmonth.toLocaleFormat('%m.%Y'); - apppref.setpreference("pageconfig.logactivity", pconfig); - globelreq.send_request({ - page: 'logactivity', - module: 'logbook', - header: 'Livret des activités' - }, null); -} - -function onpreviousmonth() { - var tmpmonth = new Date(encodeparam(pconfig.logmonth, 'month').replace(/'/g, '')); - var nmonth = new Date(tmpmonth.getFullYear(), tmpmonth.getMonth() - 1, tmpmonth.getDate()); - pconfig.logmonth = nmonth.toLocaleFormat('%m.%Y'); - apppref.setpreference("pageconfig.logactivity", pconfig); - globelreq.send_request({ - page: 'logactivity', - module: 'logbook', - header: 'Livret des activités' - }, null); -} - -function set_logmonth(){ - pconfig.logmonth =$("#logmonth").val(); - apppref.setpreference("pageconfig.logactivity",pconfig); - globelreq.send_request({ - page: 'logactivity', - module: 'logbook', - header: 'Livret des activités' - }); -} - -function seteditorhost(){ - appdb.dbexec("UPDATE activitylog set editor=null where editor='"+myhostname+"';"); - appdb.dbexec("UPDATE activitylog set editor='"+myhostname+"' where uuid='"+$('#activityloguuid').val()+"';"); -} - -function removeeditorhost(){ - appdb.dbexec("UPDATE activitylog set editor=null where editor='"+myhostname+"';"); -} - - -function confirm_delete_protection(){ - $("#confirm_delete_protection").modal('show'); -} - -function delete_protection(){ - appdb.dbexec("UPDATE activitylog set editor=null where uuid='"+$('#activityloguuid').val()+"';"); - $('#editorhost').html(''); - $('#btneditorhost').removeClass('btn-danger'); - $('#btneditorhost').addClass('btn-default'); - $('#btnprotection').hide(); - load_logactivity_table(); - $("#confirm_delete_protection").modal('hide'); -} \ No newline at end of file diff --git a/TODO/modules_todo/logbook/js/logactivity_basic.js b/TODO/modules_todo/logbook/js/logactivity_basic.js deleted file mode 100644 index 738e15a..0000000 --- a/TODO/modules_todo/logbook/js/logactivity_basic.js +++ /dev/null @@ -1,282 +0,0 @@ -//Source-code licensed under EUPL v1.2 ( Copyright 2019 By DKS s.à r.l. - Kilian Saffran - Luxembourg ) -var pconfig = {}; -var winh= window.innerHeight -170; -var tbllog = null; -var crecheuuid = null; -var initdate = new Date(); -var deluuid = ""; -var amonth = ['', 'Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Aôut', 'Septembre', 'Octobre','Novembre', 'Décembre']; -var myhostname = system.hostname(); - -function initdata(){ - - load_helpers(); - var configdata = apppref.getpreference("pageconfig.logactivity"); - //dump("cfdata:" + configdata +"\n"); - if ((configdata) && (configdata !== '')){ - pconfig = JSON.parse(configdata); - } - //dump("logactivity Page new loaded!\n"); - //if (!pconfig.printlayout) { - pconfig.printlayout = 'book'; - apppref.setpreference("pageconfig.logactivity",pconfig); - //} - var ccreche = appdb.dbquery("select uuid from creche LIMIT 1;"); - crecheuuid = ccreche.sqldata[0].uuid; - var edith = 270; - loadtextareas(edith); - myhostname = system.hostname(); - if (pconfig.logmonth) { - - initdate = new Date(encodeparam(pconfig.logmonth, 'month').replace(/'/g, '')); - $("#logmonth").val(pconfig.logmonth); - } else { - $("#logmonth").val(initdate.toLocaleFormat('%m.%Y')); - - pconfig.logmonth=initdate.toLocaleFormat("%m.%Y"); - apppref.setpreference("pageconfig.logactivity",pconfig); - } - var acttitle = ""; - if (pconfig.activityuuid){ - var chdata = appdb.dbquery("select logtitle from activitylog where uuid='"+ pconfig.activityuuid +"'"); - if (chdata.sqldata.length > 0){ - acttitle = chdata.sqldata[0].logtitle + " - "; - } - } - //dump(JSON.stringify(pconfig) + "\n"); - set_infoheader(acttitle + " Mois: " + amonth[parseInt(pconfig.logmonth.substring(0, 3))] + " " + pconfig.logmonth.substring(3, 8)); - - $('#logmonth').on('dp.hide', function(e) { - set_logmonth(); - }); - $("#btnedit").hide(); - - load_logactivity_table(); - -} - - - -function load_logactivity_table(){ - var mins = initdate.getTimezoneOffset() * -1;//dump("cur timezoneoffset:" + + "\n"); - if (mins > 0){ - mins = '+' + mins; - } - var logsql = "SELECT uuid, logtitle, strftime('%d.%m.%Y',logdatefrom) as logdatefrom, strftime('%d.%m.%Y',logdateto) as logdateto,'' || lastmodified || '' || strftime('%d.%m.%Y %H:%M',lastmodified,'"+mins+" minutes') as lastmodified,editor FROM activitylog where date(logdatefrom) between date('"+initdate.toLocaleFormat("%Y-%m")+"-01') and date('"+initdate.toLocaleFormat("%Y-%m")+"-01','+1 month','-1 day') or logdateto between date('"+initdate.toLocaleFormat("%Y-%m")+"-01') and date('"+initdate.toLocaleFormat("%Y-%m")+"-01','+1 month','-1 day');"; - var logdata = appdb.dbquery(logsql); - var headerdata = getlabels("activity,lastmodified,editor"); - $("#tbl_logactivity").html(""); - - var tblheader = ''; - - for (var h in headerdata){ - if ((headerdata[h].keyname == 'act') && (headerdata[h].class.indexOf('action1btn') == -1)){ - headerdata[h].class +=" action1btn"; - } - - tblheader += ''+ headerdata[h].title+''; - - } - tblheader += ''; - - - $("#tbl_logactivity").append("" + tblheader + ""); - $("#tbl_logactivity").append("" + tblheader + ""); - $("#tbl_logactivity").append(""); - - - for (var i in logdata.sqldata){ - var sel = ""; - var row = logdata.sqldata[i]; - if (pconfig.activityuuid && row.uuid == pconfig.activityuuid) { - sel = "selected"; - load_activitylog(); - } - - var tr = '' + row.logtitle + '
' + row.logdatefrom +' - ' + row.logdateto + ''+ - ''+ row.lastmodified+''+''+ row.editor +''+ - ''; - - $("#tbl_logactivity").append(tr); - } - - $("#tbl_logactivity").append(""); - - - tbllog = $("#tbl_logactivity").dataTable({ - "language": { - "url": "../../js/locale/datatable_fr.json" - }, - "paging": false, - "ordering": true, - "bAutoWidth": false, - "scrollY": winh + "px", - "scrollCollapse": true, - "info": false, - "filter": false, - "destroy": true, - }); - - - - $('#tbl_logactivity').on( 'order.dt', function () { - pconfig.order= tbllog.fnSettings().aaSorting; - apppref.setpreference("pageconfig.logactivity",pconfig); - - } ); - - if (pconfig.order) { - - tbllog.fnSort(pconfig.order); - } - - $('#tbl_logactivity tbody').on( 'click', 'tr', function () { - //dump("select activity\n"); - if ( $(this).hasClass('selected') ) { - // $(this).removeClass('selected'); - } - else { - //dump("select activity\n"); - $("#btnedit").hide(); - tbllog.$('tr.selected').removeClass('selected'); - $(this).addClass('selected'); - var curactivity = $(this).attr('data-activity'); - var actlogsql = "SELECT editor FROM activitylog where uuid='"+ pconfig.activityuuid+"';"; - var adata = appdb.dbquery(actlogsql); - pconfig.activityuuid = curactivity; - if (adata.sqldata[0].editor == '' || adata.sqldata[0].editor == myhostname){ - $("#btnedit").show(); - } - //setforeigneditor($(this).attr('data-editor')); - apppref.setpreference("pageconfig.logactivity",pconfig); - load_activitylog(); - } - } ); - -} - - - -function newlogactivity(){ - var nuuid = appdb.generate_uuid(); - var sql = "INSERT INTO activitylog (uuid,logtitle,logdatefrom,logdateto) VALUES ('"+nuuid+"','nouvelle Activité',date('"+initdate.toISOString().substring(0,10)+"'),date('"+initdate.toISOString().substring(0,10)+"'));"; - appdb.dbexec(sql); - pconfig.activityuuid=nuuid; - apppref.setpreference("pageconfig.logactivity",pconfig); - edit_activitylog(); - //load_logactivity_table(); -} - -function load_activitylog(){ - $("#btnedit").hide(); - var actlogsql = "SELECT uuid, strftime('%d.%m.%Y',logdatefrom) as logdatefrom, strftime('%d.%m.%Y',logdateto) as logdateto, logtitle, logmessage,editor FROM activitylog where uuid='"+ pconfig.activityuuid+"';"; - var adata = appdb.dbquery(actlogsql); - var inftitle = ""; - if (adata.sqldata.length > 0){ - $("#activityloguuid").val(adata.sqldata[0].uuid); - $("#activitylogmessage").html(htmlUnescape(adata.sqldata[0].logmessage)) - $("#activitylogtitle").html(adata.sqldata[0].logtitle); - $("#activitylogdatefrom").html(adata.sqldata[0].logdatefrom); - $("#activitylogdateto").html(adata.sqldata[0].logdateto); - if (adata.sqldata[0].editor == '' || adata.sqldata[0].editor == myhostname){ - $("#btnedit").show(); - } - - inftitle=adata.sqldata[0].logtitle; - }else { - $("#activityloguuid").val(0); - $("#activitylogmessage").html(""); - $("#activitylogtitle").html(''); - $("#activitylogdatefrom").html(''); - $("#activitylogdateto").html(''); - } - - set_infoheader(inftitle + " Mois: " + amonth[parseInt(pconfig.logmonth.substring(0, 3))] + " " + pconfig.logmonth.substring(3, 8)); - -} - -function edit_activitylog(){ - var actlogsql = "SELECT uuid, strftime('%d.%m.%Y',logdatefrom) as logdatefrom, strftime('%d.%m.%Y',logdateto) as logdateto, logtitle, logmessage,editor FROM activitylog where uuid='"+ pconfig.activityuuid+"';"; - var adata = appdb.dbquery(actlogsql); - if ((adata.sqldata[0].editor != '') && (adata.sqldata[0].editor != myhostname)){ - system.popup("cette activité est bloqué par l'editeur: " + adata.sqldata[0].editor); - return; - } - //dump("EDIT: " + JSON.stringify(chdata) + "\n"); - seteditorhost(); - if (adata.sqldata.length > 0){ - $('#frmeditactivitylog #loguuid').val(adata.sqldata[0].uuid); - $("#frmeditactivitylog #logtitle").val(adata.sqldata[0].logtitle); - $("#frmeditactivitylog #logdatefrom").val(adata.sqldata[0].logdatefrom); - $("#frmeditactivitylog #logdateto").val(adata.sqldata[0].logdateto); - $("#frmeditactivitylog #logmessage").summernote('reset'); - $("#frmeditactivitylog #logmessage").summernote('code',htmlUnescape(adata.sqldata[0].logmessage)); - } - $("#edit_activitylog").modal('show'); -} - -function save_activitylog(){ - var lsql = ""; - //dump($('#frmeditactivitylog #logdateto').val() + " - " + $('#frmeditactivitylog #logdatefrom').val() + "\n"); - $("#activityloguuid").val($("#frmeditactivitylog #loguuid").val()); - //var tmpdate = encodeparam(pconfig.logdate, 'date').replace(/'/g, ''); - var dt = encodeparam($("#frmeditactivitylog #logdateto").val(),"date"); - var df = encodeparam($("#frmeditactivitylog #logdatefrom").val(),"date"); - var ltitle = encodeparam($('#frmeditactivitylog #logtitle').val(),"text"); - var lmessage = encodeparam($('#frmeditactivitylog #logmessage').val(),"richtextarea"); - var uid = $("#frmeditactivitylog #loguuid").val(); - //dump(df + " - " + dt + "\n"); - var lsql = "UPDATE activitylog set logtitle="+ltitle+ - ",logmessage="+lmessage+ - ",logdatefrom=date("+df+")"+ - ",logdateto=date("+dt+") where uuid='"+uid+"';"; - //dump(lsql + "\n"); - appdb.dbexec(lsql); - removeeditorhost(); - load_logactivity_table(); - //load_activitylog(); - $("#edit_activitylog").modal('hide'); -} - -function onnextmonth() { - var tmpmonth = new Date(encodeparam(pconfig.logmonth, 'month').replace(/'/g, '')); - var nmonth = new Date(tmpmonth.getFullYear(), tmpmonth.getMonth() + 1, tmpmonth.getDate()); - pconfig.logmonth = nmonth.toLocaleFormat('%m.%Y'); - apppref.setpreference("pageconfig.logactivity", pconfig); - globelreq.send_request({ - page: 'logactivity_basic', - module: 'logbook', - header: 'Livret des activités' - }, null); -} - -function onpreviousmonth() { - var tmpmonth = new Date(encodeparam(pconfig.logmonth, 'month').replace(/'/g, '')); - var nmonth = new Date(tmpmonth.getFullYear(), tmpmonth.getMonth() - 1, tmpmonth.getDate()); - pconfig.logmonth = nmonth.toLocaleFormat('%m.%Y'); - apppref.setpreference("pageconfig.logactivity", pconfig); - globelreq.send_request({ - page: 'logactivity_basic', - module: 'logbook', - header: 'Livret des activités' - }, null); -} - -function set_logmonth(){ - pconfig.logmonth =$("#logmonth").val(); - apppref.setpreference("pageconfig.logactivity",pconfig); - globelreq.send_request({ - page: 'logactivity_basic', - module: 'logbook', - header: 'Livret des activités' - }); -} - -function seteditorhost(){ - appdb.dbexec("UPDATE activitylog set editor=null where editor='"+myhostname+"';"); - appdb.dbexec("UPDATE activitylog set editor='"+myhostname+"' where uuid='"+$('#loguuid').val()+"';"); -} - -function removeeditorhost(){ - appdb.dbexec("UPDATE activitylog set editor=null where editor='"+myhostname+"';"); -} diff --git a/TODO/modules_todo/logbook/js/logchild.js b/TODO/modules_todo/logbook/js/logchild.js deleted file mode 100644 index e144307..0000000 --- a/TODO/modules_todo/logbook/js/logchild.js +++ /dev/null @@ -1,359 +0,0 @@ -//Source-code licensed under EUPL v1.2 ( Copyright 2019 By DKS s.à r.l. - Kilian Saffran - Luxembourg ) -var pconfig = {}; -var winh= window.innerHeight -170; -var tbllog = null; -var crecheuuid = null; -var initdate = new Date(); -var myhostname = system.hostname(); - -function initdata(){ - - load_helpers(); - var configdata = apppref.getpreference("pageconfig.logchild"); - - if ((configdata) && (configdata !== '')){ - pconfig = JSON.parse(configdata); - } - //dump(JSON.stringify(pconfig) + "\n"); - //if (!pconfig.printlayout) { - pconfig.printlayout = 'logchild'; - apppref.setpreference("pageconfig.logchild",pconfig); - //} - var ccreche = appdb.dbquery("select uuid from creche LIMIT 1;"); - crecheuuid = ccreche.sqldata[0].uuid; - - loadtextareas(winh); - $("#logdate").on("dp.hide", function () { - set_logdate(); - }); - myhostname = system.hostname(); - if (pconfig.logdate) { - - initdate = new Date(encodeparam(pconfig.logdate, 'date').replace(/'/g, '')); - $("#logdate").val(pconfig.logdate); - } else { - $("#logdate").val(initdate.toISOString().substring(0,10)); - pconfig.logdate = initdate.toISOString().substring(0,10); - } - var childname = ""; - if (pconfig.childuuid){ - var chdata = appdb.dbquery("select prename || ' ' || surname AS childname from childs where uuid='"+ pconfig.childuuid +"'"); - if (chdata.sqldata.length > 0){ - childname = chdata.sqldata[0].childname + " - "; - } - } - set_infoheader(childname + " Date du: " + pconfig.logdate); - load_logchild_table(); - -} - - - - - -function load_logchild_table(){ - var mins = initdate.getTimezoneOffset() * -1;//dump("cur timezoneoffset:" + + "\n"); - if (mins > 0){ - mins = '+' + mins; - } - var sqlchilds = "select distinct(ch.uuid) as uuid, ch.prename || ' ' || ch.surname AS childname, ch.checkservicenumber,gr.grpname,'' || cl.lastmodified || '' || strftime('%d.%m.%Y %H:%M',cl.lastmodified,'"+mins+" minutes') as lastmodified,cl.editor as editor from childs ch left join planning pl on (ch.uuid=pl.childuuid) left join groups gr on (pl.groupuuid=gr.uuid) left join childslog cl on (ch.uuid=cl.childuuid and logdate=date('"+initdate.toISOString().substring(0,10)+"')) where date('"+ initdate.toISOString().substring(0,10)+"') between pl.datebegin and pl.dateend order by childname;"; - //dump("SQLChilds:" + sqlchilds + "\n"); - var logdata = appdb.dbquery(sqlchilds); - //dump("load childs Log!\n"); - var headerdata = getlabels("childname,grpname,lastmodified,editor"); - - $("#tbl_logchild").html(""); - //if (tbllog) {tbllog.destroy();} - var tblheader = ''; - - for (var h in headerdata){ - if ((headerdata[h].keyname == 'act') && (headerdata[h].class.indexOf('action1btn') == -1)){ - headerdata[h].class +=" action1btn"; - } - if ((pconfig.hidden_columns) && (pconfig.hidden_columns.indexOf(headerdata[h].keyname) != -1)) { - if (headerdata[h].class.indexOf('colhidden') == -1) { - headerdata[h].class += " colhidden"; - } - }else { - headerdata[h].class.replace("colhidden",""); - } - tblheader += ''+ headerdata[h].title+''; - - } - tblheader += ''; - - - $("#tbl_logchild").append("" + tblheader + ""); - $("#tbl_logchild").append("" + tblheader + ""); - $("#tbl_logchild").append(""); - - //var curchld = ""; - - for (var i in logdata.sqldata){ - var row = logdata.sqldata[i]; - var sel = ""; - if (pconfig.childuuid && row.uuid == pconfig.childuuid) { - sel = "selected"; - load_childlog(); - } - var tr = ''; - //tr += ''; - tr += '' + row.childname +'
('+ row.checkservicenumber+ ')'+ ""; - tr += '' + row.grpname + ""; - tr += '' + row.lastmodified + ""; - tr += '' + row.editor + ""; - tr += ""; - $("#tbl_logchild").append(tr); - } - - $("#tbl_logchild").append(""); - - - tbllog = $("#tbl_logchild").dataTable({ - "language": { - "url": "../../js/locale/datatable_fr.json" - }, - "paging": false, - "ordering": true, - "bAutoWidth": false, - "scrollY": winh + "px", - "scrollCollapse": true, - "info": false, - "filter": false, - "destroy": true, - }); - -// $('#tbl_logchild').on( 'search.dt', function () { -// pconfig.filter = tbllog.api().search(); -// apppref.setpreference("pageconfig.logchild",pconfig); -// } ); - - $('#tbl_logchild').on( 'order.dt', function () { - pconfig.order= tbllog.fnSettings().aaSorting; - apppref.setpreference("pageconfig.logchild",pconfig); - - } ); -// if (pconfig.filter) { -// tbllog.fnFilter(pconfig.filter); -// } - if (pconfig.order) { - - tbllog.fnSort(pconfig.order); - } - - - - -$('#tbl_logchild tbody').on( 'click', 'tr', function () { - if ( $(this).hasClass('selected') ) { - // $(this).removeClass('selected'); - } - else { - tbllog.$('tr.selected').removeClass('selected'); - $(this).addClass('selected'); - var curchild = $(this).attr('data-child'); - pconfig.childuuid = curchild; - var chsel = appdb.dbquery("select lastmodified,editor from childslog where childuuid='"+pconfig.childuuid+"' and logdate=date('"+initdate.toISOString().substring(0,10)+"');"); - //dump(JSON.stringify(chsel) + "\n"); - $("#btnadd").hide(); - $("#btnedit").hide(); - $("#btnprotection").hide(); - if (chsel.sqldata.length > 0){ - if (chsel.sqldata[0].editor == '' || chsel.sqldata[0].editor == myhostname){ - $("#btnedit").show(); - } - if (chsel.sqldata[0].editor != '' && chsel.sqldata[0].editor != myhostname){ - $("#btnprotection").show(); - } - - - load_childlog(); - } else { - $("#childlogmessage").html(""); - $("#btnadd").show(); - } - apppref.setpreference("pageconfig.logchild",pconfig); - - } - } ); -} - -function load_childlog(){ - //$("#childlogmessage").summernote('disable'); - var tmpdate = encodeparam(pconfig.logdate, 'date').replace(/'/g, ''); - var childlogsql = "select uuid,logmessage,childuuid,lastmodified,editor from childslog where logdate=date('" + tmpdate + "') and childuuid='"+ pconfig.childuuid+"';"; - var chdata = appdb.dbquery(childlogsql); - $("#btnadd").hide(); - $("#btnedit").hide(); - $("#btnprotection").hide(); - //dump(childlogsql + " -> " +JSON.stringify(chdata) + "\n"); - $("#childlogmessage").html(""); - if (chdata.sqldata.length > 0){ - if (chdata.sqldata[0].editor == '' || chdata.sqldata[0].editor == myhostname){ - $("#btnedit").show(); - } - if (chdata.sqldata[0].editor != '' && chdata.sqldata[0].editor != myhostname){ - $("#btnprotection").show(); - } - //dump("load data from db\n"); - $("#childloguuid").val(chdata.sqldata[0].uuid); - $("#childlogmessage").html(htmlUnescape(chdata.sqldata[0].logmessage)); - }else { - //$("#childlogmessage").html(""); - $("#btnadd").show(); - } - var childname = ""; - if (pconfig.childuuid){ - var chxdata = appdb.dbquery("select prename || ' ' || surname AS childname from childs where uuid='"+ pconfig.childuuid +"'"); - if (chxdata.sqldata.length > 0){ - childname = chxdata.sqldata[0].childname + " - "; - } - } - set_infoheader(childname + " Date du: " + pconfig.logdate); -} - - -function edit_childlog(){ - var childlogsql = "select uuid,logmessage,childuuid,editor from childslog where uuid='"+$("#childloguuid").val()+"';"; - var chdata = appdb.dbquery(childlogsql); - if ((chdata.sqldata[0].editor != '') && (chdata.sqldata[0].editor != myhostname)){ - system.popup("cette fiche d'évaluation est bloqué par l'editeur: " + chdata.sqldata[0].editor); - load_logchild_table()(); - return; - } - //dump("EDIT: " + JSON.stringify(chdata) + "\n"); - seteditorhost(); - if (chdata.sqldata.length > 0){ - //$('#frmeditchildlog #logmessage').summernote('reset'); - $('#frmeditchildlog #uuid').val(chdata.sqldata[0].uuid); - $('#frmeditchildlog #childuuid').val(chdata.sqldata[0].childuuid); - $("#frmeditchildlog #logmessage").summernote('reset'); - $("#frmeditchildlog #logmessage").summernote('code',htmlUnescape(chdata.sqldata[0].logmessage)); - //$('#frmeditchildlog #logmessage').val(htmlUnescape(chdata.sqldata[0].logmessage)); - } - $("#edit_childlog").modal('show'); -} - -function save_childlog(){ - var lsql = ""; - if ($('#frmeditchildlog #uuid').val() == '0'){ - //new childlog - var nuuid = appdb.generate_uuid(); - $("#childloguuid").val(nuuid); - var tmpdate = encodeparam(pconfig.logdate, 'date').replace(/'/g, ''); - lsql = "INSERT INTO childslog (uuid,childuuid,logmessage,logdate) VALUES ('"+nuuid+"','"+pconfig.childuuid+"'," + encodeparam($('#frmeditchildlog #logmessage').val(),"richtextarea")+",date('"+tmpdate+"'));"; - }else { - //update childlog; - lsql = "UPDATE childslog set logmessage="+encodeparam($('#frmeditchildlog #logmessage').val(),"richtextarea")+" where uuid='"+$("#frmeditchildlog #uuid").val()+"';"; - } - appdb.dbexec(lsql); - removeeditorhost(); - load_logchild_table(); - load_childlog(); - $("#edit_childlog").modal('hide'); -} -//$('#childlogmessage').on('summernote.focus', function() { -// seteditorhost(); -// $("#childlogmessage").summernote('enable'); -// }); -// -// -//$('#childlogmessage').on('summernote.blur', function() { -// //dump("New Data\n"); -// var lsql = ""; -// if ($("#childloguuid").val() != "0"){ -// //UPDATE -// lsql = "UPDATE childslog set logmessage="+encodeparam($('#childlogmessage').val(),"richtextarea")+" where uuid='"+$("#childloguuid").val()+"';"; -// //dump("UPDATE:" + lsql + "\n"); -// } else { -// //INSERT -// var nuuid = appdb.generate_uuid(); -// $("#childloguuid").val(nuuid); -// var tmpdate = encodeparam(pconfig.logdate, 'date').replace(/'/g, ''); -// lsql = "INSERT INTO childslog (uuid,childuuid,logmessage,logdate) VALUES ('"+nuuid+"','"+pconfig.childuuid+"'," + encodeparam($('#childlogmessage').val(),"richtextarea")+",date('"+tmpdate+"'));"; -// //dump("INSERT:" + lsql + "\n"); -// } -// appdb.dbexec(lsql); -// removeeditorhost(); -// //load_logchild_table(); -// -//}); - -function addchildlog(){ - var nuuid = appdb.generate_uuid(); - var tmpdate = encodeparam(pconfig.logdate, 'date').replace(/'/g, ''); - $("#childloguuid").val(nuuid); - var lsql = "INSERT INTO childslog (uuid,childuuid,logmessage,logdate) VALUES ('"+nuuid+"','"+pconfig.childuuid+"',null,date('"+tmpdate+"'));"; - appdb.dbexec(lsql); - edit_childlog(); - -} - - -function set_logdate(){ - pconfig.logdate =$("#logdate").val(); - //dump("set_logdate:" + JSON.stringify(pconfig) + "\n"); - apppref.setpreference("pageconfig.logchild",pconfig); - removeeditorhost(); - globelreq.send_request({ - page: 'logchild', - module: 'logbook', - data: null, - header: 'Livret d\'évaluation des enfants par date' - }); -} - - -function onnextdate() { - var tmpmonth = new Date(encodeparam(pconfig.logdate, 'date').replace(/'/g, '')); - var nmonth = new Date(tmpmonth.getFullYear(), tmpmonth.getMonth(), tmpmonth.getDate()+1); - pconfig.logdate = nmonth.toISOString().substring(0,10); - apppref.setpreference("pageconfig.logchild", pconfig); - removeeditorhost(); - globelreq.send_request({ - page: 'logchild', - module: 'logbook', - header: 'Livret d\'évaluation des enfants par date' - }, null); -} - -function onpreviousdate() { - var tmpmonth = new Date(encodeparam(pconfig.logdate, 'date').replace(/'/g, '')); - var nmonth = new Date(tmpmonth.getFullYear(), tmpmonth.getMonth(), tmpmonth.getDate()-1); - pconfig.logdate = nmonth.toISOString().substring(0,10); - apppref.setpreference("pageconfig.logchild", pconfig); - removeeditorhost(); - globelreq.send_request({ - page: 'logchild', - module: 'logbook', - header: 'Livret d\'évaluation des enfants par date' - }, null); -} - -function seteditorhost(){ - //dump('BLOCK editor '+ myhostname +"->"+ $('#childloguuid').val() +"\n"); - appdb.dbexec("UPDATE childslog set editor=null where editor='"+myhostname+"';"); - appdb.dbexec("UPDATE childslog set editor='"+myhostname+"' where uuid='"+$('#childloguuid').val()+"';"); - //load_logchild_table(); -} -// -function removeeditorhost(){ - appdb.dbexec("UPDATE childslog set editor=null where editor='"+myhostname+"';"); - //load_logchild_table(); -} - - - -function confirm_delete_protection(){ - $("#confirm_delete_protection").modal('show'); -} - -function delete_protection(){ - appdb.dbexec("UPDATE childslog set editor=null where uuid='"+$('#childloguuid').val()+"';"); - $('#editorhost').html(''); - $('#btneditorhost').removeClass('btn-danger'); - $('#btneditorhost').addClass('btn-default'); - $('#btnprotection').hide(); - load_logchild_table(); - $("#confirm_delete_protection").modal('hide'); -} diff --git a/TODO/modules_todo/logbook/js/logcominterne.js b/TODO/modules_todo/logbook/js/logcominterne.js deleted file mode 100644 index e3717ae..0000000 --- a/TODO/modules_todo/logbook/js/logcominterne.js +++ /dev/null @@ -1,328 +0,0 @@ -//Source-code licensed under EUPL v1.2 ( Copyright 2019 By DKS s.à r.l. - Kilian Saffran - Luxembourg ) -var pconfig = {}; -var winh= window.innerHeight -170; -var tbllog = null; -var crecheuuid = null; -var initdate = new Date(); -var xcurdate = new Date(); -var deluuid = ""; -var amonth = ['', 'Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Aôut', 'Septembre', 'Octobre','Novembre', 'Décembre']; -var myhostname = system.hostname(); - -function initdata(){ - - load_helpers(); - var configdata = apppref.getpreference("pageconfig.logcominterne"); - //dump("cfdata:" + configdata +"\n"); - if ((configdata) && (configdata !== '')){ - pconfig = JSON.parse(configdata); - } - - pconfig.printlayout = 'book'; - apppref.setpreference("pageconfig.logcominterne",pconfig); - - var ccreche = appdb.dbquery("select uuid from creche LIMIT 1;"); - crecheuuid = ccreche.sqldata[0].uuid; - var edith = 270; - myhostname = system.hostname(); - //dump("Current Hostname:" + myhostname + "\n"); - loadtextareas(edith); - if (pconfig.logmonth) { - - initdate = new Date(encodeparam(pconfig.logmonth, 'month').replace(/'/g, '')); - $("#logmonth").val(pconfig.logmonth); - } else { - $("#logmonth").val(initdate.toLocaleFormat('%m.%Y')); - - pconfig.logmonth=initdate.toLocaleFormat("%m.%Y"); - apppref.setpreference("pageconfig.logcominterne",pconfig); - } - var acttitle = ""; - if (pconfig.activityuuid){ - var chdata = appdb.dbquery("select logtitle from messagelog where uuid='"+ pconfig.messageuuid +"'"); - if (chdata.sqldata.length > 0){ - acttitle = chdata.sqldata[0].logtitle + " - "; - } - } - if (xcurdate.toLocaleFormat("%m.%Y") == pconfig.logmonth){ - $('#btnaddmessage').show(); - } else{ - $('#btnaddmessage').hide(); - } - set_infoheader(acttitle + " Mois: " + amonth[parseInt(pconfig.logmonth.substring(0, 3))] + " " + pconfig.logmonth.substring(3, 8)); - $('#logmonth').on('dp.hide', function(e) { - set_logmonth(); - }); - $("#btnedit").hide(); - $("#btnprotection").hide(); - $("#btndelete").hide(); - load_logmessage_table(); - -} - -function seteditorhost(){ - //dump('BLOCK editor '+ myhostname +"->"+ $('#loguuid').val() +"\n"); - appdb.dbexec("UPDATE messagelog set editor=null where editor='"+myhostname+"';"); - appdb.dbexec("UPDATE messagelog set editor='"+myhostname+"' where uuid='"+$('#cominterneloguuid').val()+"';"); - load_logmessage_table(); -} - -function removeeditorhost(){ - appdb.dbexec("UPDATE messagelog set editor=null where editor='"+myhostname+"';"); - load_logmessage_table(); -} - - -function load_logmessage_table(){ - var mins = initdate.getTimezoneOffset() * -1;//dump("cur timezoneoffset:" + + "\n"); - if (mins > 0){ - mins = '+' + mins; - } - var logsql = "SELECT uuid, logtitle,'' || logdate || '' || strftime('%d.%m.%Y',logdate) as logdate,'' || lastmodified || '' || strftime('%d.%m.%Y %H:%M',lastmodified,'"+mins+" minutes') as lastmodified,editor FROM messagelog where date(logdate) between date('"+initdate.toLocaleFormat("%Y-%m")+"-01') and date('"+initdate.toLocaleFormat("%Y-%m")+"-01','+1 month','-1 day');"; - var logdata = appdb.dbquery(logsql); - var headerdata = getlabels("subject,daydate,lastmodified,editor"); - $("#tbl_logcominterne").html(""); - //tbllog = null; - var tblheader = ''; - - for (var h in headerdata){ - if ((headerdata[h].keyname == 'act') && (headerdata[h].class.indexOf('action1btn') == -1)){ - headerdata[h].class +=" action1btn"; - } - - tblheader += ''+ headerdata[h].title+''; - - } - tblheader += ''; - - - $("#tbl_logcominterne").append("" + tblheader + ""); - $("#tbl_logcominterne").append("" + tblheader + ""); - $("#tbl_logcominterne").append(""); - - - for (var i in logdata.sqldata){ - var sel = ""; - var row = logdata.sqldata[i]; - if (pconfig.messageuuid && row.uuid == pconfig.messageuuid) { - sel = "selected"; - load_messagelog(); - } - - var tr = '' + row.logtitle + ''+ - '' + row.logdate + ''+ - ''+ row.lastmodified+''+ - ''+ row.editor +''+ - ''; - - $("#tbl_logcominterne").append(tr); - } - - $("#tbl_logcominterne").append(""); - - - tbllog = $("#tbl_logcominterne").dataTable({ - "language": { - "url": "../../js/locale/datatable_fr.json" - }, - "paging": false, - "ordering": true, - "bAutoWidth": false, - "scrollY": winh + "px", - "scrollCollapse": true, - "info": false, - "filter": false, - "destroy": true, - }); - - - - $('#tbl_logcominterne').on( 'order.dt', function () { - pconfig.order= tbllog.fnSettings().aaSorting; - apppref.setpreference("pageconfig.logcominterne",pconfig); - - } ); - - if (pconfig.order) { - - tbllog.fnSort(pconfig.order); - } - - - -$('#tbl_logcominterne tbody').on( 'click', 'tr', function () { - //dump("select activity\n"); - if ( $(this).hasClass('selected') ) { - // $(this).removeClass('selected'); - } - else { - $("#btnedit").hide(); - $("#btnprotection").hide(); - $("#btndelete").hide(); - tbllog.$('tr.selected').removeClass('selected'); - $(this).addClass('selected'); - var curmessage = $(this).attr('data-message'); - //setforeigneditor($(this).attr('data-editor')); - pconfig.messageuuid = curmessage; - var cilogsql = "SELECT editor FROM messagelog where uuid='"+ pconfig.messageuuid+"';"; - var cdata = appdb.dbquery(cilogsql); - if (cdata.sqldata[0].editor == '' || cdata.sqldata[0].editor == myhostname){ - $("#btnedit").show(); - $("#btndelete").show(); - } - if (cdata.sqldata[0].editor != '' && cdata.sqldata[0].editor != myhostname){ - $("#btnprotection").show(); - } - apppref.setpreference("pageconfig.logcominterne",pconfig); - load_messagelog(); - } - } ); -} - -function newlogmessage(){ - var nuuid = appdb.generate_uuid(); - var sql = "INSERT INTO messagelog (uuid,logtitle,logdate) VALUES ('"+nuuid+"','nouveau message',date('"+xcurdate.toISOString().substring(0,10)+"'));"; - //dump(sql + "\n"); - appdb.dbexec(sql); - pconfig.messageuuid=nuuid; - apppref.setpreference("pageconfig.logcominterne",pconfig); - edit_cominternelog(); -} - -function edit_cominternelog(){ - var actlogsql = "SELECT uuid, strftime('%d.%m.%Y',logdate) as logdate, logtitle, logmessage,editor FROM messagelog where uuid='"+ pconfig.messageuuid+"';"; - var adata = appdb.dbquery(actlogsql); - //dump("EDIT: " + JSON.stringify(chdata) + "\n"); - if ((adata.sqldata[0].editor != '') && (adata.sqldata[0].editor != myhostname)){ - system.popup("cette communication est bloqué par l'editeur: " + adata.sqldata[0].editor); - load_logmessage_table(); - return; - } - seteditorhost(); - if (adata.sqldata.length > 0){ - $('#frmeditcominterne #loguuid').val(adata.sqldata[0].uuid); - $("#frmeditcominterne #logtitle").val(adata.sqldata[0].logtitle); - $("#frmeditcominterne #logdate").val(adata.sqldata[0].logdate); - $("#frmeditcominterne #logmessage").summernote('reset'); - $("#frmeditcominterne #logmessage").summernote('code',htmlUnescape(adata.sqldata[0].logmessage)); - } - $("#edit_cominternelog").modal('show'); -} - -function load_messagelog(){ - $("#btnedit").hide(); - $("#btnprotection").hide(); - $("#btndelete").hide(); - var actlogsql = "SELECT uuid, strftime('%d.%m.%Y',logdate) as logdate, logtitle, logmessage,editor FROM messagelog where uuid='"+ pconfig.messageuuid+"';"; - var adata = appdb.dbquery(actlogsql); - //dump(childlogsql + " -> " +JSON.stringify(chdata) + "\n"); - var inftitle = ""; - if (adata.sqldata.length > 0){ - //dump("load data from db\n"); - $("#cominterneloguuid").val(adata.sqldata[0].uuid); - $("#cominternelogmessage").html(htmlUnescape(adata.sqldata[0].logmessage)); - $("#cominternelogtitle").html(adata.sqldata[0].logtitle); - $("#cominternelogdate").html(adata.sqldata[0].logdate); - if (adata.sqldata[0].editor == '' || adata.sqldata[0].editor == myhostname){ - $("#btnedit").show(); - $("#btndelete").show(); - } - if (adata.sqldata[0].editor != '' && adata.sqldata[0].editor != myhostname){ - $("#btnprotection").show(); - } - inftitle=adata.sqldata[0].logtitle; - }else { - //dump("set data to empty fields\n"); - $("#cominterneloguuid").val('0'); - $("#cominternelogmessage").html(""); - $("#cominternelogtitle").html(""); - $("#cominternelogdate").html(""); - - } - - set_infoheader(inftitle + " Mois: " + amonth[parseInt(pconfig.logmonth.substring(0, 3))] + " " + pconfig.logmonth.substring(3, 8)); - -} - -function save_cominternelog(){ - var ld = encodeparam($("#frmeditcominterne #logdate").val(),"date"); - $("#cominterneloguuid").val($("#frmeditcominterne #loguuid").val()); - //var tmpdate = encodeparam(pconfig.logdate, 'date').replace(/'/g, ''); - var lsql = "UPDATE messagelog set logtitle="+encodeparam($('#frmeditcominterne #logtitle').val(),"text")+ - ",logmessage="+encodeparam($('#frmeditcominterne #logmessage').val(),"richtextarea")+ - ",logdate=date("+ld+") where uuid='"+$("#frmeditcominterne #loguuid").val()+"';"; - //dump("SV cominterne: "+ lsql + "\n"); - appdb.dbexec(lsql); - removeeditorhost(); - $("#edit_cominternelog").modal('hide'); - //load_logmessage_table(); - load_messagelog(); - -} - -function confirm_delete_cominterne() { - - deluuid = $("#cominterneloguuid").val(); - $('#confirm_delete_logcominterne').modal('show'); -} - -function delete_logcominterne() { - appdb.dbexec("delete from messagelog where uuid='"+ deluuid+"';"); - load_logmessage_table(); - $('#confirm_delete_logcominterne').modal('hide'); -} - -function onnextmonth() { - var tmpmonth = new Date(encodeparam(pconfig.logmonth, 'month').replace(/'/g, '')); - var nmonth = new Date(tmpmonth.getFullYear(), tmpmonth.getMonth() + 1, tmpmonth.getDate()); - pconfig.logmonth = nmonth.toLocaleFormat('%m.%Y'); - apppref.setpreference("pageconfig.logcominterne", pconfig); - removeeditorhost(); - //dump("Next Month:" +JSON.stringify(pconfig) + "\n"); - globelreq.send_request({ - page: 'logcominterne', - module: 'logbook', - header: 'Communication interne' - }, null); -} - -function onpreviousmonth() { - var tmpmonth = new Date(encodeparam(pconfig.logmonth, 'month').replace(/'/g, '')); - var nmonth = new Date(tmpmonth.getFullYear(), tmpmonth.getMonth() - 1, tmpmonth.getDate()); - pconfig.logmonth = nmonth.toLocaleFormat('%m.%Y'); - apppref.setpreference("pageconfig.logcominterne", pconfig); - removeeditorhost(); - //dump("previous Month:" +JSON.stringify(pconfig) + "\n"); - globelreq.send_request({ - page: 'logcominterne', - module: 'logbook', - header: 'Communication interne' - }, null); -} - -function set_logmonth(){ - pconfig.logmonth =$("#logmonth").val(); - apppref.setpreference("pageconfig.logcominterne",pconfig); - removeeditorhost(); - //dump("Set Month:" +JSON.stringify(pconfig) + "\n"); - globelreq.send_request({ - page: 'logcominterne', - module: 'logbook', - header: 'Communication interne' - }); -} - -function confirm_delete_protection(){ - $("#confirm_delete_protection").modal('show'); -} - -function delete_protection(){ - //dump("DELPROT: UPDATE messagelog set editor=null where uuid='"+$('#loguuid').val()+"';\n"); - appdb.dbexec("UPDATE messagelog set editor=null where uuid='"+$('#cominterneloguuid').val()+"';"); - $('#editorhost').html(''); - $('#btneditorhost').removeClass('btn-danger'); - $('#btneditorhost').addClass('btn-default'); - $('#btnprotection').hide(); - load_logmessage_table(); - $("#confirm_delete_protection").modal('hide'); -} \ No newline at end of file diff --git a/TODO/modules_todo/logbook/js/logcominterne_basic.js b/TODO/modules_todo/logbook/js/logcominterne_basic.js deleted file mode 100644 index c2526ff..0000000 --- a/TODO/modules_todo/logbook/js/logcominterne_basic.js +++ /dev/null @@ -1,296 +0,0 @@ -//Source-code licensed under EUPL v1.2 ( Copyright 2019 By DKS s.à r.l. - Kilian Saffran - Luxembourg ) -var pconfig = {}; -var winh= window.innerHeight -170; -var tbllog = null; -var crecheuuid = null; -var initdate = new Date(); -var xcurdate = new Date(); -var deluuid = ""; -var amonth = ['', 'Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Aôut', 'Septembre', 'Octobre','Novembre', 'Décembre']; -var myhostname = system.hostname(); - -function initdata(){ - - load_helpers(); - var configdata = apppref.getpreference("pageconfig.logcominterne"); - //dump("cfdata:" + configdata +"\n"); - if ((configdata) && (configdata !== '')){ - pconfig = JSON.parse(configdata); - } - - pconfig.printlayout = 'book'; - apppref.setpreference("pageconfig.logcominterne",pconfig); - - var ccreche = appdb.dbquery("select uuid from creche LIMIT 1;"); - crecheuuid = ccreche.sqldata[0].uuid; - var edith = 270; - myhostname = system.hostname(); - //dump("Current Hostname:" + myhostname + "\n"); - loadtextareas(edith); - if (pconfig.logmonth) { - - initdate = new Date(encodeparam(pconfig.logmonth, 'month').replace(/'/g, '')); - $("#logmonth").val(pconfig.logmonth); - } else { - $("#logmonth").val(initdate.toLocaleFormat('%m.%Y')); - - pconfig.logmonth=initdate.toLocaleFormat("%m.%Y"); - apppref.setpreference("pageconfig.logcominterne",pconfig); - } - var acttitle = ""; - if (pconfig.activityuuid){ - var chdata = appdb.dbquery("select logtitle from messagelog where uuid='"+ pconfig.messageuuid +"'"); - if (chdata.sqldata.length > 0){ - acttitle = chdata.sqldata[0].logtitle + " - "; - } - } - if (xcurdate.toLocaleFormat("%m.%Y") == pconfig.logmonth){ - $('#btnaddmessage').show(); - } else{ - $('#btnaddmessage').hide(); - } - set_infoheader(acttitle + " Mois: " + amonth[parseInt(pconfig.logmonth.substring(0, 3))] + " " + pconfig.logmonth.substring(3, 8)); - $('#logmonth').on('dp.hide', function(e) { - set_logmonth(); - }); - $("#btnedit").hide(); - load_logmessage_table(); - -} - -function seteditorhost(){ - //dump('BLOCK editor '+ myhostname +"->"+ $('#loguuid').val() +"\n"); - appdb.dbexec("UPDATE messagelog set editor=null where editor='"+myhostname+"';"); - appdb.dbexec("UPDATE messagelog set editor='"+myhostname+"' where uuid='"+$('#loguuid').val()+"';"); - load_logmessage_table(); -} - -function removeeditorhost(){ - appdb.dbexec("UPDATE messagelog set editor=null where editor='"+myhostname+"';"); - load_logmessage_table(); -} - - -function load_logmessage_table(){ - var mins = initdate.getTimezoneOffset() * -1;//dump("cur timezoneoffset:" + + "\n"); - if (mins > 0){ - mins = '+' + mins; - } - var logsql = "SELECT uuid, logtitle,'' || logdate || '' || strftime('%d.%m.%Y',logdate) as logdate,'' || lastmodified || '' || strftime('%d.%m.%Y %H:%M',lastmodified,'"+mins+" minutes') as lastmodified,editor FROM messagelog where date(logdate) between date('"+initdate.toLocaleFormat("%Y-%m")+"-01') and date('"+initdate.toLocaleFormat("%Y-%m")+"-01','+1 month','-1 day');"; - var logdata = appdb.dbquery(logsql); - var headerdata = getlabels("subject,daydate,lastmodified,editor"); - $("#tbl_logcominterne").html(""); - //tbllog = null; - var tblheader = ''; - - for (var h in headerdata){ - if ((headerdata[h].keyname == 'act') && (headerdata[h].class.indexOf('action1btn') == -1)){ - headerdata[h].class +=" action1btn"; - } - - tblheader += ''+ headerdata[h].title+''; - - } - tblheader += ''; - - - $("#tbl_logcominterne").append("" + tblheader + ""); - $("#tbl_logcominterne").append("" + tblheader + ""); - $("#tbl_logcominterne").append(""); - - - for (var i in logdata.sqldata){ - var sel = ""; - var row = logdata.sqldata[i]; - if (pconfig.messageuuid && row.uuid == pconfig.messageuuid) { - sel = "selected"; - load_messagelog(); - } - - var tr = '' + row.logtitle + ''+ - '' + row.logdate + ''+ - ''+ row.lastmodified+''+ - ''+ row.editor +''+ - ''; - - $("#tbl_logcominterne").append(tr); - } - - $("#tbl_logcominterne").append(""); - - - tbllog = $("#tbl_logcominterne").dataTable({ - "language": { - "url": "../../js/locale/datatable_fr.json" - }, - "paging": false, - "ordering": true, - "bAutoWidth": false, - "scrollY": winh + "px", - "scrollCollapse": true, - "info": false, - "filter": false, - "destroy": true, - }); - - - - $('#tbl_logcominterne').on( 'order.dt', function () { - pconfig.order= tbllog.fnSettings().aaSorting; - apppref.setpreference("pageconfig.logcominterne",pconfig); - - } ); - - if (pconfig.order) { - - tbllog.fnSort(pconfig.order); - } - - - -$('#tbl_logcominterne tbody').on( 'click', 'tr', function () { - //dump("select activity\n"); - if ( $(this).hasClass('selected') ) { - // $(this).removeClass('selected'); - } - else { - $("#btnedit").hide(); - tbllog.$('tr.selected').removeClass('selected'); - $(this).addClass('selected'); - var curmessage = $(this).attr('data-message'); - //setforeigneditor($(this).attr('data-editor')); - pconfig.messageuuid = curmessage; - var cilogsql = "SELECT editor FROM messagelog where uuid='"+ pconfig.messageuuid+"';"; - var cdata = appdb.dbquery(cilogsql); - if (cdata.sqldata[0].editor == '' || cdata.sqldata[0].editor == myhostname){ - $("#btnedit").show(); - - } - - apppref.setpreference("pageconfig.logcominterne",pconfig); - load_messagelog(); - } - } ); -} - -function newlogmessage(){ - var nuuid = appdb.generate_uuid(); - var sql = "INSERT INTO messagelog (uuid,logtitle,logdate) VALUES ('"+nuuid+"','nouveau message',date('"+xcurdate.toISOString().substring(0,10)+"'));"; - //dump(sql + "\n"); - appdb.dbexec(sql); - pconfig.messageuuid=nuuid; - apppref.setpreference("pageconfig.logcominterne",pconfig); - edit_cominternelog(); -} - -function edit_cominternelog(){ - var actlogsql = "SELECT uuid, strftime('%d.%m.%Y',logdate) as logdate, logtitle, logmessage,editor FROM messagelog where uuid='"+ pconfig.messageuuid+"';"; - var adata = appdb.dbquery(actlogsql); - if ((adata.sqldata[0].editor != '') && (adata.sqldata[0].editor != myhostname)){ - system.popup("cette communication est bloqué par l'editeur: " + adata.sqldata[0].editor); - load_logmessage_table(); - return; - } - //dump("EDIT: " + JSON.stringify(chdata) + "\n"); - seteditorhost(); - if (adata.sqldata.length > 0){ - $('#frmeditcominterne #loguuid').val(adata.sqldata[0].uuid); - $("#frmeditcominterne #logtitle").val(adata.sqldata[0].logtitle); - $("#frmeditcominterne #logdate").val(adata.sqldata[0].logdate); - $("#frmeditcominterne #logmessage").summernote('reset'); - $("#frmeditcominterne #logmessage").summernote('code',htmlUnescape(adata.sqldata[0].logmessage)); - } - $("#edit_cominternelog").modal('show'); -} - -function load_messagelog(){ - $("#btnedit").hide(); - $("#btnprotection").hide(); - $("#btndelete").hide(); - var actlogsql = "SELECT uuid, strftime('%d.%m.%Y',logdate) as logdate, logtitle, logmessage,editor FROM messagelog where uuid='"+ pconfig.messageuuid+"';"; - var adata = appdb.dbquery(actlogsql); - //dump(childlogsql + " -> " +JSON.stringify(chdata) + "\n"); - var inftitle = ""; - if (adata.sqldata.length > 0){ - //dump("load data from db\n"); - $("#cominterneloguuid").val(adata.sqldata[0].uuid); - $("#cominternelogmessage").html(htmlUnescape(adata.sqldata[0].logmessage)); - $("#cominternelogtitle").html(adata.sqldata[0].logtitle); - $("#cominternelogdate").html(adata.sqldata[0].logdate); - if (adata.sqldata[0].editor == '' || adata.sqldata[0].editor == myhostname){ - $("#btnedit").show(); - $("#btndelete").show(); - } - if (adata.sqldata[0].editor != '' && adata.sqldata[0].editor != myhostname){ - $("#btnprotection").show(); - } - inftitle=adata.sqldata[0].logtitle; - }else { - //dump("set data to empty fields\n"); - $("#cominterneloguuid").val('0'); - $("#cominternelogmessage").html(""); - $("#cominternelogtitle").html(""); - $("#cominternelogdate").html(""); - - } - - set_infoheader(inftitle + " Mois: " + amonth[parseInt(pconfig.logmonth.substring(0, 3))] + " " + pconfig.logmonth.substring(3, 8)); - -} - -function save_cominternelog(){ - var ld = encodeparam($("#frmeditcominterne #logdate").val(),"date"); - $("#cominterneloguuid").val($("#frmeditcominterne #loguuid").val()); - //var tmpdate = encodeparam(pconfig.logdate, 'date').replace(/'/g, ''); - var lsql = "UPDATE messagelog set logtitle="+encodeparam($('#frmeditcominterne #logtitle').val(),"text")+ - ",logmessage="+encodeparam($('#frmeditcominterne #logmessage').val(),"richtextarea")+ - ",logdate=date("+ld+") where uuid='"+$("#frmeditcominterne #loguuid").val()+"';"; - //dump("SV cominterne: "+ lsql + "\n"); - appdb.dbexec(lsql); - removeeditorhost(); - $("#edit_cominternelog").modal('hide'); - //load_logmessage_table(); - load_messagelog(); - -} - -function onnextmonth() { - var tmpmonth = new Date(encodeparam(pconfig.logmonth, 'month').replace(/'/g, '')); - var nmonth = new Date(tmpmonth.getFullYear(), tmpmonth.getMonth() + 1, tmpmonth.getDate()); - pconfig.logmonth = nmonth.toLocaleFormat('%m.%Y'); - apppref.setpreference("pageconfig.logcominterne", pconfig); - removeeditorhost(); - //dump("Next Month:" +JSON.stringify(pconfig) + "\n"); - globelreq.send_request({ - page: 'logcominterne_basic', - module: 'logbook', - header: 'Communication interne' - }, null); -} - -function onpreviousmonth() { - var tmpmonth = new Date(encodeparam(pconfig.logmonth, 'month').replace(/'/g, '')); - var nmonth = new Date(tmpmonth.getFullYear(), tmpmonth.getMonth() - 1, tmpmonth.getDate()); - pconfig.logmonth = nmonth.toLocaleFormat('%m.%Y'); - apppref.setpreference("pageconfig.logcominterne", pconfig); - removeeditorhost(); - //dump("previous Month:" +JSON.stringify(pconfig) + "\n"); - globelreq.send_request({ - page: 'logcominterne_basic', - module: 'logbook', - header: 'Communication interne' - }, null); -} - -function set_logmonth(){ - pconfig.logmonth =$("#logmonth").val(); - apppref.setpreference("pageconfig.logcominterne",pconfig); - removeeditorhost(); - //dump("Set Month:" +JSON.stringify(pconfig) + "\n"); - globelreq.send_request({ - page: 'logcominterne_basic', - module: 'logbook', - header: 'Communication interne' - }); -} - diff --git a/TODO/modules_todo/logbook/js/logstaff.js b/TODO/modules_todo/logbook/js/logstaff.js deleted file mode 100644 index 54d0800..0000000 --- a/TODO/modules_todo/logbook/js/logstaff.js +++ /dev/null @@ -1 +0,0 @@ -//Source-code licensed under EUPL v1.2 ( Copyright 2019 By DKS s.à r.l. - Kilian Saffran - Luxembourg ) \ No newline at end of file diff --git a/TODO/modules_todo/logbook/logactivity.html b/TODO/modules_todo/logbook/logactivity.html deleted file mode 100644 index 41921ea..0000000 --- a/TODO/modules_todo/logbook/logactivity.html +++ /dev/null @@ -1,161 +0,0 @@ - - - - - - Livret des activités - - - - - - - - - - - - - - - - -
-
-
- du mois: - - -
- - - - -
-
- - - - - - - -
-
- - - -
- - -
Titre:
-
Date: au
- -
-
- - - -
- - - - - - - - - - - - - - - - - - - - - diff --git a/TODO/modules_todo/logbook/logactivity_basic.html b/TODO/modules_todo/logbook/logactivity_basic.html deleted file mode 100644 index dd519d0..0000000 --- a/TODO/modules_todo/logbook/logactivity_basic.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - Livret des activités - - - - - - - - - - - - - - - - -
-
-
- du mois: - - -
- - - - -
-
- - - - - - - -
-
- -
- - -
Titre:
-
Date début: au
- -
-
- - -
- - - - - - - - - - - - - - - - - - - - - - diff --git a/TODO/modules_todo/logbook/logbook.xul b/TODO/modules_todo/logbook/logbook.xul deleted file mode 100644 index 559a5b5..0000000 --- a/TODO/modules_todo/logbook/logbook.xul +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/TODO/modules_todo/logbook/logbook_basic.xul b/TODO/modules_todo/logbook/logbook_basic.xul deleted file mode 100644 index 802382e..0000000 --- a/TODO/modules_todo/logbook/logbook_basic.xul +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/TODO/modules_todo/logbook/logchild.html b/TODO/modules_todo/logbook/logchild.html deleted file mode 100644 index cc093e6..0000000 --- a/TODO/modules_todo/logbook/logchild.html +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - Livret d'évaluation des enfants - - - - - - - - - - - - - - - -
-
-
- date du: - - -
- - - -
-
- - - - - - - -
- -
- - - -
-
-
- -
- - -
- - - - - - - - - - - - - - - - - - - - - diff --git a/TODO/modules_todo/logbook/logcominterne.html b/TODO/modules_todo/logbook/logcominterne.html deleted file mode 100644 index 475cb78..0000000 --- a/TODO/modules_todo/logbook/logcominterne.html +++ /dev/null @@ -1,161 +0,0 @@ - - - - - - Communication interne - - - - - - - - - - - - - - - - -
-
-
- du mois: - - -
- - - - -
-
- - - - - - - -
-
- - - -
- -
Titre:
-
Date:
- -
- -
-
- - - -
- - - - - - - - - - - - - - - - - - - - - diff --git a/TODO/modules_todo/logbook/logcominterne_basic.html b/TODO/modules_todo/logbook/logcominterne_basic.html deleted file mode 100644 index a308381..0000000 --- a/TODO/modules_todo/logbook/logcominterne_basic.html +++ /dev/null @@ -1,159 +0,0 @@ - - - - - - Communication interne - - - - - - - - - - - - - - - - -
-
-
- du mois: - - -
- - - - -
-
- - - - - - - -
-
- -
- -
Titre:
-
Date:
- -
- -
-
- - - -
- - - - - - - - - - - - - - - - - - - - - diff --git a/TODO/modules_todo/logbook/logstaff.html b/TODO/modules_todo/logbook/logstaff.html deleted file mode 100644 index e69de29..0000000 diff --git a/TODO/modules_todo/monthly/accounting.html b/TODO/modules_todo/monthly/accounting.html deleted file mode 100644 index 5e0e6c7..0000000 --- a/TODO/modules_todo/monthly/accounting.html +++ /dev/null @@ -1,201 +0,0 @@ - - - - - - - Décompte - - - - - - - - - - - - - - - -
-
-
- du mois: - - -
- - - - - - - -
-
- - - - - - - - - - - - - - - -
No. ClientNo. Check ServiceEnfantRéférencefacturé €payé €prestation €
-
-
- - - - - - - - - - - - - - - - - - - - - - diff --git a/TODO/modules_todo/monthly/js/accounting.js b/TODO/modules_todo/monthly/js/accounting.js deleted file mode 100644 index f5eb071..0000000 --- a/TODO/modules_todo/monthly/js/accounting.js +++ /dev/null @@ -1,433 +0,0 @@ -//Source-code licensed under EUPL v1.2 ( Copyright 2019 By DKS s.à r.l. - Kilian Saffran - Luxembourg ) - -var pconfig = {}; -var cdate = null; -var initdate = new Date(); -initdate.setDate(1); -var winh= window.innerHeight -50; -//var tblacc = null; -var curchilduuid = ''; -var crecheuuid = null; -var ccreche = null -var importpath = null; -var cweeks = new Array(); -var delacc = {}; -var numchilds = 0; -var strminweek = null; -var monthmin = null; -var monthmax = null; -var mpdffile = null; -var aax = ['mon','tue','wed','thu','fri','sat']; -//var lictype = apppref.getpreference("support.lictype"); -var amonth = ['','Janvier','Février','Mars','Avril','Mai','Juin','Juillet','Aôut','Septembre','Octobre','Novembre','Décembre']; -function initdata(){ - curcfg.loadconfig(apppref.getpreference("support.database.currentdb.num")); - check_accountingtable(); - load_helpers(); - - var configdata = apppref.getpreference("pageconfig.accounting"); - - if (configdata != '') { - pconfig = JSON.parse(configdata); - } - - if (!pconfig.printlayout) { - pconfig.printlayout = 'list'; - apppref.setpreference("pageconfig.accounting",pconfig); - } - ccreche = appdb.dbquery("select uuid,idcheckservice from creche LIMIT 1;"); - crecheuuid = ccreche.sqldata[0].uuid; - importpath = FileUtils.File(curcfg.path.local + system.sep() +"imports" + system.sep() + crecheuuid); - - if (pconfig.accmonth) { - - initdate = new Date(encodeparam(pconfig.accmonth, 'month').replace(/'/g, '')); - $("#accmonth").val(pconfig.accmonth); - }else { - $("#accmonth").val(initdate.toLocaleFormat('%m.%Y')); - pconfig.accmonth=initdate.toLocaleFormat('%m.%Y'); - } - cdate = initdate.toISOString().substring(0,10); - var cmonth = initdate.getMonth() +1; - mpdffile = system.getDirectory(appdb.dbFile.path) + system.sep() + 'imports' + system.sep() + crecheuuid +system.sep() + initdate.getFullYear() + "." + cmonth + ".pdf"; - if (system.fileexists(mpdffile)){ - $("#monthlypdf").show(); - } - - set_infoheader(amonth[parseInt(pconfig.accmonth.substring(0,2))] + " " + pconfig.accmonth.substring(3,8)); - load_accounting_table(); - var bfile = appdb.dbquery("select benefitfile from accounting where accmonth = date('"+pconfig.accmonth+"') group by benefitfile LIMIT 1;"); - if (bfile.sqldata.length == 1) { - $('#mnuacc').append(""); - } - $("#accmonth").on("dp.hide", function (e) { - set_accmonth(); - }); - -} - -function load_accounting_table(){ - - //var accyear = pconfig.accmonth.substring(3,7); - - - - var accsql = "select acc.childuuid,ch.clientnumber,ch.checkservicenumber,ch.prename || ' ' || ch.surname as childname, " + - "coalesce(printf(\"%.2f €\",acc.invoiceamount), 0.00) || coalesce (strftime('
%d.%m.%Y', acc.invoicedate), '') || coalesce(', R1: ' || strftime('%d.%m.%Y', acc.reminderdate1),'') || coalesce(', R2: ' || strftime('%d.%m.%Y', acc.reminderdate2),'') || coalesce(', R3: ' || strftime('%d.%m.%Y', acc.reminderdate3),'') as invoiced," + - "acc.reference, coalesce(printf(\"%.2f €\", acc.payedamount), 0.00) || coalesce (strftime('
%d.%m.%Y', acc.payeddate), '') as payement, coalesce(printf(\"%.2f €\", acc.benefitamount), 0.00) as benefitamount," + - "'' || CASE WHEN acc.invoicefile IS NOT NULL and acc.invoicefile != '' THEN '' ELSE '' END AS act from accounting acc join childs ch on (acc.childuuid = ch.uuid) where acc.invoicedate between date('" + initdate.toISOString().substring(0,10)+ "') and date('" + initdate.toISOString().substring(0,10)+ "','+1 month','-1 day');"; - - //jsdump("ACCMONTH " + accsql); - var accdata = appdb.dbquery(accsql); - //jsdump(accdata); - //numchilds = accdata.sqldata.length; - var headerdata = []; - headerdata = getlabelswithkey("clientnumber,checkservicenumber,childname,reference,invoiced,payement,benefitamount,act"); - //monthtotalhourcosts,monthtotallunchcosts,monthtotalcosts, - $("#tbl_accounting > tbody").html(""); - //var hrow = []; - //hrow = headerdata; - //var tdclass= new Array(); - // var tblheader = ''; - // //dump("Headerdata:" + JSON.stringify(headerdata) + "\n") - // for (var h in headerdata){ - // if ((headerdata[h].keyname == 'act') && (headerdata[h].class.indexOf('action1btn') == -1)){ - // headerdata[h].class +=" action1btn"; - // } - // //if ((pconfig.hidden_columns) && (pconfig.hidden_columns.indexOf(headerdata[h].keyname) != -1)) { - // // if (headerdata[h].class.indexOf('colhidden') == -1) { - // // headerdata[h].class += " colhidden"; - // // } - // //}else { - // headerdata[h].class.replace("colhidden",""); - // //} - // tblheader += ''+ headerdata[h].title+''; - - // } - // tblheader += ''; - // //tblh0 += ''; - // tblacc = null; - //jsdump("\n\nTBL header: " + tblheader + "\n\n\n"); - // $("#tbl_accounting > thead").append(tblheader); - - - //$("#tbl_accounting").append(""); - - var curchld = ""; - - - for (var i in accdata.sqldata){ - var row = accdata.sqldata[i]; - - var tr = ''; - tr += '' + row.clientnumber + ''; - tr += '' + row.checkservicenumber + ''; - tr += '' + row.childname + ''; - tr += '' + row.reference + ''; - tr += '' + row.invoiced + ''; - tr += '' + row.payement + ''; - tr += '' + row.benefitamount + ''; - tr += '' + row.act + ''; - $("#tbl_accounting > tbody").append(tr); - - } - - $("#tbl_accounting").bootstrapTable({ - locale: 'fr-FR', - pagination: false, - search: true, - height: winh, - toolbar: "#mnuacc" - }); - - -} - -function getdaterangesql(xmonthmin,xmonthmax){ - var adays = []; - - var bdate = new Date(xmonthmin); - var bend = new Date(xmonthmax); - for (var cdt = bdate; cdt <= bend; cdt.setDate(cdt.getDate() + 1)) { - if ((cdt.getDay() !== 0) ){ - adays.push("select date('" + cdt.toISOString().substring(0,10) + "') as daydate"); - } - - } - return adays.join(" UNION "); - } - - -function set_accmonth(){ - pconfig.accmonth = $('#accmonth').val(); - - apppref.setpreference("pageconfig.accounting",pconfig); - globelreq.send_request({ - page: 'accounting', - module: 'accounting', - data: null, - header: 'Décompte par mois' - }); -} - -function confirm_delete_accounting(duuid) { - delacc.uuid = duuid; - $('#confirm_delete_accounting').modal('show'); -} - -function delete_accounting() { - var xsql = "DELETE FROM accounting where uuid='"+ delacc.uuid+"';"; - - appdb.dbexec(xsql); - load_accounting_table(); - delacc ={}; - - $('#confirm_delete_accounting').modal('hide'); -} - -function dlg_accounting(myuuid){ - - //alert("TEST"); - var acc1sql = "SELECT acc.uuid,acc.accmonth,ch.uuid as childuuid,COALESCE( ch.prename, '' ) || ' ' || COALESCE( ch.surname, '' ) || '(' || ch.checkservicenumber || ')' AS childname,case when acc.invoicedate is not null then strftime('%d.%m.%Y',acc.invoicedate) else null end as invoicedate, case when acc.payeddate is not null then strftime('%d.%m.%Y',acc.payeddate) else null end as payeddate, payedamount, invoiceamount,benefitamount, case when acc.reminderdate1 is not null then strftime('%d.%m.%Y',acc.reminderdate1) else null end as reminderdate1, case when acc.reminderdate2 is not null then strftime('%d.%m.%Y',acc.reminderdate2) else null end as reminderdate2, case when acc.reminderdate3 is not null then strftime('%d.%m.%Y',acc.reminderdate3) else null end as reminderdate3, case when acc.invoicefile is not null and acc.invoicefile != '' then '"+ importpath.path + system.sep() +"' || acc.invoicefile else null end as invoicefile,'upd' as action FROM accounting acc join childs ch on (ch.uuid=acc.childuuid) where acc.uuid = '"+ myuuid+"';"; - - //jsdump("ACC1SQL" + acc1sql); - var acc1data = appdb.dbquery(acc1sql); - - if (!acc1data.sqldata) { - return false; - - } - acc1data = acc1data.sqldata[0]; - $("#frmeditaccounting #uuid").val(acc1data.uuid); - for (var a in acc1data){ - - if ($("#frmeditaccounting #" +a)) { - - $("#frmeditaccounting #"+a).val(acc1data[a]); - } - } - $("#edit_accounting").modal('show'); - -} - -function save_accounting(){ - - var sql2 = new Array(); - - $("#frmeditaccounting :input").each(function(){ - var input = $(this); - if (input.attr("id") ){ - - if ((input.attr("type") != 'hidden') && (input.attr("id") != 'childname')) { - if (input.attr("type") == "file") { - if (system.getDirectory(input.val()) != importpath.path) { - var newlocation= importpath.path + system.sep() + system.getFileName(input.val()); - OS.File.copy(input.val(), newlocation); - } - } - var ival = input.val(); - - - var ival = encodeparam(ival,input.attr('type')); - if (input.attr("id") == 'invoicedate'){ - var newaccmonth = ival.replace(/'/g,""); - sql2.push('"accmonth"=\'' + newaccmonth.substring(0,4) + "-" + newaccmonth.substring(5,7) +"-01'"); - } - sql2.push('"' + input.attr("id") +'"='+ ival); - - } - } - }); - var xsql = "UPDATE accounting SET "+sql2.join(',')+" where \"uuid\"='" + $("#frmeditaccounting #uuid").val() + "';"; - - - appdb.dbexec(xsql); - load_accounting_table(); - $("#frmeditaccounting #uuid").val("0"); - $("#edit_accounting").modal('hide'); -} - -function openfile(fi){ - var ddir = system.getDirectory(appdb.dbFile.path); - var ff = system.openFile(ddir + system.sep() + 'imports' + system.sep() + crecheuuid +system.sep() + fi); -} - -function onnextmonth() { - pconfig.accmonth = $('#accmonth').val(); - - - var tmpmonth = new Date(encodeparam(pconfig.accmonth, 'month').replace(/'/g, '')); - var nmonth = new Date(tmpmonth.getFullYear(), tmpmonth.getMonth() + 1, tmpmonth.getDate()); - pconfig.accmonth = nmonth.toLocaleFormat('%m.%Y'); - apppref.setpreference("pageconfig.accounting",pconfig); - globelreq.send_request({ - page: 'accounting', - module: 'accounting', - data: null, - header: 'Décompte par mois' - }); -} - -function onpreviousmonth() { - pconfig.accmonth = $('#accmonth').val(); - var tmpmonth = new Date(encodeparam(pconfig.accmonth, 'month').replace(/'/g, '')); - var nmonth = new Date(tmpmonth.getFullYear(), tmpmonth.getMonth() - 1, tmpmonth.getDate()); - pconfig.accmonth = nmonth.toLocaleFormat('%m.%Y'); - apppref.setpreference("pageconfig.accounting",pconfig); - globelreq.send_request({ - page: 'accounting', - module: 'accounting', - data: null, - header: 'Décompte par mois' - }); -} - -function generatecsv(){ - var lastdir = ''; - if (pconfig.lastdir){ - lastdir = pconfig.lastdir; - } - var expfolder = system.selectdirectory(lastdir,"Sélection dossier!"); - //dump("EXPFOLDER:" + expfolder); - if (!expfolder){ - return; - }else { - pconfig.lastdir = expfolder.path; - apppref.setpreference("pageconfig.accounting",pconfig); - } - var val = $("#accmonth").val(); - var cdate = new Date(); - var accsql = "select planned.childuuid,planned.checkservicenumber,planned.pcalweek,replace(printf(\"%.2f\",COALESCE(planned.weekplantime,0.00)),'.',',') as weekplantime,d1.calweek,replace(printf(\"%.2f\",COALESCE(d1.durationweek,0.00)),'.',',') as durationweek,COALESCE(d1.lunchweek,0) as lunchweek from ( " + - "select checkservicenumber || '-' || pcalweek as idjoin,childuuid,pcalweek, weekplantime,checkservicenumber from ("+ - "select pcalweek,childuuid,sum(monplantime) + sum(tueplantime) + sum(wedplantime) + sum(thuplantime) + sum(friplantime) as weekplantime,checkservicenumber from ("+ - "select strftime(\"%W\",dd.daydate) as pcalweek, dd.daydate, ch.uuid as childuuid, ch.checkservicenumber,"; - for (var d4 in aax){ - var dw4 = d4;dw4++; - accsql += "case when strftime(\"%w\",dd.daydate) = '"+ dw4+"' then cast( ( strftime( \"%s\", "+ aax[d4]+"timeend )- strftime( \"%s\", "+ aax[d4]+"timebegin ) )/ 3600.0 AS REAL )+ case when "+ aax[d4]+"timebegin2 is not null then CAST( ( strftime( \"%s\", "+ aax[d4]+"timeend2 )- strftime( \"%s\", "+ aax[d4]+"timebegin2 ) )/ 3600.0 AS REAL ) else 0.0 end else 0.00 end as "+ aax[d4]+"plantime,"; - } - accsql += " null as nouse from childs ch join planning pl on ( ch.uuid = pl.childuuid ) JOIN( " ; - accsql += getdaterangesql(monthmin,monthmax); - accsql += ") dd on ( dd.daydate BETWEEN pl.datebegin AND pl.dateend ) ) group by childuuid,pcalweek ) group by childuuid,pcalweek) planned "; - accsql += "left join ( " + - "select checkservicenumber || '-' || calweek as idjoin,checkservicenumber,childuuid, calweek , durationweek , lunchweek " + - " from (SELECT checkservicenumber,ttl.childuuid,calweek, sumdurationcalweek AS durationweek, sumlunchcalweek as lunchweek " + - - - "FROM ( SELECT pch.checkservicenumber, pch.childuuid, px.calweek, px.sumdurationcalweek, px.sumlunchcalweek " + - "FROM ( SELECT ch.uuid AS childuuid,ch.checkservicenumber " + - "FROM childs ch JOIN planning pl ON ( ch.uuid=pl.childuuid) " + - "WHERE " + - "(( pl.datebegin <= DATE('"+monthmin+"') AND pl.dateend >= DATE('"+monthmax+"')) OR pl.datebegin BETWEEN '"+monthmin+"' AND '"+monthmax+"' OR pl.dateend BETWEEN '"+monthmin+"' AND '"+monthmax+"')) pch " + - "LEFT JOIN ( "+ - "SELECT childuuid,calweek,case when strftime('%w',date(calyear ||'-01-01')) in ('1','2','3','4') then (cast(calweek as int)*7)-7 else (cast(calweek as int)*7) end as caldays ,"+ - "sumlunchcalweek, coalesce(sum(monduration + tueduration + wedduration + thuduration + friduration),0.0) as sumdurationcalweek " + - "FROM ( SELECT childuuid, daydate,calyear, case when strftime('%w',date(calyear ||'-01-01')) in ('1','2','3','4') then case when calweek < '10' then '0' else '' end || cast(calweek as int) else calweek end as calweek," + - "max(monlunch) + max(tuelunch) + max(wedlunch) + max(thulunch) + max(frilunch) AS sumlunchcalweek, " + - "MAX(monduration) + MAX(monduration2) AS monduration, " + - "MAX(tueduration) + MAX(tueduration2) AS tueduration, " + - "MAX(wedduration) + MAX(wedduration2) AS wedduration, " + - "MAX(thuduration) + MAX(thuduration2) AS thuduration, " + - "MAX(friduration) + MAX(friduration2) AS friduration " + - "FROM ( "+ - "SELECT childuuid, daydate, strftime('%Y',daydate) as calyear," + - "case when strftime('%w',daydate)='0' then strftime('%W',date(daydate,'-6 days')) else strftime('%W',date(date(daydate),'-' || strftime('%w',date(daydate)) || ' days','+1 day')) end as calweek, "; - - for (var d1 in aax){ - var dw = d1;dw++; - accsql += "CASE WHEN lunch=1 AND status IN (1,5) AND strftime('%w',daydate) = '"+dw+"' THEN 1 ELSE 0 END AS "+aax[d1]+"lunch,"; - } - - for (var d2 in aax){ - var dw2 = d2;dw2++; - accsql += "CASE WHEN xx.status IS NOT NULL AND strftime('%w',xx.daydate) = '"+dw2+"' AND xx.daydate BETWEEN xx.datebegin AND xx.dateend THEN CAST(( (( CAST(SUBSTR(xx."+ aax[d2]+"timeend,1,2) AS INT) *3600)+( CAST(SUBSTR(xx."+ aax[d2]+"timeend,4,2) AS INT) *60))- ((CAST(SUBSTR(xx."+ aax[d2]+"timebegin,1,2) AS INT) *3600)+( CAST(SUBSTR(xx."+ aax[d2]+"timebegin,4,2) AS INT) *60)) ) / 3600 AS REAL) ELSE 0.0 END AS "+ aax[d2]+"duration,"; - } - - - for (var d3 in aax){ - var dw3 = d3;dw3++; - accsql += "CASE WHEN xx.status IS NOT NULL AND strftime('%w',xx.daydate) = '1' AND xx.daydate BETWEEN xx.datebegin AND xx.dateend AND xx."+ aax[d3]+"timebegin2 IS NOT NULL AND xx."+ aax[d3]+"timeend2 IS NOT NULL THEN CAST(( (( CAST(SUBSTR(xx."+ aax[d3]+"timeend2,1,2) AS INT) *3600)+( CAST(SUBSTR(xx."+ aax[d3]+"timeend2,4,2) AS INT) *60))- ((CAST(SUBSTR(xx."+ aax[d3]+"timebegin2,1,2) AS INT) *3600)+( CAST(SUBSTR(xx."+ aax[d3]+"timebegin2,4,2) AS INT) *60)) ) / 3600 AS REAL) ELSE 0.0 END AS "+ aax[d3]+"duration2,"; - } - - accsql += "null as nouse FROM (" + - " select vacancydate as daydate, CAST('0' as boolean) as lunch,1 as status,pl.* from vacancy va " + - " left join planning pl on (va.vacancydate between pl.datebegin and pl.dateend) " + - " where va.vacancydateto is null and va.vacancydate BETWEEN '"+monthmin+"' AND '"+monthmax+"' AND strftime('%w',va.vacancydate) not in ('0','6') " + - " group by va.vacancydate,pl.childuuid " + - " union " + - " select pr.daydate,pr.lunch,pr.status,pl.* FROM presence pr " + - " JOIN planning pl ON ( pr.childuuid=pl.childuuid) WHERE pr.daydate BETWEEN '"+monthmin+"' AND '"+monthmax+"' "+ - ") xx " + - "WHERE xx.daydate BETWEEN '"+monthmin+"' AND '"+monthmax+"') GROUP BY childuuid,calweek) GROUP BY childuuid,calweek) px " + - "ON ( pch.childuuid=px.childuuid) GROUP BY pch.childuuid,px.calweek ) ttl " + - "LEFT JOIN accounting acc ON ( ttl.childuuid = acc.childuuid AND acc.accmonth='"+ initdate.toISOString().substring(0,10)+ "') where calweek is not null) group by childuuid,calweek) d1 "; - accsql += " on (d1.idjoin=planned.idjoin) order by planned.childuuid,planned.pcalweek;"; - - dump("EXPSQL:" + accsql + "\n"); - - var expdbdata = appdb.dbquery(accsql); - - numchilds = $("#tbl_accounting tbody tr").length -1; - var idchkserv = ccreche.sqldata[0].idcheckservice; - dump(JSON.stringify(cweeks) + "\n"); - var wlen = cweeks.length; - var expdata = "E;"+ val.substring(3,7) + ";" + parseInt(val.substring(0,2)) + ";" + wlen + ";" + numchilds + ";" + cdate.toLocaleFormat('%d%m%Y') + ";;;;;;;;;;;;\r\n"; - - var minweek = cweeks[0].cw; - var expchild = ""; - var cntweek = 0; - var objrow = {}; - var allobjects = [] - for (var r in expdbdata.sqldata){ - var row = expdbdata.sqldata[r]; - if (expchild != row.childuuid){ - if (expchild != ""){ - allobjects.push(objrow); - - } - objrow = new Object(); - objrow["cs"] = row.checkservicenumber; - objrow["weeks"] = {}; - for (var w in cweeks){ - objrow["weeks"][cweeks[w].cw] = {"time":"0,00","lunch":"0"}; - } - expchild = row.childuuid; - - } - - objrow["weeks"][row.pcalweek]["time"] = ((row.durationweek == '' || row.weekplantime > row.durationweek)?row.weekplantime:row.durationweek); - objrow["weeks"][row.pcalweek]["lunch"] = ((row.lunchweek == '')?0:row.lunchweek); - - } - for (var o in allobjects){ - var obj = allobjects[o]; - expdata += "P;" + idchkserv + ";"+ obj.cs + ";"; - for (var w in obj.weeks){ - expdata += obj.weeks[w].time + ";" + obj.weeks[w].lunch + ";"; - } - if (wlen == 3){ - expdata += "0,00;0;0,00;0;"; - } - if (wlen == 4){ - expdata += "0,00;0;"; - } - expdata += "0,00;;0,00;0,00;0,00\r\n"; - - } - - system.WriteTextFile(expdata,expfolder.path + system.sep() + val + "_export_checkservice.csv"); - -} - -function openmonthlypdf(){ - //dump("PDF to Open: " + mpdffile + "\n"); - var ff = system.openFile(mpdffile); -} - -function check_accountingtable(){ - var cols = appdb.dbquery("SELECT type, name,tbl_name,sql FROM sqlite_master where tbl_name='accounting';"); - if (cols.sqldata[0].sql.indexOf(" uuid TEXT") == -1){ - appdb.dbexec("ALTER TABLE accounting add column uuid TEXT;"); - } - appdb.dbexec("UPDATE accounting set uuid= hex(randomblob(4)) || '-' || hex(randomblob(2)) || '-' || hex(randomblob(2)) || '-' || hex(randomblob(2)) || '-' || hex(randomblob(6)) where uuid is null;"); -} - diff --git a/TODO/modules_todo/multisite/img/profile.png b/TODO/modules_todo/multisite/img/profile.png deleted file mode 100644 index d8caf3f..0000000 Binary files a/TODO/modules_todo/multisite/img/profile.png and /dev/null differ diff --git a/TODO/modules_todo/multisite/js/multisite_reader.js b/TODO/modules_todo/multisite/js/multisite_reader.js deleted file mode 100644 index 1c004c4..0000000 --- a/TODO/modules_todo/multisite/js/multisite_reader.js +++ /dev/null @@ -1,58 +0,0 @@ -//Source-code licensed under EUPL v1.2 ( Copyright 2019 By DKS s.à r.l. - Kilian Saffran - Luxembourg ) -var multisite_reader = { - - getsites: function(){ - var childnames = apppref.branch.getChildList("",{}); - var clmsel = document.getElementsByClassName("clmultisite"); - var cnum = apppref.getpreference("support.database.currentdb.num"); - var xx = document.getElementById("pop_multisites"); - while(xx.hasChildNodes()){ - xx.removeChild(xx.firstChild); - } - for (var i in childnames){ - if ((childnames[i].substring(0,16) == 'support.database') && (childnames[i].indexOf("currentdb") == -1) && (childnames[i].indexOf("currentsite") == -1)) { - //dump("gsites:" + childnames[i] + "\n"); - var sitecfg = JSON.parse(apppref.getpreference(childnames[i])); - //dump("Creche loader: " + JSON.stringify(sitecfg) + "A: "+system.fileexists( sitecfg.path.local ) + system.sep() + sitecfg.uuid + ".sqlite")+ "\n"); - //if (system.fileexists( sitecfg.path.local + system.sep() + sitecfg.uuid + ".sqlite")){ - if (!document.getElementById("mnumultisite_" + sitecfg.dbnum)) - { - var item = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "menuitem"); - item.setAttribute("label", sitecfg.name); - item.setAttribute("id", "mnumultisite_" + sitecfg.dbnum); - item.setAttribute("value", sitecfg.dbnum); - item.setAttribute("class","clmultisite"); - item.setAttribute("oncommand","multisite_reader.setcurrent('"+ sitecfg.dbnum +"');"); - document.getElementById("pop_multisites").appendChild(item); - }else { - document.getElementById("mnumultisite_" + sitecfg.dbnum).setAttribute("label", sitecfg.name); - if (sitecfg.dbnum == cnum) { - document.getElementById("curcreche").value=sitecfg.name; - } - } - //} - - } - } - }, - setcurrent:function(num){ - if (!num) { - return; - } - apppref.setpreference("support.database.currentdb.num",num); - - curcfg.loadconfig(num); - //appdb.check_defaultdata(); - ///dump("creche loaded: " + curcfg.dbfile.local +"\ndbnum: " + curcfg.dbnum + "\nName: " + curcfg.name + "\n"); - if (system.fileexists(curcfg.dbfile.local)) { - navigation.update_dbname(curcfg.name); - var lastpageopened = JSON.parse(apppref.getpreference("pageconfig.lastpage")); - if (lastpageopened.view != "") { - navigation.load_appview(lastpageopened.view,lastpageopened.module,null,lastpageopened.header); - } - } else { - //dump("File : '" + curdb + "' does not exist!\n"); - } - - } -} \ No newline at end of file diff --git a/TODO/modules_todo/multisite/multisite.xul b/TODO/modules_todo/multisite/multisite.xul deleted file mode 100644 index bdcdc3e..0000000 --- a/TODO/modules_todo/multisite/multisite.xul +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/TODO/modules_todo/openinvoices/js/accountingopeninvoice.js b/TODO/modules_todo/openinvoices/js/accountingopeninvoice.js deleted file mode 100644 index a502000..0000000 --- a/TODO/modules_todo/openinvoices/js/accountingopeninvoice.js +++ /dev/null @@ -1,191 +0,0 @@ -//Source-code licensed under EUPL v1.2 ( Copyright 2019 By DKS s.à r.l. - Kilian Saffran - Luxembourg ) - -var pconfig = {}; -var winh= window.innerHeight -50; -var tblacc = null; -var gpaccchild = null; -var crecheuuid = null; -var importpath = null; -//var lictype = apppref.getpreference("support.lictype"); - -function initdata(){ - curcfg.loadconfig(apppref.getpreference("support.database.currentdb.num")); - check_accountingtable(); - load_helpers(); - var configdata = apppref.getpreference("pageconfig.accountingopeninvoice"); - - if (configdata != '') { - pconfig = JSON.parse(configdata); - } - if (!pconfig.printlayout) { - pconfig.printlayout = 'list'; - apppref.setpreference("pageconfig.accountingopeninvoice",pconfig); - } - var ccreche = appdb.dbquery("select uuid from creche LIMIT 1;"); - crecheuuid = ccreche.sqldata[0].uuid; - importpath = FileUtils.File(curcfg.path.local + system.sep() +"imports" + system.sep() + crecheuuid); - - set_infoheader(""); - load_accounting_table(); -} - -function load_accounting_table(){ - // var xsql = "DELETE from accounting where accmonth='' or accmonth is null;"; - // appdb.dbexec(xsql); - var accsql = "select strftime('%m.%Y',acc.invoicedate) as calmonth,ch.clientnumber, " + -"COALESCE(ch.prename,'') || ' ' || COALESCE(ch.surname,'') AS childname,ch.checkservicenumber, acc.reference as reference, " + -"CASE WHEN acc.invoiceamount IS NOT NULL THEN printf(\"%.2f\",COALESCE(acc.invoiceamount,0.00)) || '€' || CASE WHEN acc.invoicedate IS NOT NULL THEN '
(' || strftime('%d.%m.%Y',acc.invoicedate) || ')' || CASE WHEN acc.reminderdate1 IS NOT NULL THEN '
R1:' || strftime('%d.%m.%Y',acc.reminderdate1) ELSE '' END || CASE WHEN acc.reminderdate2 IS NOT NULL THEN '
R2:' || strftime('%d.%m.%Y',acc.reminderdate2) ELSE '' END || CASE WHEN acc.reminderdate3 IS NOT NULL THEN '
R3:' || strftime('%d.%m.%Y',acc.reminderdate3) ELSE '' END ELSE '' END ELSE '' END AS invoiced, " + -"CASE WHEN acc.payedamount IS NOT NULL THEN printf(\"%.2f\",COALESCE(acc.payedamount,0.00)) || '€' || CASE WHEN acc.payeddate IS NOT NULL THEN '
(' || strftime('%d.%m.%Y',acc.payeddate) || ')' ELSE '' END ELSE '' END AS payement, " + -"'' || case when acc.invoicefile is not null and acc.invoicefile != '' then '' else '' end AS act " + -"from accounting acc join childs ch on (acc.childuuid=ch.uuid) " + -"where (acc.invoiceamount is not null and acc.payedamount is null) or (acc.payedamount < acc.invoiceamount) order by acc.invoicedate desc;"; - - - var accdata = appdb.dbquery(accsql); - - - $("#tbl_accounting > tbody").html(""); - - - var curchld = ""; - for (var i in accdata.sqldata){ - var row = accdata.sqldata[i]; - var tr = '' + row.calmonth + ''; - tr += '' + row.clientnumber + ''; - tr += '' + row.childname + ''; - tr += '' + row.checkservicenumber + ''; - tr += '' + row.reference + ''; - tr += '' + row.invoiced + ''; - tr += '' + row.payement + ''; - tr += '' + row.act + ''; - $("#tbl_accounting").append(tr); - } - - - $("#tbl_accounting").bootstrapTable({ - locale: 'fr-FR', - pagination: false, - search: true, - height: winh - }); - -} - - -function dlg_accounting(myuuid){ - - - var acc1sql = "SELECT acc.uuid as uuid,acc.accmonth,ch.prename || ' ' || ch.surname as childname,acc.childuuid,case when acc.invoicedate is not null then strftime('%d.%m.%Y',acc.invoicedate) else null end as invoicedate, case when acc.payeddate is not null then strftime('%d.%m.%Y',acc.payeddate) else null end as payeddate, acc.payedamount,acc.benefitamount, acc.invoiceamount, acc.reference, case when acc.reminderdate1 is not null then strftime('%d.%m.%Y',acc.reminderdate1) else null end as reminderdate1, case when acc.reminderdate2 is not null then strftime('%d.%m.%Y',acc.reminderdate2) else null end as reminderdate2, case when acc.reminderdate3 is not null then strftime('%d.%m.%Y',acc.reminderdate3) else null end as reminderdate3,case when acc.invoicefile is not null and acc.invoicefile != '' then '"+ importpath.path + system.sep() +"' || acc.invoicefile else null end as invoicefile,'upd' as action FROM accounting acc join childs ch on (acc.childuuid=ch.uuid) where acc.uuid='"+myuuid+"';"; - - var acc1data = appdb.dbquery(acc1sql); - - if (!acc1data.sqldata) { - - return false; - } - acc1data = acc1data.sqldata[0]; - - for (var a in acc1data){ - - if ($("#frmeditaccounting #" +a)) { - - $("#frmeditaccounting #"+a).val(acc1data[a]); - } - } - $("#edit_accounting").modal('show'); - -} - -function save_accounting(){ - var sql1 = new Array(); - var sql2 = new Array(); - // var cntnum = "01"; - var type = $("#frmeditaccounting #action").val(); - if (type == 'ins'){ - sql1.push('childuuid'); - sql2.push("'"+ pconfig.accchild +"'"); - - } - - $("#frmeditaccounting :input").each(function(){ - var input = $(this); - if (input.attr("id") ){ - if ((type == 'ins') && (input.attr("type") != 'hidden') && (input.attr("id") != 'accmonth') && (input.attr("id") != 'childname')) { - - sql1.push('"' + input.attr("id") + '"'); - if (input.attr("type") == "file") { - var newlocation= importpath.path + system.sep() + system.getFileName(input.val()); - if (!system.fileexists(importpath.path)){ - importpath.create(1,0755); - } - OS.File.copy(input.val(), newlocation); - } - var ival = input.val(); - - var ival = encodeparam(input.val(),input.attr('type')); - sql2.push(ival); - if (input.attr("id") == 'invoicedate'){ - sql1.push('"accmonth"'); - - var newaccmonth = ival.replace(/'/g,""); - // var cntx = appdb.dbquery("select count(accmonth)+1 as cnt from accounting where childuuid = '"+ pconfig.accchild +"' and accmonth between date('"+newaccmonth.substring(0,4) + "-" + newaccmonth.substring(5,7)+"-01') and date('"+newaccmonth.substring(0,4) + "-" + newaccmonth.substring(5,7)+"-01','+1 month','-1 day'); "); - // cntnum = cntx.sqldata[0].cntx; - // if (cntnum < 10){ cntnum = "0" + cntnum;} - sql2.push('\'' + newaccmonth.substring(0,4) + "-" + newaccmonth.substring(5,7) +"-01'"); - } - }else { - if ((input.attr("type") != 'hidden') && (input.attr("id") != 'childname')) { - if (input.attr("type") == "file") { - if (system.getDirectory(input.val()) != importpath.path) { - var newlocation= importpath.path + system.sep() + system.getFileName(input.val()); - OS.File.copy(input.val(), newlocation); - } - } - var ival = input.val(); - - var ival = encodeparam(ival,input.attr('type')); - sql2.push('"' + input.attr("id") +'"='+ ival); - if (input.attr("id") == 'invoicedate'){ - var newaccmonth = ival.replace(/'/g,""); - // var cntx = appdb.dbquery("select count(accmonth)+1 as cnt from accounting where childuuid = '"+ pconfig.accchild +"' and accmonth between date('"+newaccmonth.substring(0,4) + "-" + newaccmonth.substring(5,7)+"-01') and date('"+newaccmonth.substring(0,4) + "-" + newaccmonth.substring(5,7)+"-01','+1 month','-1 day'); "); - // cntnum = cntx.sqldata[0].cntx; - // if (cntnum < 10){ cntnum = "0" + cntnum;} - sql2.push('"accmonth"=\'' + newaccmonth.substring(0,4) + "-" + newaccmonth.substring(5,7) +"-01'"); - } - - } - } - } - - }); - var xsql = ""; - if (type == 'upd') { - xsql = "UPDATE accounting SET "+sql2.join(',')+" where \"uuid\"='" + $("#frmeditaccounting #uuid").val() +"';"; - }else { - sql1.push("uuid"); - sql2.push("'" + appdb.generate_uuid() + "'"); - xsql = "INSERT INTO accounting ("+sql1.join(',')+") VALUES ("+sql2.join(',')+");"; - } - //jsdump(xsql); - appdb.dbexec(xsql); - load_accounting_table(); - $("#frmeditaccounting #uuid").val("0"); - $("#edit_accounting").modal('hide'); -} - -function print_list(){ - globelreq.send_request({page:'preview2',data:{page: 'accountingopeninvoice'}}); -} - -function openfile(fi){ - var ddir = system.getDirectory(appdb.dbFile.path); - var ff = system.openFile(ddir + system.sep() + 'imports' + system.sep() + crecheuuid +system.sep() + fi); -} - -function check_accountingtable(){ - var cols = appdb.dbquery("SELECT type, name,tbl_name,sql FROM sqlite_master where tbl_name='accounting';"); - if (cols.sqldata[0].sql.indexOf(" uuid TEXT") == -1){ - appdb.dbexec("ALTER TABLE accounting add column uuid TEXT;"); - } - appdb.dbexec("UPDATE accounting set uuid= hex(randomblob(4)) || '-' || hex(randomblob(2)) || '-' || hex(randomblob(2)) || '-' || hex(randomblob(2)) || '-' || hex(randomblob(6)) where uuid is null;"); -} diff --git a/TODO/modules_todo/reports/css/print.css b/TODO/modules_todo/reports/css/print.css deleted file mode 100644 index a3c54fc..0000000 --- a/TODO/modules_todo/reports/css/print.css +++ /dev/null @@ -1,138 +0,0 @@ -body { - font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; - font-size: 11px; - line-height: 1.42857; - background-color: #fff; -} -h2 { - font-size: 18px; - font-weight: bold; - margin-top: 0px; - margin-bottom: 5px; -} - -h3 { - font-size: 14px; - font-style: italic; - margin-top: 0px; - margin-bottom: 5px; -} - -.dataTables_filter { - height: 0px; - width: 0px; -} - -/*.dataTable > thead > tr > th {*/ -/* padding-top: 70px;*/ -/*}*/ - -/*.dataTable > tfoot > tr > th { - padding-bottom: 40px; -}*/ - -/*tfoot { display: table-footer-group;*/ -/* position: absolute; */ -/* bottom: 0; }*/ - -.alignright{ - text-align: right; -} - -.alignleft { - text-align: left; -} - -.noprint { - display: none; -} - - - -@media print { - -@page { - margin-left: 2cm; - margin-right: 1cm; - margin-top: 1cm; - margin-bottom: 1cm; -} - -tfoot { - display: table-row-group; -} - -table { - width: 100% !Important; - border-spacing: 0; - border-collapse: collapse; -} - -table.dataTable td { - white-space: nowrap; - overflow: hidden; -} - -table.dataTable > thead > th > td { - white-space: nowrap; - overflow: hidden; -} -table.dataTable tr { - page-break-inside: avoid; - page-break-after: auto; - } - -table.dataTable tfoot { - page-break-inside: avoid; - page-break-after: auto; - } - -table.dataTable tfoot > th > td { - font-size: 2vw; -} -table.dataTable { - width: 100% !Important; - border-spacing: 0; - border-collapse: collapse; -} - -#print-head { - display: block; - position: fixed; - font-family: Arial,Helvetica, sans-serif; - z-index: 10; - top: 0pt; - left:0pt; - right: 0pt; - background-color: #fff; - text-align: center; - } - -/*#print-foot { - display: block; - position: fixed; - width: 100%; - padding-top: 5px; - bottom: 0pt; - text-align: center; - right: auto; - left: auto; - font-family: Arial,Helvetica, sans-serif; - }*/ - -/*#print-foot:after { - content: counter(page); - counter-increment: page; - }*/ - - -.dataTables_filter { - height: 0px; - width: 0px; -} - -.dataTable { - width: 100% !Important; -} - -} \ No newline at end of file diff --git a/TODO/modules_todo/reports/dlg/dlgpdfviewer.xul b/TODO/modules_todo/reports/dlg/dlgpdfviewer.xul deleted file mode 100644 index 6180c0c..0000000 --- a/TODO/modules_todo/reports/dlg/dlgpdfviewer.xul +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - diff --git a/TODO/modules_todo/reports/dlg/dlgprint.xul b/TODO/modules_todo/reports/dlg/dlgprint.xul deleted file mode 100644 index 0817914..0000000 --- a/TODO/modules_todo/reports/dlg/dlgprint.xul +++ /dev/null @@ -1,164 +0,0 @@ - - - - - - - - diff --git a/TODO/modules_todo/reports/img/logoprint.png b/TODO/modules_todo/reports/img/logoprint.png deleted file mode 100644 index 8c760e8..0000000 Binary files a/TODO/modules_todo/reports/img/logoprint.png and /dev/null differ diff --git a/TODO/modules_todo/reports/img/print.png b/TODO/modules_todo/reports/img/print.png deleted file mode 100644 index 335f482..0000000 Binary files a/TODO/modules_todo/reports/img/print.png and /dev/null differ diff --git a/TODO/modules_todo/reports/img/save.png b/TODO/modules_todo/reports/img/save.png deleted file mode 100644 index ef5ba59..0000000 Binary files a/TODO/modules_todo/reports/img/save.png and /dev/null differ diff --git a/TODO/modules_todo/reports/img/settings.png b/TODO/modules_todo/reports/img/settings.png deleted file mode 100644 index 3a8b3b3..0000000 Binary files a/TODO/modules_todo/reports/img/settings.png and /dev/null differ diff --git a/TODO/modules_todo/reports/js/print.js b/TODO/modules_todo/reports/js/print.js deleted file mode 100644 index ab6a68c..0000000 --- a/TODO/modules_todo/reports/js/print.js +++ /dev/null @@ -1,64 +0,0 @@ -//Source-code licensed under EUPL v1.2 ( Copyright 2019 By DKS s.à r.l. - Kilian Saffran - Luxembourg ) -document.onreadystatechange = function () { - if (document.readyState == "complete") { - try { - initdata(); - }catch(e){ - //dump("Print.js No initdata function!\n"); - } - } -} - -function encodeparam(string,type){ - if (type == "text") { - if (string == "") { - string = 'null'; - }else { - string = string.replace('<','<','g'); - string = string.replace('>','>','g'); - string = string.replace('&','&','g'); - string = string.replace('"','"','g'); - string = string.replace("'","''",'g'); - string = "'"+ string+"'"; - } - }else if(type == "date"){ - var re = /^(\d{1,2})\.(\d{1,2})\.(\d{4})$/i; - if (!string.match(re)) { - string = 'null'; - }else{ - var dspl=string.split('.'); - string = "'"+dspl[2]+'-'+dspl[1]+'-'+dspl[0]+"'"; - } - }else if(type == "number"){ - if (string == "") { - string = 'null'; - }else { - string.replace(',','.'); - string = parseFloat(string); - } - }else if(type == "boolean"){ - if (string == "") { - string = 'null'; - } - string= string.replace('true',"'1'"); - string= string.replace('false',"'0'"); - }else if(type == "month"){ - var re = /^(\d{1,2})\.(\d{4})$/i; - if (!string.match(re)) { - string = 'null'; - }else{ - var dspl=string.split('.'); - string = "'"+dspl[1]+'-'+dspl[0]+"-01'" - } - } - else { - string = string.replace('<','<','g'); - string = string.replace('>','>','g'); - string = string.replace('&','&','g'); - string = string.replace('"','"','g'); - string = string.replace("'","''",'g'); - string = "'"+ string+"'"; - } - - return string; -} \ No newline at end of file diff --git a/TODO/modules_todo/reports/js/print_book.js b/TODO/modules_todo/reports/js/print_book.js deleted file mode 100644 index ece7bb3..0000000 --- a/TODO/modules_todo/reports/js/print_book.js +++ /dev/null @@ -1,41 +0,0 @@ -//Source-code licensed under EUPL v1.2 ( Copyright 2019 By DKS s.à r.l. - Kilian Saffran - Luxembourg ) -var pconfig = {}; - -function initdata(){ - var configdata = apppref.getpreference("pageconfig.logactivity"); - if (configdata != '') { - pconfig = JSON.parse(configdata); - } - //"Book Ident Data:" + JSON.stringify(pconfig) + "\n"); - var windowMediator = Components.classes["@mozilla.org/appshell/window-mediator;1"] - .getService(Components.interfaces.nsIWindowMediator); - var winmain = windowMediator.getMostRecentWindow("xulcreorga"); - var maindoc = winmain.document.getElementById("brw_application").contentDocument; - - //var xdate = new Date(); - //$("#printdatetime").html(xdate.toLocaleFormat("%d.%m.%Y %H:%M:%S")); - - $("#title_sub").html(winmain.document.getElementById("infoheader").value); - - $("#title_main").html(maindoc.title); - //$("#tbl_list").css("margin-top","100px"); - var crn = appdb.dbquery("select crechename,adress,city,country,zip from creche;"); - crn = crn.sqldata[0]; - $("#creche_name").html(crn.crechename); - $("#creche_address").html(crn.adress); - $("#creche_zip").html(crn.zip); - $("#creche_city").html(crn.city); - loadactivitydata(); -} - -function loadactivitydata(){ - var actdatasql = "SELECT strftime('%d.%m.%Y',logdatefrom) || ' - ' || strftime('%d.%m.%Y',logdateto) as daterange, logtitle, logmessage FROM activitylog where uuid='"+ pconfig.activityuuid+"';"; - //dump(actdatasql + "\n"); - var data = appdb.dbquery(actdatasql); - $("#bookdata").append('

'+ data.sqldata[0].logtitle+'

'); - $("#bookdata").append('

'+ data.sqldata[0].daterange+'

'); - $("#bookdata").append('
'+ data.sqldata[0].logmessage+'
'); -} - - - diff --git a/TODO/modules_todo/reports/js/print_calendar.js b/TODO/modules_todo/reports/js/print_calendar.js deleted file mode 100644 index 125eb45..0000000 --- a/TODO/modules_todo/reports/js/print_calendar.js +++ /dev/null @@ -1,35 +0,0 @@ -//Source-code licensed under EUPL v1.2 ( Copyright 2019 By DKS s.à r.l. - Kilian Saffran - Luxembourg ) -function initdata(){ - var windowMediator = Components.classes["@mozilla.org/appshell/window-mediator;1"] - .getService(Components.interfaces.nsIWindowMediator); - var winmain = windowMediator.getMostRecentWindow("xulcreorga"); - - var maindoc = winmain.document.getElementById("brw_application").contentDocument; - - var xdate = new Date(); - $("#printdatetime").html(xdate.toLocaleFormat("%d.%m.%Y %H:%M:%S")); - $("#title_sub").html(winmain.document.getElementById("infoheader").value); - $("#title_main").html(maindoc.title); - //$("#cal_month").css("margin-top","100px"); - var crn = appdb.dbquery("select crechename,adress,city,country,zip from creche;"); - crn = crn.sqldata[0]; - $("#creche_name").html(crn.crechename); - $("#creche_address").html(crn.adress); - $("#creche_zip").html(crn.zip); - $("#creche_city").html(crn.city); - - var elx = maindoc.querySelectorAll('table[id^="cal_"]'); - - for (var i in elx) { - //dump(elx[i].id + "\n"); - if (elx[i].id) { - var elementdata = maindoc.getElementById(elx[i].id).innerHTML; - - //elementdata = elementdata.replace(/height:\ 0px;/g,''); - //elementdata = elementdata.replace(/height:0;/g,''); - $("#cal_month").append(elementdata); - //$("#tbl_list th:first-child").remove(); - //$("#tbl_list td:first-child").remove(); - } - } -} \ No newline at end of file diff --git a/TODO/modules_todo/reports/js/print_child.js b/TODO/modules_todo/reports/js/print_child.js deleted file mode 100644 index 6be1f2f..0000000 --- a/TODO/modules_todo/reports/js/print_child.js +++ /dev/null @@ -1,155 +0,0 @@ -//Source-code licensed under EUPL v1.2 ( Copyright 2019 By DKS s.à r.l. - Kilian Saffran - Luxembourg ) -var pconfig = {}; -function initdata(){ - var configdata = apppref.getpreference("pageconfig.child"); - if (configdata != '') { - pconfig = JSON.parse(configdata); - } - var windowMediator = Components.classes["@mozilla.org/appshell/window-mediator;1"] - .getService(Components.interfaces.nsIWindowMediator); - var winmain = windowMediator.getMostRecentWindow("xulcreorga"); - var maindoc = winmain.document.getElementById("brw_application").contentDocument; - - //var xdate = new Date(); - //$("#printdatetime").html(xdate.toLocaleFormat("%d.%m.%Y %H:%M:%S")); - - $("#title_sub").html(winmain.document.getElementById("infoheader").value); - - $("#title_main").html(maindoc.title); - //$("#tbl_list").css("margin-top","100px"); - var crn = appdb.dbquery("select crechename,adress,city,country,zip from creche;"); - crn = crn.sqldata[0]; - $("#creche_name").html(crn.crechename); - $("#creche_address").html(crn.adress); - $("#creche_zip").html(crn.zip); - $("#creche_city").html(crn.city); - - var cdatasql = "select child.uuid,child.clientnumber,child.prename,child.surname,strftime('%d.%m.%Y',child.birthday) as birthday,child.address,child.city,child.zip,child.country,strftime('%d.%m.%Y',child.entrydate) as entrydate,child.checkservicenumber,strftime('%d.%m.%Y',child.checkserviceexpiration) as checkserviceexpiration,strftime('%d.%m.%Y',child.leavedate) as leavedate,child.nationality,child.nativelanguage,child.bankaccount,child.bankbic,child.cautionamount,child.cautionpayed,child.cautionremark,child.cautionpayedback,child.cautionstatusdate,child.remark,child.uuid,health.docname, health.docphone,health.docaddress,health.doczip, health.doccity,health.doccountry,health.healthinfo,health.uuid as docuuid from childs child join health health on (child.uuid=health.childuuid) where child.uuid='" + pconfig.uuid + "';"; - var cdata = appdb.dbquery(cdatasql); - $('#financedata').hide(); - if (cdata) { - cdata = cdata.sqldata[0]; - var hx = true; - for (var ci in cdata) { - if (document.getElementById("childs_" + ci)) { - $("#childs_" + ci).html(cdata[ci]); - } - if (document.getElementById("health_" + ci)) { - if (cdata[ci] != '') { - hx = false; - $("#health_" + ci).html(cdata[ci]); - }else { - $("#health_" + ci).hide(); - } - - } - - } - if (hx) { - $('#healthdata').hide(); - } - } - - load_table_presence(); - load_table_parents(); - load_table_refpersons(); - var cdatea = new Date(); - //$("#printdatetime").html(cdatea.toLocaleFormat("%d.%m.%Y %H:%M:%S")); - //$("#accmonth").html(myfilter.description); - var crn = appdb.dbquery("select crechename,adress,city,country,zip from creche;"); - crn = crn.sqldata[0]; - $("#creche_name").html(crn.crechename); - $("#creche_address").html(crn.adress); - $("#creche_zip").html(crn.zip); - $("#creche_city").html(crn.city); -} - -function load_table_presence(){ - var plandatasql = "SELECT grp.grpname, strftime('%d.%m.%Y',plan.datebegin) || ' - ' || strftime('%d.%m.%Y',plan.dateend) AS planningdaterange, plan.montimebegin || ' - ' || plan.montimeend || CASE WHEN plan.monlunch='1' THEN ' ()' ELSE '' END || case when plan.montimebegin2 is not null and plan.montimeend2 is not null then '
' || plan.montimebegin2 || ' - ' || plan.montimeend2 else '' end AS monplanningtime, plan.tuetimebegin || ' - ' || plan.tuetimeend || CASE WHEN plan.tuelunch='1' THEN ' ()' ELSE '' END || case when plan.tuetimebegin2 is not null and plan.tuetimeend2 is not null then '
' || plan.tuetimebegin2 || ' - ' || plan.tuetimeend2 else '' end AS tueplanningtime, plan.wedtimebegin || ' - ' || plan.wedtimeend || CASE WHEN plan.wedlunch='1' THEN ' ()' ELSE '' END || case when plan.wedtimebegin2 is not null and plan.wedtimeend2 is not null then '
' || plan.wedtimebegin2 || ' - ' || plan.wedtimeend2 else '' end AS wedplanningtime, plan.thutimebegin || ' - ' || plan.thutimeend || CASE WHEN plan.thulunch='1' THEN ' ()' ELSE '' END || case when plan.thutimebegin2 is not null and plan.thutimeend2 is not null then '
' || plan.thutimebegin2 || ' - ' || plan.thutimeend2 else '' end AS thuplanningtime, plan.fritimebegin || ' - ' || plan.fritimeend || CASE WHEN plan.frilunch='1' THEN ' ()' ELSE '' END || case when plan.fritimebegin2 is not null and plan.fritimeend2 is not null then '
' || plan.fritimebegin2 || ' - ' || plan.fritimeend2 else '' end AS friplanningtime FROM planning plan LEFT JOIN groups grp ON ( plan.groupuuid=grp.uuid) WHERE plan.childuuid='" + pconfig.uuid + "' ORDER BY plan.datebegin, plan.dateend;"; - var plandata = appdb.dbqueryarray(plandatasql); - if (plandata) { - var headerdata = getlabels(plandata.sqlhead.join(",")); - $("#tbl_planning").html(""); - var tblplan = $("#tbl_planning").dataTable({ - "language": { - "url": "L../../js/locale/datatable_fr.json" - }, - "data": plandata.sqldata, - "columns": headerdata, - "paging": false, - "ordering": false, - "info": false, - "filter": false, - "destroy": true - }); - }else { - $('#planningdata').hide(); - } -} - -function load_table_parents() { - var labelx = getlabelswithkey('mother,father'); - var areftypes = new Array(); - for (var l in labelx){ - areftypes.push("select '"+ labelx[l].title +"' as refname, '"+labelx[l].keyname+"' as reftype"); - } - var lblsql = areftypes.join(" UNION "); - var parentssql = "SELECT rx.refname as reftype, coalesce(rp.surname,'') || ' ' || coalesce(rp.prename,'') as nameprename, coalesce(rp.address,'') || '
' || coalesce(rp.zip,'') || ' ' || coalesce(rp.city,'') || '
' || coalesce(rp.country,'') as address, case when rp.phone is not null then ': ' || rp.phone || '
' else '' end || case when rp.mobile is not null then': ' || rp.mobile || '
' else '' end || case when rp.workphone is not null then ': ' || rp.workphone || '
' else '' end || case when rp.email is not null then ': ' || email else '' end as phonemail, rp.job, rp.authsubscriber FROM refpersons rp join ("+lblsql+") rx on (rp.reftype=rx.reftype) where rp.childuuid='" + pconfig.uuid + "' and rp.reftype in ('mother','father');"; - - var parentsdata = appdb.dbqueryarray(parentssql); - if (parentsdata) { - var headerdata = getlabels(parentsdata.sqlhead.join(",")); - $("#tbl_parents").html(""); - $("#tbl_parents").dataTable({ -"language": { - "url": "../../js/locale/datatable_fr.json" - }, - "data": parentsdata.sqldata, - "columns": headerdata, - "paging": false, - "ordering": false, - "info": false, - "filter": false, - "destroy": true - }); - }else { - $('#parentdata').hide(); - } - - - -} - -function load_table_refpersons() { - var labelx = getlabelswithkey('tuteur,famillymember,famillyfriend'); - var areftypes = new Array(); - for (var l in labelx){ - areftypes.push("select '"+ labelx[l].title +"' as refname, '"+labelx[l].keyname+"' as reftype"); - } - var lblsql = areftypes.join(" UNION "); - var refpersonsql = "SELECT rx.refname as reftype, coalesce(rp.surname,'') || ' ' || coalesce(rp.prename,'') as nameprename, coalesce(rp.address,'') || '
' || coalesce(rp.zip,'') || ' ' || coalesce(rp.city,'') || '
' || coalesce(rp.country,'') as address, case when rp.phone is not null then ': ' || rp.phone || '
' else '' end || case when rp.mobile is not null then': ' || rp.mobile || '
' else '' end || case when rp.workphone is not null then ': ' || rp.workphone || '
' else '' end || case when rp.email is not null then ': ' || email else '' end as phonemail, rp.job, rp.authsubscriber FROM refpersons rp join ("+lblsql+") rx on (rp.reftype=rx.reftype) where rp.childuuid='" + pconfig.uuid + "' and rp.reftype not in ('mother','father');"; - - var refpersonsdata = appdb.dbqueryarray(refpersonsql); - if (refpersonsdata) { - var headerdata = getlabels(refpersonsdata.sqlhead.join(",")); - $("#tbl_refpersons").html(""); - $("#tbl_refpersons").dataTable({ - "language": { - "url": "../../js/locale/datatable_fr.json" - }, - "data": refpersonsdata.sqldata, - "columns": headerdata, - "paging": false, - "ordering": false, - "info": false, - "filter": false, - "destroy": true - }); - }else { - $('#refpersondata').hide(); - } - - - -} - diff --git a/TODO/modules_todo/reports/js/print_loaddata.js b/TODO/modules_todo/reports/js/print_loaddata.js deleted file mode 100644 index cdeae41..0000000 --- a/TODO/modules_todo/reports/js/print_loaddata.js +++ /dev/null @@ -1,52 +0,0 @@ -//Source-code licensed under EUPL v1.2 ( Copyright 2019 By DKS s.à r.l. - Kilian Saffran - Luxembourg ) -function initdata(){ - var windowMediator = Components.classes["@mozilla.org/appshell/window-mediator;1"] - .getService(Components.interfaces.nsIWindowMediator); - var winmain = windowMediator.getMostRecentWindow("xulcreorga"); - var maindoc = winmain.document.getElementById("brw_application").contentDocument; - - $("#title_sub").html(winmain.document.getElementById("infoheader").value); - - $("#title_main").html(maindoc.title); - var crn = appdb.dbquery("select crechename,adress,city,country,zip from creche;"); - crn = crn.sqldata[0]; - $("#creche_name").html(crn.crechename); - $("#creche_address").html(crn.adress); - $("#creche_zip").html(crn.zip); - $("#creche_city").html(crn.city); - - var elx = maindoc.querySelectorAll('table[id^="tbl_"]'); - //var elx = maindoc.querySelectorAll('tfoot'); - - //jsdump(elx); - - var tcols = 1; - var strlp = apppref.getpreference("pageconfig.lastpage"); - var lp = JSON.parse(strlp); - var strcp = apppref.getpreference("pageconfig." + lp.view); - var cp = JSON.parse(strcp); - var ctab = ""; - //"print_loaddata.js \n"); - if (cp.activetab) { - ctab = cp.activetab; - } - - // $("#testdata").append(JSON.stringify(elx)); - for (var i in elx) { - - - var elementdata = maindoc.getElementById(elx[i].id).innerHTML; - - - var thead = elementdata.substring(elementdata.indexOf(''),elementdata.indexOf('')).replace('',''); - var tbody = elementdata.substring(elementdata.indexOf(''),elementdata.indexOf('')).replace('',''); - - - - - $("#tbl_list > thead").append(thead); - $("#tbl_list > tbody").append(tbody); - - } - -} \ No newline at end of file diff --git a/TODO/modules_todo/reports/js/print_logchild.js b/TODO/modules_todo/reports/js/print_logchild.js deleted file mode 100644 index e62af3e..0000000 --- a/TODO/modules_todo/reports/js/print_logchild.js +++ /dev/null @@ -1,45 +0,0 @@ -//Source-code licensed under EUPL v1.2 ( Copyright 2019 By DKS s.à r.l. - Kilian Saffran - Luxembourg ) -var pconfig = {}; -var initdate = new Date(); - -function initdata(){ - - var configdata = apppref.getpreference("pageconfig.logchild"); - if (configdata != '') { - pconfig = JSON.parse(configdata); - } - var windowMediator = Components.classes["@mozilla.org/appshell/window-mediator;1"] - .getService(Components.interfaces.nsIWindowMediator); - var winmain = windowMediator.getMostRecentWindow("xulcreorga"); - var maindoc = winmain.document.getElementById("brw_application").contentDocument; - initdate = new Date(encodeparam(pconfig.logdate, 'date').replace(/'/g, '')); - //var xdate = new Date(); - //$("#printdatetime").html(xdate.toLocaleFormat("%d.%m.%Y %H:%M:%S")); - - $("#title_sub").html(pconfig.logdate); - - $("#title_main").html(maindoc.title); - //$("#tbl_list").css("margin-top","100px"); - var crn = appdb.dbquery("select crechename,adress,city,country,zip from creche;"); - crn = crn.sqldata[0]; - $("#creche_name").html(crn.crechename); - $("#creche_address").html(crn.adress); - $("#creche_zip").html(crn.zip); - $("#creche_city").html(crn.city); - - load_table_logchilds(); -} - -function load_table_logchilds(){ - var logsql = "select ch.prename || ' ' || ch.surname AS childname, ch.checkservicenumber,lc.logmessage from childs ch left join planning pl on (ch.uuid=pl.childuuid) left join childslog lc on (lc.childuuid=ch.uuid) where date('"+ initdate.toISOString().substring(0,10)+"') between pl.datebegin and pl.dateend and lc.logmessage is not null and lc.logmessage != '' order by childname;"; - - var logdata = appdb.dbquery(logsql); - - for (var i in logdata.sqldata){ - var row = logdata.sqldata[i]; - //"initdata print_logchild! " + JSON.stringify(row)+"\n"); - var divd = '
'+ row.childname + ' ('+ row.checkservicenumber + ')'+'
'; - divd += '
'+ row.logmessage+'
'; - $("#div_data").append(divd); - } -} \ No newline at end of file diff --git a/TODO/modules_todo/reports/js/print_multilist.js b/TODO/modules_todo/reports/js/print_multilist.js deleted file mode 100644 index 41e3d7b..0000000 --- a/TODO/modules_todo/reports/js/print_multilist.js +++ /dev/null @@ -1,75 +0,0 @@ -//Source-code licensed under EUPL v1.2 ( Copyright 2019 By DKS s.à r.l. - Kilian Saffran - Luxembourg ) -function initdata(){ - var windowMediator = Components.classes["@mozilla.org/appshell/window-mediator;1"] - .getService(Components.interfaces.nsIWindowMediator); - var winmain = windowMediator.getMostRecentWindow("xulcreorga"); - var maindoc = winmain.document.getElementById("brw_application").contentDocument; - - $("#title_sub").html(winmain.document.getElementById("infoheader").value); - - $("#title_main").html(maindoc.title); - var crn = appdb.dbquery("select crechename,adress,city,country,zip from creche;"); - crn = crn.sqldata[0]; - $("#creche_name").html(crn.crechename); - $("#creche_address").html(crn.adress); - $("#creche_zip").html(crn.zip); - $("#creche_city").html(crn.city); - - var elx = maindoc.querySelectorAll('div[id^="tbl"]'); - //var elx = maindoc.querySelectorAll('tfoot'); - //"print_multilist.js \n"); - var tcols = 1; - var strlp = apppref.getpreference("pageconfig.lastpage"); - var lp = JSON.parse(strlp); - var strcp = apppref.getpreference("pageconfig." + lp.view); - var cp = JSON.parse(strcp); - var ctab = ""; - //dump(JSON.stringify(cp) + "\n"); - var getpagedesign=$("#allpages").html(); - //dump(getpagedesign + "\n===============\n"); - var cnt = 1; - $("#allpages").html(""); - for (var i in elx) { - // //dump(elx[i].id) - if ((elx[i].id ) && (elx[i].id.indexOf(ctab+"_wrapper") != -1)) { - var npage = getpagedesign.replace(/_xxnum/g,cnt); - - var elementdata = maindoc.getElementById(elx[i].id).innerHTML; - // - elementdata = elementdata.replace(/height:\ 0px;/g,''); - elementdata = elementdata.replace(/height:0;/g,''); - elementdata = elementdata.replace(/colspan="1" rowspan="1"/g,''); - elementdata = elementdata.replace(/style="width:\s\d+px;"/g,''); - // - var thead = elementdata.substring(elementdata.indexOf(''),elementdata.indexOf('')).replace('',''); - var tbody = elementdata.substring(elementdata.indexOf(''),elementdata.indexOf('')).replace('',''); - var tfoot = elementdata.substring(elementdata.lastIndexOf(''),elementdata.lastIndexOf('')).replace('',''); - // - //tcols = thead.split(''); - //dump(tbody + "\n========\n"); - // - // - if (tbody.indexOf("dataTables_empty") == -1) { - $("#allpages").append(npage); - $("#tbl_list"+cnt+" > thead").append(thead); - $("#tbl_list"+cnt+" > tbody").append(tbody); - $("#tbl_list"+cnt+" > tfoot").append(tfoot); - - $("#tbl_list" + cnt).dataTable({ - "language": { - "url": "../../../js/locale/datatable_fr.json" - }, - "paging": false, - "ordering": false, - "info": false, - "filter": false, - "destroy": true - }); - cnt++; - } - - } - } - $('[id$="lunch"]').removeClass('btn-success'); - $('[id$="lunch"]').addClass('btn-default'); -} \ No newline at end of file diff --git a/TODO/modules_todo/reports/js/print_table.js b/TODO/modules_todo/reports/js/print_table.js deleted file mode 100644 index bf0b56a..0000000 --- a/TODO/modules_todo/reports/js/print_table.js +++ /dev/null @@ -1,92 +0,0 @@ -//Source-code licensed under EUPL v1.2 ( Copyright 2019 By DKS s.à r.l. - Kilian Saffran - Luxembourg ) -function initdata(){ - var windowMediator = Components.classes["@mozilla.org/appshell/window-mediator;1"] - .getService(Components.interfaces.nsIWindowMediator); - var winmain = windowMediator.getMostRecentWindow("xulcreorga"); - var maindoc = winmain.document.getElementById("brw_application").contentDocument; - - $("#title_sub").html(winmain.document.getElementById("infoheader").value); - - $("#title_main").html(maindoc.title); - var crn = appdb.dbquery("select crechename,adress,city,country,zip from creche;"); - crn = crn.sqldata[0]; - $("#creche_name").html(crn.crechename); - $("#creche_address").html(crn.adress); - $("#creche_zip").html(crn.zip); - $("#creche_city").html(crn.city); - - var elx = maindoc.querySelectorAll('table[id="tbl_timetable"]'); - //var elx = maindoc.querySelectorAll('tfoot'); - - var tcols = 1; - var strlp = apppref.getpreference("pageconfig.lastpage"); - var lp = JSON.parse(strlp); - var strcp = apppref.getpreference("pageconfig." + lp.view); - var cp = JSON.parse(strcp); - var ctab = ""; - //dump(JSON.stringify(cp) + "\n"); - //if (cp.activetab) { - // ctab = cp.activetab; - //} - //var elx = maindoc.querySelectorAll('table[id^="cal_"]'); - for (var i in elx) { - if (elx[i].id) { - var elementdata = maindoc.getElementById(elx[i].id).innerHTML; - //elementdata = elementdata.replace(/height:\ 0px;/g,''); - //elementdata = elementdata.replace(/height:0;/g,''); - $("#tbl_list").append(elementdata); - //$("#tbl_list th:first-child").remove(); - //$("#tbl_list td:first-child").remove(); - } - } - - //$('td').each(function(){ - // if($(this).attr('colspan') > 1){ - // var ccol = $(this).attr('colspan'); - // $(this).attr('colspan',ccol -1); - // } - //}); - //$('th').each(function(){ - // if($(this).attr('colspan') > 1){ - // var ccol = $(this).attr('colspan'); - // $(this).attr('colspan',ccol -1); - // } - //}); - - - //for (var i in elx) { - // //dump(elx[i].id) - // if ((elx[i].id ) && (elx[i].id.indexOf(ctab+"_wrapper") != -1)) { - // - // var elementdata = maindoc.getElementById(elx[i].id).innerHTML; - // - // elementdata = elementdata.replace(/height:\ 0px;/g,''); - // elementdata = elementdata.replace(/height:0;/g,''); - // elementdata = elementdata.replace(/colspan="1" rowspan="1"/g,''); - // elementdata = elementdata.replace(/style="width:\s\d+px;"/g,''); - // - // var thead = elementdata.substring(elementdata.indexOf(''),elementdata.indexOf('')).replace('',''); - // var tbody = elementdata.substring(elementdata.indexOf(''),elementdata.indexOf('')).replace('',''); - // var tfoot = elementdata.substring(elementdata.lastIndexOf(''),elementdata.lastIndexOf('')).replace('',''); - // - // tcols = thead.split(''); - // - // - // - // $("#tbl_list > thead").append(thead); - // $("#tbl_list > tbody").append(tbody); - // $("#tbl_list > tfoot").append(tfoot); - // - // } - //} - // $("#tbl_list").dataTable({ - // "language": { - // "url": "../../../js/locale/datatable_fr.json" - // }, - // "paging": false, - // "ordering": false, - // "info": false, - // "filter": false, - // "destroy": true - //}); -} \ No newline at end of file diff --git a/TODO/modules_todo/reports/js/printpdf.js b/TODO/modules_todo/reports/js/printpdf.js deleted file mode 100644 index 443133a..0000000 --- a/TODO/modules_todo/reports/js/printpdf.js +++ /dev/null @@ -1,85 +0,0 @@ -//Source-code licensed under EUPL v1.2 ( Copyright 2019 By DKS s.à r.l. - Kilian Saffran - Luxembourg ) -var printpdf = { - //onLoad: function() { - // // initialization code - // this.initialized = true; - // this.strings = document.getElementById("printpdf-strings"); - // this.prefs = Components.classes["@mozilla.org/preferences-service;1"] - // .getService(Components.interfaces.nsIPrefBranch).getBranch("extensions.printpdf@pavlov."); - //}, - onMenuItemCommand: function(fpath,fname,e) { - var nsIFilePicker = Components.interfaces.nsIFilePicker; - var picker = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker); - picker.init(window, "Save Document as PDF", nsIFilePicker.modeSave); - picker.appendFilter("PDF", "*.pdf"); - picker.defaultExtension = "pdf"; - picker.defaultString = content.document.title; - - picker.show(); - - var webBrowserPrint = window.content.QueryInterface(Components.interfaces.nsIInterfaceRequestor) - .getInterface(Components.interfaces.nsIWebBrowserPrint); - - var PSSVC = Components.classes["@mozilla.org/gfx/printsettings-service;1"] - .getService(Components.interfaces.nsIPrintSettingsService); - - var printSettings = PSSVC.newPrintSettings; - - printSettings.printToFile = true; - printSettings.toFileName = picker.file.path; - printSettings.printSilent = true; - printSettings.outputFormat = Components.interfaces.nsIPrintSettings.kOutputFormatPDF; - - // Added by bho - //var myPrintPrefs = printpdf.getPrintingPrefs(); - printSettings.printBGColors = true; - printSettings.printBGImages = true; - printSettings.unwriteableMarginTop = 0.5; - printSettings.unwriteableMarginLeft = 0.5; - printSettings.unwriteableMarginBottom = 0.5; - printSettings.unwriteableMarginRight = 0.5; - printSettings.marginTop = 0.2; /* these are in inches */ - printSettings.marginLeft = 0.2; - printSettings.marginBottom = 0.2; - printSettings.marginRight = 0.2; - //printSettings.shrinkToFit; - printSettings.paperName = "iso_a4"; /* name of paper */ - printSettings.paperSizeType = 1; /* use native data or is defined here */ - //printSettings.paperData = 9; /* native data value */ - printSettings.orientation = 1; - //"PDF Orientation:" + printSettings.orientation + "\n"); - if (printSettings.orientation == 1) { - printSettings.paperWidth = 297.0; /* width of the paper in inches or mm */ - printSettings.paperHeight = 210.0; /* height of the paper in inches or mm */ - - } else { - printSettings.paperWidth = 210.0; /* width of the paper in inches or mm */ - printSettings.paperHeight = 297.0; /* height of the paper in inches or mm */ - } - printSettings.paperSizeUnit = 1; /* paper is in inches or mm */ - //lets hide those ugly default headers - printSettings.footerStrCenter = ''; - printSettings.footerStrLeft = ''; - printSettings.footerStrRight = ''; - printSettings.headerStrCenter = ''; - printSettings.headerStrLeft = ''; - printSettings.headerStrRight = ''; - //} - // END: Added by bho - - webBrowserPrint.print(printSettings, null); - } - //onToolbarButtonCommand: function(e) { - // // just reuse the function above. you can change this, obviously! - // printpdf.onMenuItemCommand(e); - //}, - //getPrintingPrefs: function (){ - // return { - // showBGColor: this.prefs.getBoolPref("print.showBGColors"), - // showBGImages: this.prefs.getBoolPref("print.showBGImages"), - // showHeaders: this.prefs.getBoolPref("print.showHeaders") - // }; - //} - -}; -//window.addEventListener("load", function(e) { printpdf.onLoad(e); }, false); diff --git a/TODO/modules_todo/reports/js/printutils.js b/TODO/modules_todo/reports/js/printutils.js deleted file mode 100644 index e4bec35..0000000 --- a/TODO/modules_todo/reports/js/printutils.js +++ /dev/null @@ -1,41 +0,0 @@ -//Source-code licensed under EUPL v1.2 ( Copyright 2019 By DKS s.à r.l. - Kilian Saffran - Luxembourg ) -var printmanager = { - onprint: function() { - var sprdata = apppref.getpreference("pageconfig.lastpage"); - var prdata = JSON.parse(sprdata); - var spldata = apppref.getpreference("pageconfig." + prdata.view); - var pldata = JSON.parse(spldata); - if (!pldata.printlayout) { - //dump(prdata.module +" "+prdata.view+": Sorry, no printlayout defined!\n"); - }else { - //dump(JSON.stringify(pldata) + "\n"); - printmanager.load_printpreview("chrome://creorga/content/modules/reports/print_" +pldata.printlayout + ".html"); - } - }, - load_pdf: function(data){ - var params = { in : { - "uri": data.uri - }, - out: null - }; - var dlg = window.openDialog("chrome://creorga/content/modules/reports/dlg/dlgpdfviewer.xul", "dlgpdfviewer", - "chrome,centerscreen,resizable,scrollbars", params).focus(); - if (params.out) { - //code - } - }, - load_printpreview: function(path) { - var params = { in : { - "uri": path - }, - out: null - }; - var dlg = window.openDialog("chrome://creorga/content/modules/reports/dlg/dlgprint.xul", "dlgprint", - "chrome,centerscreen,resizable,scrollbars,modal", params).focus(); - if (params.out) { - if (params.out.reload == true) { - printmanager.load_printpreview(params.in.uri,params.in.type); - } - } - }, -} \ No newline at end of file diff --git a/TODO/modules_todo/reports/print_book.html b/TODO/modules_todo/reports/print_book.html deleted file mode 100644 index 77cdde5..0000000 --- a/TODO/modules_todo/reports/print_book.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - Creorga - Enfant - - - - - - - - - - - - - - -
- - - - - -
-
- -
- - - - - - - - \ No newline at end of file diff --git a/TODO/modules_todo/reports/print_calendar.html b/TODO/modules_todo/reports/print_calendar.html deleted file mode 100644 index b8e8d4b..0000000 --- a/TODO/modules_todo/reports/print_calendar.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - Creorga - Printing - List - - - - - - - - - - - - - - - - -
- - - - - -
- -
- - - - - - - - - - \ No newline at end of file diff --git a/TODO/modules_todo/reports/print_child.html b/TODO/modules_todo/reports/print_child.html deleted file mode 100644 index e4001e3..0000000 --- a/TODO/modules_todo/reports/print_child.html +++ /dev/null @@ -1,134 +0,0 @@ - - - - - Creorga - Enfant - - - - - - - - - - - - - - -
- - - - - -
-
-

Données de base

- - - - - - - - - - - - - - - - -
Prénom
Nom
Date de naissance
No. Check Service
Date d'expiration
No. Client
Addresse
Code Postale
Ville
Pays
Nationalité
Langue maternelle
Remarque
-
- -
-

Données parents / personnes de référence

-
- - - -
-
-
- -
-

Données personnes de réferences/authorisées

-
- - - -
-
-
- -
-

Info Planning

- - - - - - -
Date d'entrée
Date de sortie
-
- - - -
-
-
- -
-

Info Santé

- - - - - - - - - - -
Médecin de famille
Téléphone
Adr. cabinet
Code Postale
Ville
Pays
Info Santé
-
- -
-

Info fincances/caution

- - - - - - - - - - -
Somme totale
Somme payé
Somme remboursé
Date Status
Compte bancaire
BIC
Remarque
-
- - - - - - - - - - - - - \ No newline at end of file diff --git a/TODO/modules_todo/reports/print_list.html b/TODO/modules_todo/reports/print_list.html deleted file mode 100644 index b8e6cd4..0000000 --- a/TODO/modules_todo/reports/print_list.html +++ /dev/null @@ -1,70 +0,0 @@ - - - - - Creorga - Printing - List - - - - - - - - - - - - - - - - -
- - - - - -
-
- - - - - - - - -
- - - - - - - - - - - - diff --git a/TODO/modules_todo/reports/print_logchild.html b/TODO/modules_todo/reports/print_logchild.html deleted file mode 100644 index e2ef030..0000000 --- a/TODO/modules_todo/reports/print_logchild.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - Creorga - Logbook - - - - - - - - - - - - -
- - - - - -
-
- - - - - - - - - \ No newline at end of file diff --git a/TODO/modules_todo/reports/print_multilist.html b/TODO/modules_todo/reports/print_multilist.html deleted file mode 100644 index 61d050f..0000000 --- a/TODO/modules_todo/reports/print_multilist.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - Creorga - Printing - MultiList - - - - - - - - - - - - - - - - -
-
-
- - - - - -
-

- - - - - - - - - -
-
-
- - - - - - - - - - diff --git a/TODO/modules_todo/reports/print_table.html b/TODO/modules_todo/reports/print_table.html deleted file mode 100644 index 2129b80..0000000 --- a/TODO/modules_todo/reports/print_table.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - Creorga - Printing - Table - - - - - - - - - - - - - - - - -
- - - - - -
- - -
- - - - - - - - diff --git a/TODO/modules_todo/reports/reports.xul b/TODO/modules_todo/reports/reports.xul deleted file mode 100644 index 7f9abec..0000000 --- a/TODO/modules_todo/reports/reports.xul +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/TODO/modules_todo/support/support.xul b/TODO/modules_todo/support/support.xul deleted file mode 100644 index 735eaa4..0000000 --- a/TODO/modules_todo/support/support.xul +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/TODO/modules_todo/support/update.html b/TODO/modules_todo/support/update.html deleted file mode 100644 index 8969bae..0000000 --- a/TODO/modules_todo/support/update.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - Creorga - Update - - - - - - - - - - -
- -
-
-
-
-

icon Info mise-à-jour

-
-
- Pas de mise-à-jour disponible! -
-
-
- - -
- - - - - - - - - - - \ No newline at end of file diff --git a/apps/api/lib/pgsql.pm b/apps/api/lib/pgsql.pm index 8d0b622..e36a77c 100644 --- a/apps/api/lib/pgsql.pm +++ b/apps/api/lib/pgsql.pm @@ -22,16 +22,11 @@ sub new { # $self->{$x} = $p->{$x}; #} $self->{dbtype} = 'PgPP'; #PgPP,SQLite - - if ($ENV{SERVER_NAME} eq "localhost"){ - $self->{dbhost} = 'localhost'; - } else { - $self->{dbhost} = 'sql629.your-server.de'; - } - - # + $self->{dbhost} = 'sql629.your-server.de'; + #$self->{dbhost} = 'localhost'; $self->{dbname} = 'dks_lu'; $self->{dbuser} = 'dks_lu'; + #$self->{dbpassword} = 'dks_lu'; $self->{dbpassword} = 'DcrWuLd4KU3u68xd'; return $self; } diff --git a/apps/data/db/lechatpotte.sqlite b/apps/data/db/lechatpotte.sqlite index 4244aaa..8a55af2 100644 Binary files a/apps/data/db/lechatpotte.sqlite and b/apps/data/db/lechatpotte.sqlite differ diff --git a/apps/data/db/underatert.sqlite b/apps/data/db/underatert.sqlite index 3c6da64..19c528d 100644 Binary files a/apps/data/db/underatert.sqlite and b/apps/data/db/underatert.sqlite differ diff --git a/apps/index.cgi b/apps/index.cgi index 0937d10..2269b79 100644 --- a/apps/index.cgi +++ b/apps/index.cgi @@ -9,12 +9,13 @@ use Template; use CGI; use CGI::Cookie; use CGI::Carp qw/fatalsToBrowser/; - +#use FindBin qw($Bin $RealBin); use Data::Dumper; use JSON::PP; use session; - +#my $tmpldir = "/mnt/c/Users/ksaff/Workspace/juridig/app/tmpl"; +# chdir(dirname($0)); my $skl = "skeleton/index.tt"; my $cgi = new CGI(); my $p=(); @@ -23,7 +24,6 @@ my $cookie; # foreach my $pp (@params){ # $p->{$pp} = $cgi->param($pp); # } -my $status = '200 ok'; my $sess = (); my $se = session->new(); my $page = "index.tt"; @@ -31,7 +31,6 @@ my $basepath = substr(dirname($ENV{"SCRIPT_FILENAME"}),length($ENV{"DOCUMENT_ROO # my $basepath = $ENV{"DOCUMENT_ROOT"}; my $filepath = substr($cgi->url({-absolute=>1}),length($basepath)+1); #if (exists($p->{p})){ - if ($filepath ne ""){ $page = $filepath; $page =~ s/html$/tt/; @@ -80,19 +79,11 @@ if (($ENV{HTTP_USER_AGENT} !~ /Chrome/) || ($ENV{HTTP_USER_AGENT} =~ /Edge/) || # if (!exists($sesdata->{usersession})){ # $p->{page} = "login"; # } -if ( -d dirname($ENV{"SCRIPT_FILENAME"}).'/tmpl/'.$page){ - $page = $page.'/index.tt'; -} +print $cgi->header(-type=>'text/html', -charset=>"utf-8",-cookie => $cookie); -my $template = Template->new({INCLUDE_PATH => [dirname($ENV{"SCRIPT_FILENAME"}).'/tmpl']}); +my $template = Template->new({INCLUDE_PATH => [dirname($0).'/tmpl']}); my @lv = split(/\//,$filepath); -my $absnum = 0; -if (scalar(@lv) > 1){ - $absnum = scalar(@lv)-1; -} else { - $absnum = scalar(@lv); -} -# my $absnum = scalar(@lv)-1; +my $absnum = scalar(@lv)-1; my $vars->{abspath} = ""; for (my $i=0;$i<$absnum;$i++){ $vars->{abspath} .= "../"; @@ -103,9 +94,7 @@ $vars->{basepath} = $basepath; $vars->{page} = $page; $vars->{pagename} = basename($page); $vars->{pagename} =~ s/\.tt$//; - my ($appname) = $ENV{REQUEST_URI} =~ /.*\/apps\/(\w+)\/.*/; - #$vars->{requri} = $ENV{REQUEST_URI}; if ($p->{sid} ne ""){ $vars->{appname} = $appname; @@ -119,17 +108,10 @@ if ($p->{sid} ne ""){ if ($skl ne "skeleton/login.tt" && $page ne "index.tt"){ $skl = "skeleton/app.tt"; } -# if ((! -f dirname($ENV{"SCRIPT_FILENAME"}).'/tmpl/'.$page) && ($skl ne "skeleton/login.tt")){ -# $status = '404 Not Found'; -# $skl = "skeleton/error.tt"; -# } -print $cgi->header(-status => $status, -type=>'text/html', -charset=>"utf-8",-cookie => $cookie); # print Dumper($template); $template->process($skl,$vars) || die "Template process failed: ", $template->error(), "\n"; -# print '/*'; -# # for my $e ( keys %ENV ) { -# # print "$e: ".$ENV{$e}."
"; -# # } -# print Dumper($vars); -# print scalar(@lv); -# print '*/'; +# my %headers = map { $_ => $cgi->http($_) } $cgi->http(); +# print "Got the following headers:\n"; +# for my $header ( keys %headers ) { +# print "$header: $headers{$header}
"; +# } diff --git a/apps/js/app.js b/apps/js/app.js index c946fc3..c290a08 100644 --- a/apps/js/app.js +++ b/apps/js/app.js @@ -130,7 +130,7 @@ document.addEventListener("keydown", function(e) { } - var https = 'http'; + var https = 'https'; $(document).ready(function() { app.baseurl = https + '://' + location.host + location.pathname.substring(0,location.pathname.lastIndexOf('/apps/')+6); @@ -140,5 +140,25 @@ document.addEventListener("keydown", function(e) { app.loadsites(); }); + // $("#appframe").on('load', function(){ + // //console.log($("#appframe").attr("src")); + // var src = $("#appframe").attr("src").replace(/\\/g,'/'); + // src = src.substring(src.indexOf('/creorga/') + 5); + // src = src.substring(0,src.indexOf('?')); + // $.ajax({ + // encoding:"UTF-8", + // url:app.api() +'prefs.cgi?page=service&set=' +encodeURIComponent('{"lastpage":"'+ src+'"}') , + + // success: function (data){ + + + // }, + // error: function(data){ + + // console.log("Error:" + JSON.stringify(data)); + // }, + // async:false + // }); + // }) \ No newline at end of file diff --git a/apps/js/apps.js b/apps/js/apps.js index 0c50f42..b884dda 100644 --- a/apps/js/apps.js +++ b/apps/js/apps.js @@ -1,5 +1,6 @@ +var https ='https'; function logout() { - var myurl = location.href; + myurl = https + '://'+ location.host + '/apps/'; $.ajax({ async: false, url: myurl, diff --git a/apps/js/webdatabase.js b/apps/js/webdatabase.js index 029000b..2912353 100644 --- a/apps/js/webdatabase.js +++ b/apps/js/webdatabase.js @@ -2,7 +2,7 @@ var appdb = { dbquery: function(sQuery){ var type='querysorted'; var result= {sqldata:[]}; - //console.log(sQuery); + $.ajax({ encoding:"UTF-8", @@ -15,8 +15,8 @@ var appdb = { result=data.result; }, error: function(data){ - - console.log("Error:" + JSON.stringify(data)); + + console.log("Error:" + JSON.stringify(data)); }, async:false }); diff --git a/apps/lib.par b/apps/lib.par deleted file mode 100644 index 3013689..0000000 Binary files a/apps/lib.par and /dev/null differ diff --git a/apps/tmpl/creorga/modules/staff/js/coworker.js b/apps/tmpl/creorga/modules/staff/js/coworker.js index a210001..4403214 100644 --- a/apps/tmpl/creorga/modules/staff/js/coworker.js +++ b/apps/tmpl/creorga/modules/staff/js/coworker.js @@ -523,11 +523,15 @@ function saveyearvacdays() { days = parseFloat($('#vacancyyeartotal').val().replace(',','.')); hours = parseFloat($('#vacancyyeartotal').val().replace(',','.')) * 8; } + //console.log(csel); var cnum = parent.appdb.dbquery(csel); + //console.log(cnum); + //console.log(Object.keys(cnum.sqldata).length); var inssql = "INSERT INTO staffvacancydays (staffuuid,vacancyyear,days,hours) VALUES ('"+pconfig.uuid+"','"+pconfig.year+"',"+days+","+hours+");"; - if (cnum.sqldata.length > 0) { + if (cnum && cnum.sqldata && Object.keys(cnum.sqldata).length > 0) { inssql = "UPDATE staffvacancydays SET days="+days+",hours="+hours+" where staffuuid='"+pconfig.uuid+"' and vacancyyear='"+pconfig.year+"';"; } + //console.log(inssql); parent.appdb.dbexec(inssql); //calcvacancy(); } diff --git a/apps/tmpl/skeleton/login.tt b/apps/tmpl/skeleton/login.tt index d49ce90..b13717d 100644 --- a/apps/tmpl/skeleton/login.tt +++ b/apps/tmpl/skeleton/login.tt @@ -63,7 +63,7 @@
diff --git a/css/site.css b/css/site.css deleted file mode 100644 index 9990c36..0000000 --- a/css/site.css +++ /dev/null @@ -1,75 +0,0 @@ - - -.bg-topbar { - background-color: #6a92d3; -} - -.main { - margin-top: 80px; -} - -.card-header { - background-color: #6a92d3; - color: #fff; -} - -h1 { - font-size: 35pt; - font-weight: bold; -} - -.card { - /*opacity: 0.8;*/ -} - -header.masthead { - padding-top: 30px; - position: relative; - background: url(../img/bg.jpg); - background-position: center; - background-size: cover; -} - - -.iconbar { - width: 60px; - float: left; -} - -a { - color: #000; -} - -a:hover { - color: #000; -} - -a.footer { - color: #fff; -} - -.dropdown-menu { - border-radius: 0px; -} - -.navbar-nav .dropdown-menu { - background-color: #6a92d3; - color: #fff; -} - -.navbar-nav .dropdown-menu .dropdown-item { - color: #fff; -} - -.navbar-nav .dropdown-menu .dropdown-item:hover { - background-color: #52638e; -} - -.nav-link:hover { - text-decoration: underline; -} - -h3 a: { - color: #000; -} - diff --git a/dev/db/changes.sql b/dev/db/changes.sql deleted file mode 100644 index 28243dc..0000000 --- a/dev/db/changes.sql +++ /dev/null @@ -1,5 +0,0 @@ -ALTER TABLE creche add column idcheckservice TEXT; -update vacancycalendar set vacyear=strftime('%Y',datefrom) where vacyear is null; -update vacancycalendar set timeto='08:00' where timeto='00:00'; -ALTER TABLE vacancycalendar add column vacyear integer; -alter table staff add column inactive boolean; \ No newline at end of file diff --git a/dev/db/dks_lu.pgsql.basedata.sql b/dev/db/dks_lu.pgsql.basedata.sql deleted file mode 100644 index 925d7e6..0000000 --- a/dev/db/dks_lu.pgsql.basedata.sql +++ /dev/null @@ -1,62 +0,0 @@ -INSERT INTO public.appaccess (id, id_user, creorga) VALUES (1, 1, '{ - "db": [ - {"name": "Creche Un der Atert","dbname": "underatert"}, - {"name": "Le Chat Potté","dbname": "lechatpotte"} - ], - "modules": { - "child": {"delete": true,"filelist": false}, - "coworker": {"menu": false}, - "staff": {"menu":true,"vacancy":true,"delete": false,"planning" : false}, - "checkservice": { "menu": false,"export": false,"import":false }, - "creche": { "menu": true} - } -}'); -SELECT pg_catalog.setval('public.appaccess_id_seq', 1, true); -INSERT INTO public.users (id, email, username, userpassword, prename, surname, confirmkey, created, modified, blocked) VALUES (1, 'ksaffran@dks.lu', 'kilian', '0ecf731e2426a8a469f06e9f4a3bcbed6f8071d9d3e3ef7ef5fd9165021e27ec', NULL, NULL, NULL, '2019-04-08 11:07:47.289143', '2019-04-08 11:07:47.289143', NULL); -SELECT pg_catalog.setval('public.users_id_seq', 1, true); - --- perl -e "use Digest::SHA qw(sha256_hex); print sha256_hex('4EbH6F4btSgWV87w');" user christine.lopez ---INSERT INTO users (email, username, userpassword, prename, surname) values ('crecheunderatert@pt.lu','christine.lopez','b55331d2f418ea21fc04c6ffa3b3604404156ef6d3fb4ba20e318c523fd94115','Christine','Lopez'); --- perl -e "use Digest::SHA qw(sha256_hex); print sha256_hex('RZCvS981DWqp42xn');" user creche.useldange ---INSERT INTO users (email, username, userpassword, prename, surname) values ('crecheunderatert@pt.lu','creche.useldange','3c79a46f823969294a57da2ffa6a1ad095b55a0bc69346cba508543eb36f1625','Creche','Useldange'); --- perl -e "use Digest::SHA qw(sha256_hex); print sha256_hex('cm8As5Pc5TE4p5HJ');" user creche.bergem --- INSERT INTO users (email, username, userpassword, prename, surname) values ('crecheunderatert@pt.lu','creche.bergem','da89e31ce3c99cf304127e33443af1a866c8375728cbb730aca1f2d2c277fe7a','Creche','Useldange'); -/* -INSERT INTO public.appaccess (id_user, creorga) VALUES (2, '{ - "db": [ - {"name": "Creche Un der Atert","dbname": "underatert"}, - {"name": "Le Chat Potté","dbname": "lechatpotte"} - ], - "modules": { - "child": {"delete": true,"filelist": false}, - "coworker": {"menu": false}, - "staff": {"menu":true,"vacancy":true,"delete": false,"planning" : false}, - "checkservice": { "menu": false,"export": false,"import":false }, - "creche": { "menu": true} - } -}'); -INSERT INTO public.appaccess (id_user, creorga) VALUES (3, '{ - "db": [ - {"name": "Creche Un der Atert","dbname": "underatert"} - ], - "modules": { - "child": {"delete": false,"filelist": false}, - "coworker": {"menu": false}, - "staff": {"menu":true,"vacancy":true,"delete": false,"planning" : false}, - "checkservice": { "menu": false,"export": false,"import":false }, - "creche": { "menu": false} - } -}'); -INSERT INTO public.appaccess (id_user, creorga) VALUES (4, '{ - "db": [ - {"name": "Le Chat Potté","dbname": "lechatpotte"} - ], - "modules": { - "child": {"delete": false,"filelist": false}, - "coworker": {"menu": false}, - "staff": {"menu":true,"vacancy":true,"delete": false,"planning" : false}, - "checkservice": { "menu": false,"export": false,"import":false }, - "creche": { "menu": false} - } -}'); -*/ \ No newline at end of file diff --git a/dev/db/dks_lu.pgsql.schema.sql b/dev/db/dks_lu.pgsql.schema.sql deleted file mode 100644 index 793840d..0000000 --- a/dev/db/dks_lu.pgsql.schema.sql +++ /dev/null @@ -1,88 +0,0 @@ -SET statement_timeout = 0; -SET lock_timeout = 0; -SET idle_in_transaction_session_timeout = 0; -SET client_encoding = 'SQL_ASCII'; -SET standard_conforming_strings = on; -SELECT pg_catalog.set_config('search_path', '', false); -SET check_function_bodies = false; -SET client_min_messages = warning; -SET row_security = off; -CREATE FUNCTION public.getuuid() RETURNS text - LANGUAGE sql - AS $$ - select uuid_in(md5(random()::text || clock_timestamp()::text)::cstring)::TEXT; - $$; -SET default_tablespace = ''; -SET default_with_oids = false; -CREATE TABLE public.appaccess ( - id integer NOT NULL, - id_user integer, - creorga json -); -CREATE SEQUENCE public.appaccess_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; -ALTER SEQUENCE public.appaccess_id_seq OWNED BY public.appaccess.id; -CREATE TABLE public.modulepreferences ( - id integer NOT NULL, - id_user integer, - appident text, - preference json, - page text -); -CREATE SEQUENCE public.modulepreferences_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; -ALTER SEQUENCE public.modulepreferences_id_seq OWNED BY public.modulepreferences.id; -CREATE TABLE public.sessions ( - id bigint NOT NULL, - id_user integer, - idsession text, - remote_addr text, - user_agent text, - created timestamp without time zone DEFAULT now() -); -CREATE SEQUENCE public.sessions_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; -ALTER SEQUENCE public.sessions_id_seq OWNED BY public.sessions.id; -CREATE TABLE public.users ( - id integer NOT NULL, - email text, - username text, - userpassword text, - prename text, - surname text, - confirmkey text, - created timestamp without time zone DEFAULT now(), - modified timestamp without time zone DEFAULT now(), - blocked boolean -); -CREATE SEQUENCE public.users_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; -ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id; -ALTER TABLE ONLY public.appaccess ALTER COLUMN id SET DEFAULT nextval('public.appaccess_id_seq'::regclass); -ALTER TABLE ONLY public.modulepreferences ALTER COLUMN id SET DEFAULT nextval('public.modulepreferences_id_seq'::regclass); -ALTER TABLE ONLY public.sessions ALTER COLUMN id SET DEFAULT nextval('public.sessions_id_seq'::regclass); -ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass); -ALTER TABLE ONLY public.appaccess - ADD CONSTRAINT appaccess_pkey PRIMARY KEY (id); -ALTER TABLE ONLY public.modulepreferences - ADD CONSTRAINT modulepreferences_pkey PRIMARY KEY (id); -ALTER TABLE ONLY public.sessions - ADD CONSTRAINT sessions_pkey PRIMARY KEY (id); -ALTER TABLE ONLY public.users - ADD CONSTRAINT users_pkey PRIMARY KEY (id); diff --git a/dev/db/lechatpotte.new.schema.sql b/dev/db/lechatpotte.new.schema.sql deleted file mode 100644 index 589004b..0000000 --- a/dev/db/lechatpotte.new.schema.sql +++ /dev/null @@ -1,581 +0,0 @@ -CREATE TABLE IF NOT EXISTS "creche" ( - crechename TEXT, - adress TEXT, - city TEXT, - country TEXT, - zip TEXT, - maxchilds INTEGER, - uuid TEXT NOT NULL, - minage INTEGER, - maxage INTEGER, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, editor TEXT, - stafflist boolean, idcheckservice TEXT, - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "eventcalendar" ( - uuid TEXT NOT NULL, - datefrom DATE, - dateto DATE, - timefrom TEXT, - timeto TEXT, - description TEXT, - activityuuid TEXT, - staffuuid TEXT, - location TEXT, - color TEXT, - freq TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "staffplanning" ( - eventcalendaruuid TEXT, - staffuuid TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (eventcalendaruuid,staffuuid) -); -CREATE TRIGGER trg_staffplanning_upd UPDATE ON staffplanning - BEGIN - UPDATE staffplanning set lastmodified=CURRENT_TIMESTAMP where eventcalendaruuid=NEW.eventcalendaruuid and staffuuid=NEW.staffuuid; - END; -CREATE TABLE IF NOT EXISTS "accounting" ( - accmonth DATE, - childuuid TEXT, - invoicedate DATE, - payeddate DATE, - payedamount REAL, - invoiceamount REAL, - reference TEXT, - reminderdate1 DATE, - reminderdate2 DATE, - reminderdate3 DATE, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - invoicefile TEXT, - benefitfile TEXT, - benefitamount REAL, - PRIMARY KEY (accmonth,childuuid) -); -CREATE TRIGGER trg_eventcalendar_upd UPDATE ON eventcalendar - BEGIN - UPDATE eventcalendar set lastmodified=CURRENT_TIMESTAMP where uuid=NEW.uuid; - END; -CREATE TRIGGER trg_accounting_upd UPDATE ON accounting - BEGIN - UPDATE accounting set lastmodified=CURRENT_TIMESTAMP where accmonth=NEW.accmonth and childuuid=NEW.childuuid; - END; -CREATE TABLE IF NOT EXISTS "expenses" ( - uuid TEXT, - expensedate DATE, - remitter TEXT, - expenseamount REAL - expensefile TEXT, - statementfile TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (uuid) -); -CREATE TRIGGER trg_expenses_upd UPDATE ON expenses - BEGIN - UPDATE expenses set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TABLE IF NOT EXISTS "vacancy" ( - vacancydate DATE, - vacancydateto DATE, - vacancydescription TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (vacancydate,vacancydateto) -); -CREATE TRIGGER trg_vacancy_upd UPDATE ON vacancy - BEGIN - UPDATE vacancy set lastmodified=CURRENT_TIMESTAMP where vacancydate = NEW.vacancydate and vacancydateto = NEW.vacancydateto; - END; -CREATE TABLE IF NOT EXISTS "staff" ( - jobtitle TEXT, - prename TEXT, - surname TEXT, - address TEXT, - zip TEXT, - city TEXT, - country TEXT, - entrydate DATE, - exitdate DATE, - iban TEXT, - bic TEXT, - accountname TEXT, - phone TEXT, - email TEXT, - uuid TEXT NOT NULL, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - color TEXT, - weekhours integer, password TEXT, editor TEXT, - PRIMARY KEY (uuid) -); -CREATE TRIGGER trg_staff_upd UPDATE ON staff - BEGIN - UPDATE staff set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TABLE IF NOT EXISTS "groups" ( - grpname TEXT, - maxchilds INTEGER, - minage INTEGER, - maxage INTEGER, - uuid TEXT NOT NULL, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, minstaff integer DEFAULT 1, color TEXT, - PRIMARY KEY (uuid) -); -CREATE TRIGGER trg_groups_upd UPDATE ON groups - BEGIN - UPDATE groups set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TABLE childslog ( - uuid TEXT not null, - logdate DATE, - logmessage TEXT, - childuuid TEXT, - editorstaffuuid TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, editor TEXT, - PRIMARY KEY (uuid) -); -CREATE TABLE stafflog ( - uuid TEXT not null, - logdate DATE, - logmessage TEXT, - staffuuid TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, editor TEXT, - PRIMARY KEY (uuid) -); -CREATE TRIGGER trg_childslog_upd UPDATE ON childslog - BEGIN - UPDATE childslog set lastmodified=CURRENT_TIMESTAMP where uuid=NEW.uuid; - END; -CREATE TABLE activitylog - ( - uuid TEXT NOT NULL, - logdatefrom DATETIME, - logdateto DATETIME, - logtitle TEXT, - logmessage TEXT, - editorstaffuuid TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, editor TEXT, - PRIMARY KEY (uuid) - ); -CREATE TRIGGER trg_activitylog_upd UPDATE ON activitylog - BEGIN - UPDATE activitylog set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TABLE cautionstatus ( - uuid TEXT NOT NULL, - childuuid TEXT, - statusdate DATE, - amount NUMERIC, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, statementnumber TEXT, - PRIMARY KEY (uuid) -); -CREATE TRIGGER trg_cautionstatus_upd UPDATE ON cautionstatus - BEGIN - UPDATE cautionstatus set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TABLE planningtemplate - ( - uuid TEXT NOT NULL, - montimebegin TEXT, - montimeend TEXT, - monlunch BOOLEAN, - tuetimebegin TEXT, - tuetimeend TEXT, - tuelunch BOOLEAN, - wedtimebegin TEXT, - wedtimeend TEXT, - wedlunch BOOLEAN, - thutimebegin TEXT, - thutimeend TEXT, - thulunch BOOLEAN, - fritimebegin TEXT, - fritimeend TEXT, - frilunch BOOLEAN, - sattimebegin TEXT, - sattimeend TEXT, - satlunch BOOLEAN, - suntimebegin TEXT, - suntimeend TEXT, - sunlunch BOOLEAN, - montimebegin2 TEXT, - montimeend2 TEXT, - tuetimebegin2 TEXT, - tuetimeend2 TEXT, - wedtimebegin2 TEXT, - wedtimeend2 TEXT, - thutimebegin2 TEXT, - thutimeend2 TEXT, - fritimebegin2 TEXT, - fritimeend2 TEXT, - sattimebegin2 TEXT, - sattimeend2 TEXT, - suntimebegin2 TEXT, - suntimeend2 TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, templatename TEXT, - PRIMARY KEY (uuid) - ); -CREATE TRIGGER trg_planningtemplate_upd UPDATE ON planningtemplate - BEGIN - UPDATE planningtemplate set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TABLE messagelog - ( - uuid TEXT NOT NULL, - logdate DATETIME, - logtitle TEXT, - logmessage TEXT, - editorstaffuuid TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, editor TEXT, - PRIMARY KEY (uuid) - ); -CREATE TRIGGER trg_message_upd UPDATE ON messagelog - BEGIN - UPDATE messagelog set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TABLE IF NOT EXISTS "childs" ( - clientnumber TEXT, - prename TEXT, - surname TEXT, - birthday DATE, - address TEXT, - city TEXT, - zip TEXT, - country TEXT, - entrydate DATE, - checkservicenumber TEXT, - leavedate DATE, - nationality TEXT, - nativelanguage TEXT, - bankaccount TEXT, - bankbic TEXT, - cautionamount NUMERIC, - cautionpayed NUMERIC, - cautionremark TEXT, - cautionpayedback TEXT, - cautionstatusdate DATE, - remark TEXT, - checkserviceexpiration DATE, - uuid TEXT NOT NULL, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - infohealth TEXT, - bankaccountowner TEXT, - infoimportant TEXT, - infolunch TEXT, - editor TEXT, - PRIMARY KEY (uuid) -); -CREATE TABLE new_refpersons ( - reftype TEXT, - surname TEXT, - prename TEXT, - address TEXT, - phone TEXT, - mobile TEXT, - job TEXT, - email TEXT, - workphone TEXT, - zip TEXT, - country TEXT, - city TEXT, - authsubscriber BOOLEAN, - childuuid TEXT, - uuid TEXT NOT NULL, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - remark TEXT, - priority INTEGER, - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "refpersons" ( - reftype TEXT, - surname TEXT, - prename TEXT, - address TEXT, - phone TEXT, - mobile TEXT, - job TEXT, - email TEXT, - workphone TEXT, - zip TEXT, - country TEXT, - city TEXT, - authsubscriber BOOLEAN, - childuuid TEXT, - uuid TEXT NOT NULL, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - remark TEXT, - priority INTEGER, - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "workinghours" ( - uuid TEXT NOT NULL, - datestart DATE NOT NULL, - montimeopen TEXT, - montimeclose TEXT, - tuetimeopen TEXT, - tuetimeclose TEXT, - wedtimeopen TEXT, - wedtimeclose TEXT, - thutimeopen TEXT, - thutimeclose TEXT, - fritimeopen TEXT, - fritimeclose TEXT, - sattimeopen TEXT, - sattimeclose TEXT, - suntimeopen TEXT, - suntimeclose TEXT, - crecheuuid TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (uuid) -); -CREATE TABLE new_planning ( - datebegin DATE, - dateend DATE, - montimebegin TEXT, - montimeend TEXT, - monlunch BOOLEAN, - tuetimebegin TEXT, - tuetimeend TEXT, - tuelunch BOOLEAN, - wedtimebegin TEXT, - wedtimeend TEXT, - wedlunch BOOLEAN, - thutimebegin TEXT, - thutimeend TEXT, - thulunch BOOLEAN, - fritimebegin TEXT, - fritimeend TEXT, - frilunch BOOLEAN, - sattimebegin TEXT, - sattimeend TEXT, - satlunch BOOLEAN, - suntimebegin TEXT, - suntimeend TEXT, - sunlunch BOOLEAN, - childuuid TEXT, - uuid TEXT NOT NULL, - groupuuid TEXT, - montimebegin2 TEXT, - montimeend2 TEXT, - tuetimebegin2 TEXT, - tuetimeend2 TEXT, - wedtimebegin2 TEXT, - wedtimeend2 TEXT, - thutimebegin2 TEXT, - thutimeend2 TEXT, - fritimebegin2 TEXT, - fritimeend2 TEXT, - sattimebegin2 TEXT, - sattimeend2 TEXT, - suntimebegin2 TEXT, - suntimeend2 TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "planning" ( - datebegin DATE, - dateend DATE, - montimebegin TEXT, - montimeend TEXT, - monlunch BOOLEAN, - tuetimebegin TEXT, - tuetimeend TEXT, - tuelunch BOOLEAN, - wedtimebegin TEXT, - wedtimeend TEXT, - wedlunch BOOLEAN, - thutimebegin TEXT, - thutimeend TEXT, - thulunch BOOLEAN, - fritimebegin TEXT, - fritimeend TEXT, - frilunch BOOLEAN, - sattimebegin TEXT, - sattimeend TEXT, - satlunch BOOLEAN, - suntimebegin TEXT, - suntimeend TEXT, - sunlunch BOOLEAN, - childuuid TEXT, - uuid TEXT NOT NULL, - groupuuid TEXT, - montimebegin2 TEXT, - montimeend2 TEXT, - tuetimebegin2 TEXT, - tuetimeend2 TEXT, - wedtimebegin2 TEXT, - wedtimeend2 TEXT, - thutimebegin2 TEXT, - thutimeend2 TEXT, - fritimebegin2 TEXT, - fritimeend2 TEXT, - sattimebegin2 TEXT, - sattimeend2 TEXT, - suntimebegin2 TEXT, - suntimeend2 TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "health" ( - uuid TEXT NOT NULL, - docname TEXT, - docaddress TEXT, - docphone TEXT, - doczip TEXT, - doccountry TEXT, - doccity TEXT, - healthinfo TEXT, - childuuid TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "planningstaff" ( - uuid TEXT NOT NULL, - staffuuid TEXT NOT NULL, - note TEXT, - datebegin DATE, - dateend DATE, - montimebegin TEXT, - montimeend TEXT, - mongroupuuid TEXT, - tuetimebegin TEXT, - tuetimeend TEXT, - tuegroupuuid TEXT, - wedtimebegin TEXT, - wedtimeend TEXT, - wedgroupuuid TEXT, - thutimebegin TEXT, - thutimeend TEXT, - thugroupuuid TEXT, - fritimebegin TEXT, - fritimeend TEXT, - frigroupuuid TEXT, - sattimebegin TEXT, - sattimeend TEXT, - satgroupuuid TEXT, - suntimebegin TEXT, - suntimeend TEXT, - sungroupuuid TEXT, - montimebegin2 TEXT, - montimeend2 TEXT, - mongroupuuid2 TEXT, - tuetimebegin2 TEXT, - tuetimeend2 TEXT, - tuegroupuuid2 TEXT, - wedtimebegin2 TEXT, - wedtimeend2 TEXT, - wedgroupuuid2 TEXT, - thutimebegin2 TEXT, - thutimeend2 TEXT, - thugroupuuid2 TEXT, - fritimebegin2 TEXT, - fritimeend2 TEXT, - frigroupuuid2 TEXT, - sattimebegin2 TEXT, - sattimeend2 TEXT, - satgroupuuid2 TEXT, - suntimebegin2 TEXT, - suntimeend2 TEXT, - sungroupuuid2 TEXT, - montimebegin3 TEXT, - montimeend3 TEXT, - mongroupuuid3 TEXT, - tuetimebegin3 TEXT, - tuetimeend3 TEXT, - tuegroupuuid3 TEXT, - wedtimebegin3 TEXT, - wedtimeend3 TEXT, - wedgroupuuid3 TEXT, - thutimebegin3 TEXT, - thutimeend3 TEXT, - thugroupuuid3 TEXT, - fritimebegin3 TEXT, - fritimeend3 TEXT, - frigroupuuid3 TEXT, - sattimebegin3 TEXT, - sattimeend3 TEXT, - satgroupuuid3 TEXT, - suntimebegin3 TEXT, - suntimeend3 TEXT, - sungroupuuid3 TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "presence" ( - daydate DATE, - lunch BOOLEAN, - status INTEGER, - childuuid TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - begintime1 TEXT, - endtime1 TEXT, - begintime2 TEXT, - endtime2 TEXT, - editor TEXT, - PRIMARY KEY (daydate,childuuid) -); -CREATE TABLE IF NOT EXISTS "waitlist" ( - uuid TEXT NOT NULL, - waitdate DATE NOT NULL, - name TEXT, - phone TEXT, - email TEXT, - age TEXT, - note TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - editor TEXT, - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "costs" ( - startdate DATE, - costsperhour REAL, - weeklyhourslimit REAL, - dailylunchcosts REAL, - uuid TEXT NOT NULL, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - costperhourfallback REAL, - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "vacancycalendar" ( - uuid TEXT NOT NULL, - datefrom DATE, - dateto DATE, - timefrom TEXT, - timeto TEXT, - description TEXT, - staffuuid TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - type INTEGER, - accepted BOOLEAN DEFAULT '0', - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "staffvacancydays" ( - staffuuid TEXT, - vacancyyear INTEGER, - days REAL, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - hours REAL, - PRIMARY KEY (staffuuid,vacancyyear) -); -CREATE TABLE new_staff ( - jobtitle TEXT, - prename TEXT, - surname TEXT, - address TEXT, - zip TEXT, - city TEXT, - country TEXT, - entrydate DATE, - exitdate DATE, - iban TEXT, - bic TEXT, - accountname TEXT, - phone TEXT, - email TEXT, - uuid TEXT NOT NULL, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - color TEXT, - weekhours INTEGER, - password TEXT, - editor TEXT, - PRIMARY KEY (uuid) -); diff --git a/dev/db/lechatpotte.old.schema.sql b/dev/db/lechatpotte.old.schema.sql deleted file mode 100644 index 1ccd9ff..0000000 --- a/dev/db/lechatpotte.old.schema.sql +++ /dev/null @@ -1,580 +0,0 @@ -CREATE TABLE IF NOT EXISTS "creche" ( - crechename TEXT, - adress TEXT, - city TEXT, - country TEXT, - zip TEXT, - maxchilds INTEGER, - uuid TEXT NOT NULL, - minage INTEGER, - maxage INTEGER, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, editor TEXT, stafflist boolean, - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "eventcalendar" ( - uuid TEXT NOT NULL, - datefrom DATE, - dateto DATE, - timefrom TEXT, - timeto TEXT, - description TEXT, - activityuuid TEXT, - staffuuid TEXT, - location TEXT, - color TEXT, - freq TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "staffplanning" ( - eventcalendaruuid TEXT, - staffuuid TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (eventcalendaruuid,staffuuid) -); -CREATE TRIGGER trg_staffplanning_upd UPDATE ON staffplanning - BEGIN - UPDATE staffplanning set lastmodified=CURRENT_TIMESTAMP where eventcalendaruuid=NEW.eventcalendaruuid and staffuuid=NEW.staffuuid; - END; -CREATE TABLE IF NOT EXISTS "accounting" ( - accmonth DATE, - childuuid TEXT, - invoicedate DATE, - payeddate DATE, - payedamount REAL, - invoiceamount REAL, - reference TEXT, - reminderdate1 DATE, - reminderdate2 DATE, - reminderdate3 DATE, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - invoicefile TEXT, - benefitfile TEXT, - benefitamount REAL, - PRIMARY KEY (accmonth,childuuid) -); -CREATE TRIGGER trg_eventcalendar_upd UPDATE ON eventcalendar - BEGIN - UPDATE eventcalendar set lastmodified=CURRENT_TIMESTAMP where uuid=NEW.uuid; - END; -CREATE TRIGGER trg_accounting_upd UPDATE ON accounting - BEGIN - UPDATE accounting set lastmodified=CURRENT_TIMESTAMP where accmonth=NEW.accmonth and childuuid=NEW.childuuid; - END; -CREATE TABLE IF NOT EXISTS "expenses" ( - uuid TEXT, - expensedate DATE, - remitter TEXT, - expenseamount REAL - expensefile TEXT, - statementfile TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (uuid) -); -CREATE TRIGGER trg_expenses_upd UPDATE ON expenses - BEGIN - UPDATE expenses set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TABLE IF NOT EXISTS "vacancy" ( - vacancydate DATE, - vacancydateto DATE, - vacancydescription TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (vacancydate,vacancydateto) -); -CREATE TRIGGER trg_vacancy_upd UPDATE ON vacancy - BEGIN - UPDATE vacancy set lastmodified=CURRENT_TIMESTAMP where vacancydate = NEW.vacancydate and vacancydateto = NEW.vacancydateto; - END; -CREATE TABLE IF NOT EXISTS "staff" ( - jobtitle TEXT, - prename TEXT, - surname TEXT, - address TEXT, - zip TEXT, - city TEXT, - country TEXT, - entrydate DATE, - exitdate DATE, - iban TEXT, - bic TEXT, - accountname TEXT, - phone TEXT, - email TEXT, - uuid TEXT NOT NULL, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - color TEXT, - weekhours integer, password TEXT, editor TEXT, - PRIMARY KEY (uuid) -); -CREATE TRIGGER trg_staff_upd UPDATE ON staff - BEGIN - UPDATE staff set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TABLE IF NOT EXISTS "groups" ( - grpname TEXT, - maxchilds INTEGER, - minage INTEGER, - maxage INTEGER, - uuid TEXT NOT NULL, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, minstaff integer DEFAULT 1, color TEXT, - PRIMARY KEY (uuid) -); -CREATE TRIGGER trg_groups_upd UPDATE ON groups - BEGIN - UPDATE groups set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TABLE childslog ( - uuid TEXT not null, - logdate DATE, - logmessage TEXT, - childuuid TEXT, - editorstaffuuid TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, editor TEXT, - PRIMARY KEY (uuid) -); -CREATE TABLE stafflog ( - uuid TEXT not null, - logdate DATE, - logmessage TEXT, - staffuuid TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, editor TEXT, - PRIMARY KEY (uuid) -); -CREATE TRIGGER trg_childslog_upd UPDATE ON childslog - BEGIN - UPDATE childslog set lastmodified=CURRENT_TIMESTAMP where uuid=NEW.uuid; - END; -CREATE TABLE activitylog - ( - uuid TEXT NOT NULL, - logdatefrom DATETIME, - logdateto DATETIME, - logtitle TEXT, - logmessage TEXT, - editorstaffuuid TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, editor TEXT, - PRIMARY KEY (uuid) - ); -CREATE TRIGGER trg_activitylog_upd UPDATE ON activitylog - BEGIN - UPDATE activitylog set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TABLE cautionstatus ( - uuid TEXT NOT NULL, - childuuid TEXT, - statusdate DATE, - amount NUMERIC, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, statementnumber TEXT, - PRIMARY KEY (uuid) -); -CREATE TRIGGER trg_cautionstatus_upd UPDATE ON cautionstatus - BEGIN - UPDATE cautionstatus set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TABLE planningtemplate - ( - uuid TEXT NOT NULL, - montimebegin TEXT, - montimeend TEXT, - monlunch BOOLEAN, - tuetimebegin TEXT, - tuetimeend TEXT, - tuelunch BOOLEAN, - wedtimebegin TEXT, - wedtimeend TEXT, - wedlunch BOOLEAN, - thutimebegin TEXT, - thutimeend TEXT, - thulunch BOOLEAN, - fritimebegin TEXT, - fritimeend TEXT, - frilunch BOOLEAN, - sattimebegin TEXT, - sattimeend TEXT, - satlunch BOOLEAN, - suntimebegin TEXT, - suntimeend TEXT, - sunlunch BOOLEAN, - montimebegin2 TEXT, - montimeend2 TEXT, - tuetimebegin2 TEXT, - tuetimeend2 TEXT, - wedtimebegin2 TEXT, - wedtimeend2 TEXT, - thutimebegin2 TEXT, - thutimeend2 TEXT, - fritimebegin2 TEXT, - fritimeend2 TEXT, - sattimebegin2 TEXT, - sattimeend2 TEXT, - suntimebegin2 TEXT, - suntimeend2 TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, templatename TEXT, - PRIMARY KEY (uuid) - ); -CREATE TRIGGER trg_planningtemplate_upd UPDATE ON planningtemplate - BEGIN - UPDATE planningtemplate set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TABLE messagelog - ( - uuid TEXT NOT NULL, - logdate DATETIME, - logtitle TEXT, - logmessage TEXT, - editorstaffuuid TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, editor TEXT, - PRIMARY KEY (uuid) - ); -CREATE TRIGGER trg_message_upd UPDATE ON messagelog - BEGIN - UPDATE messagelog set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TABLE IF NOT EXISTS "childs" ( - clientnumber TEXT, - prename TEXT, - surname TEXT, - birthday DATE, - address TEXT, - city TEXT, - zip TEXT, - country TEXT, - entrydate DATE, - checkservicenumber TEXT, - leavedate DATE, - nationality TEXT, - nativelanguage TEXT, - bankaccount TEXT, - bankbic TEXT, - cautionamount NUMERIC, - cautionpayed NUMERIC, - cautionremark TEXT, - cautionpayedback TEXT, - cautionstatusdate DATE, - remark TEXT, - checkserviceexpiration DATE, - uuid TEXT NOT NULL, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - infohealth TEXT, - bankaccountowner TEXT, - infoimportant TEXT, - infolunch TEXT, - editor TEXT, - PRIMARY KEY (uuid) -); -CREATE TABLE new_refpersons ( - reftype TEXT, - surname TEXT, - prename TEXT, - address TEXT, - phone TEXT, - mobile TEXT, - job TEXT, - email TEXT, - workphone TEXT, - zip TEXT, - country TEXT, - city TEXT, - authsubscriber BOOLEAN, - childuuid TEXT, - uuid TEXT NOT NULL, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - remark TEXT, - priority INTEGER, - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "refpersons" ( - reftype TEXT, - surname TEXT, - prename TEXT, - address TEXT, - phone TEXT, - mobile TEXT, - job TEXT, - email TEXT, - workphone TEXT, - zip TEXT, - country TEXT, - city TEXT, - authsubscriber BOOLEAN, - childuuid TEXT, - uuid TEXT NOT NULL, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - remark TEXT, - priority INTEGER, - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "workinghours" ( - uuid TEXT NOT NULL, - datestart DATE NOT NULL, - montimeopen TEXT, - montimeclose TEXT, - tuetimeopen TEXT, - tuetimeclose TEXT, - wedtimeopen TEXT, - wedtimeclose TEXT, - thutimeopen TEXT, - thutimeclose TEXT, - fritimeopen TEXT, - fritimeclose TEXT, - sattimeopen TEXT, - sattimeclose TEXT, - suntimeopen TEXT, - suntimeclose TEXT, - crecheuuid TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (uuid) -); -CREATE TABLE new_planning ( - datebegin DATE, - dateend DATE, - montimebegin TEXT, - montimeend TEXT, - monlunch BOOLEAN, - tuetimebegin TEXT, - tuetimeend TEXT, - tuelunch BOOLEAN, - wedtimebegin TEXT, - wedtimeend TEXT, - wedlunch BOOLEAN, - thutimebegin TEXT, - thutimeend TEXT, - thulunch BOOLEAN, - fritimebegin TEXT, - fritimeend TEXT, - frilunch BOOLEAN, - sattimebegin TEXT, - sattimeend TEXT, - satlunch BOOLEAN, - suntimebegin TEXT, - suntimeend TEXT, - sunlunch BOOLEAN, - childuuid TEXT, - uuid TEXT NOT NULL, - groupuuid TEXT, - montimebegin2 TEXT, - montimeend2 TEXT, - tuetimebegin2 TEXT, - tuetimeend2 TEXT, - wedtimebegin2 TEXT, - wedtimeend2 TEXT, - thutimebegin2 TEXT, - thutimeend2 TEXT, - fritimebegin2 TEXT, - fritimeend2 TEXT, - sattimebegin2 TEXT, - sattimeend2 TEXT, - suntimebegin2 TEXT, - suntimeend2 TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "planning" ( - datebegin DATE, - dateend DATE, - montimebegin TEXT, - montimeend TEXT, - monlunch BOOLEAN, - tuetimebegin TEXT, - tuetimeend TEXT, - tuelunch BOOLEAN, - wedtimebegin TEXT, - wedtimeend TEXT, - wedlunch BOOLEAN, - thutimebegin TEXT, - thutimeend TEXT, - thulunch BOOLEAN, - fritimebegin TEXT, - fritimeend TEXT, - frilunch BOOLEAN, - sattimebegin TEXT, - sattimeend TEXT, - satlunch BOOLEAN, - suntimebegin TEXT, - suntimeend TEXT, - sunlunch BOOLEAN, - childuuid TEXT, - uuid TEXT NOT NULL, - groupuuid TEXT, - montimebegin2 TEXT, - montimeend2 TEXT, - tuetimebegin2 TEXT, - tuetimeend2 TEXT, - wedtimebegin2 TEXT, - wedtimeend2 TEXT, - thutimebegin2 TEXT, - thutimeend2 TEXT, - fritimebegin2 TEXT, - fritimeend2 TEXT, - sattimebegin2 TEXT, - sattimeend2 TEXT, - suntimebegin2 TEXT, - suntimeend2 TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "health" ( - uuid TEXT NOT NULL, - docname TEXT, - docaddress TEXT, - docphone TEXT, - doczip TEXT, - doccountry TEXT, - doccity TEXT, - healthinfo TEXT, - childuuid TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "planningstaff" ( - uuid TEXT NOT NULL, - staffuuid TEXT NOT NULL, - note TEXT, - datebegin DATE, - dateend DATE, - montimebegin TEXT, - montimeend TEXT, - mongroupuuid TEXT, - tuetimebegin TEXT, - tuetimeend TEXT, - tuegroupuuid TEXT, - wedtimebegin TEXT, - wedtimeend TEXT, - wedgroupuuid TEXT, - thutimebegin TEXT, - thutimeend TEXT, - thugroupuuid TEXT, - fritimebegin TEXT, - fritimeend TEXT, - frigroupuuid TEXT, - sattimebegin TEXT, - sattimeend TEXT, - satgroupuuid TEXT, - suntimebegin TEXT, - suntimeend TEXT, - sungroupuuid TEXT, - montimebegin2 TEXT, - montimeend2 TEXT, - mongroupuuid2 TEXT, - tuetimebegin2 TEXT, - tuetimeend2 TEXT, - tuegroupuuid2 TEXT, - wedtimebegin2 TEXT, - wedtimeend2 TEXT, - wedgroupuuid2 TEXT, - thutimebegin2 TEXT, - thutimeend2 TEXT, - thugroupuuid2 TEXT, - fritimebegin2 TEXT, - fritimeend2 TEXT, - frigroupuuid2 TEXT, - sattimebegin2 TEXT, - sattimeend2 TEXT, - satgroupuuid2 TEXT, - suntimebegin2 TEXT, - suntimeend2 TEXT, - sungroupuuid2 TEXT, - montimebegin3 TEXT, - montimeend3 TEXT, - mongroupuuid3 TEXT, - tuetimebegin3 TEXT, - tuetimeend3 TEXT, - tuegroupuuid3 TEXT, - wedtimebegin3 TEXT, - wedtimeend3 TEXT, - wedgroupuuid3 TEXT, - thutimebegin3 TEXT, - thutimeend3 TEXT, - thugroupuuid3 TEXT, - fritimebegin3 TEXT, - fritimeend3 TEXT, - frigroupuuid3 TEXT, - sattimebegin3 TEXT, - sattimeend3 TEXT, - satgroupuuid3 TEXT, - suntimebegin3 TEXT, - suntimeend3 TEXT, - sungroupuuid3 TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "presence" ( - daydate DATE, - lunch BOOLEAN, - status INTEGER, - childuuid TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - begintime1 TEXT, - endtime1 TEXT, - begintime2 TEXT, - endtime2 TEXT, - editor TEXT, - PRIMARY KEY (daydate,childuuid) -); -CREATE TABLE IF NOT EXISTS "waitlist" ( - uuid TEXT NOT NULL, - waitdate DATE NOT NULL, - name TEXT, - phone TEXT, - email TEXT, - age TEXT, - note TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - editor TEXT, - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "costs" ( - startdate DATE, - costsperhour REAL, - weeklyhourslimit REAL, - dailylunchcosts REAL, - uuid TEXT NOT NULL, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - costperhourfallback REAL, - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "vacancycalendar" ( - uuid TEXT NOT NULL, - datefrom DATE, - dateto DATE, - timefrom TEXT, - timeto TEXT, - description TEXT, - staffuuid TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - type INTEGER, - accepted BOOLEAN DEFAULT '0', - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "staffvacancydays" ( - staffuuid TEXT, - vacancyyear INTEGER, - days REAL, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - hours REAL, - PRIMARY KEY (staffuuid,vacancyyear) -); -CREATE TABLE new_staff ( - jobtitle TEXT, - prename TEXT, - surname TEXT, - address TEXT, - zip TEXT, - city TEXT, - country TEXT, - entrydate DATE, - exitdate DATE, - iban TEXT, - bic TEXT, - accountname TEXT, - phone TEXT, - email TEXT, - uuid TEXT NOT NULL, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - color TEXT, - weekhours INTEGER, - password TEXT, - editor TEXT, - PRIMARY KEY (uuid) -); diff --git a/dev/db/lechatpotte.old.sqlite b/dev/db/lechatpotte.old.sqlite deleted file mode 100644 index cb31cf9..0000000 Binary files a/dev/db/lechatpotte.old.sqlite and /dev/null differ diff --git a/dev/db/underatert.new.schema.sql b/dev/db/underatert.new.schema.sql deleted file mode 100644 index 4247ceb..0000000 --- a/dev/db/underatert.new.schema.sql +++ /dev/null @@ -1,520 +0,0 @@ -CREATE TABLE IF NOT EXISTS "creche" ( - crechename TEXT, - adress TEXT, - city TEXT, - country TEXT, - zip TEXT, - maxchilds INTEGER, - uuid TEXT NOT NULL, - minage INTEGER, - maxage INTEGER, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, editor TEXT, stafflist boolean, idcheckservice TEXT, - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "childs" ( - clientnumber TEXT, - prename TEXT, - surname TEXT, - birthday DATE, - address TEXT, - city TEXT, - zip TEXT, - country TEXT, - entrydate DATE, - checkservicenumber TEXT, - leavedate DATE, - nationality TEXT, - nativelanguage TEXT, - bankaccount TEXT, - bankbic TEXT, - cautionamount NUMERIC, - cautionpayed NUMERIC, - cautionremark TEXT, - cautionpayedback TEXT, - cautionstatusdate DATE, - remark TEXT, - checkserviceexpiration DATE, - uuid TEXT NOT NULL, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, infohealth TEXT, bankaccountowner TEXT, infoimportant TEXT, infolunch TEXT, editor TEXT, - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "refpersons" ( - reftype TEXT, - surname TEXT, - prename TEXT, - address TEXT, - phone TEXT, - mobile TEXT, - job TEXT, - email TEXT, - workphone TEXT, - zip TEXT, - country TEXT, - city TEXT, - authsubscriber BOOLEAN, - childuuid TEXT, - uuid TEXT NOT NULL, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, remark TEXT, priority INTEGER, - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "workinghours" ( - uuid TEXT NOT NULL, - datestart DATE NOT NULL, - montimeopen TEXT, - montimeclose TEXT, - tuetimeopen TEXT, - tuetimeclose TEXT, - wedtimeopen TEXT, - wedtimeclose TEXT, - thutimeopen TEXT, - thutimeclose TEXT, - fritimeopen TEXT, - fritimeclose TEXT, - sattimeopen TEXT, - sattimeclose TEXT, - suntimeopen TEXT, - suntimeclose TEXT, - crecheuuid TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "planning" ( - datebegin DATE, - dateend DATE, - montimebegin TEXT, - montimeend TEXT, - monlunch BOOLEAN, - tuetimebegin TEXT, - tuetimeend TEXT, - tuelunch BOOLEAN, - wedtimebegin TEXT, - wedtimeend TEXT, - wedlunch BOOLEAN, - thutimebegin TEXT, - thutimeend TEXT, - thulunch BOOLEAN, - fritimebegin TEXT, - fritimeend TEXT, - frilunch BOOLEAN, - sattimebegin TEXT, - sattimeend TEXT, - satlunch BOOLEAN, - suntimebegin TEXT, - suntimeend TEXT, - sunlunch BOOLEAN, - childuuid TEXT, - uuid TEXT NOT NULL, - groupuuid TEXT, - montimebegin2 TEXT, - montimeend2 TEXT, - tuetimebegin2 TEXT, - tuetimeend2 TEXT, - wedtimebegin2 TEXT, - wedtimeend2 TEXT, - thutimebegin2 TEXT, - thutimeend2 TEXT, - fritimebegin2 TEXT, - fritimeend2 TEXT, - sattimebegin2 TEXT, - sattimeend2 TEXT, - suntimebegin2 TEXT, - suntimeend2 TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "health" ( - uuid TEXT NOT NULL, - docname TEXT, - docaddress TEXT, - docphone TEXT, - doczip TEXT, - doccountry TEXT, - doccity TEXT, - healthinfo TEXT, - childuuid TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "planningstaff" ( - uuid TEXT NOT NULL, - staffuuid TEXT NOT NULL, - note TEXT, - datebegin DATE, - dateend DATE, - montimebegin TEXT, - montimeend TEXT, - mongroupuuid TEXT, - tuetimebegin TEXT, - tuetimeend TEXT, - tuegroupuuid TEXT, - wedtimebegin TEXT, - wedtimeend TEXT, - wedgroupuuid TEXT, - thutimebegin TEXT, - thutimeend TEXT, - thugroupuuid TEXT, - fritimebegin TEXT, - fritimeend TEXT, - frigroupuuid TEXT, - sattimebegin TEXT, - sattimeend TEXT, - satgroupuuid TEXT, - suntimebegin TEXT, - suntimeend TEXT, - sungroupuuid TEXT, - montimebegin2 TEXT, - montimeend2 TEXT, - mongroupuuid2 TEXT, - tuetimebegin2 TEXT, - tuetimeend2 TEXT, - tuegroupuuid2 TEXT, - wedtimebegin2 TEXT, - wedtimeend2 TEXT, - wedgroupuuid2 TEXT, - thutimebegin2 TEXT, - thutimeend2 TEXT, - thugroupuuid2 TEXT, - fritimebegin2 TEXT, - fritimeend2 TEXT, - frigroupuuid2 TEXT, - sattimebegin2 TEXT, - sattimeend2 TEXT, - satgroupuuid2 TEXT, - suntimebegin2 TEXT, - suntimeend2 TEXT, - sungroupuuid2 TEXT, - montimebegin3 TEXT, - montimeend3 TEXT, - mongroupuuid3 TEXT, - tuetimebegin3 TEXT, - tuetimeend3 TEXT, - tuegroupuuid3 TEXT, - wedtimebegin3 TEXT, - wedtimeend3 TEXT, - wedgroupuuid3 TEXT, - thutimebegin3 TEXT, - thutimeend3 TEXT, - thugroupuuid3 TEXT, - fritimebegin3 TEXT, - fritimeend3 TEXT, - frigroupuuid3 TEXT, - sattimebegin3 TEXT, - sattimeend3 TEXT, - satgroupuuid3 TEXT, - suntimebegin3 TEXT, - suntimeend3 TEXT, - sungroupuuid3 TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "presence" ( - daydate DATE, - lunch BOOLEAN, - status INTEGER, - childuuid TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, begintime1 TEXT, endtime1 TEXT, begintime2 TEXT, endtime2 TEXT, editor TEXT, - PRIMARY KEY (daydate,childuuid) -); -CREATE TABLE IF NOT EXISTS "waitlist" ( - uuid TEXT NOT NULL, - waitdate DATE NOT NULL, - name TEXT, - phone TEXT, - email TEXT, - age TEXT, - note TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, editor TEXT, - PRIMARY KEY (uuid) -); -CREATE TRIGGER trg_childs_upd UPDATE ON childs - BEGIN - UPDATE childs set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TRIGGER trg_waitlist_upd UPDATE ON waitlist - BEGIN - UPDATE waitlist set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TRIGGER trg_refpersons_upd UPDATE ON refpersons - BEGIN - UPDATE refpersons set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TRIGGER trg_presence_upd UPDATE ON presence - BEGIN - UPDATE presence set lastmodified=CURRENT_TIMESTAMP where daydate = NEW.daydate and childuuid = new.childuuid; - END; -CREATE TRIGGER trg_planningstaff_upd UPDATE ON planningstaff - BEGIN - UPDATE planningstaff set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TRIGGER trg_planning_upd UPDATE ON planning - BEGIN - UPDATE planning set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TRIGGER trg_health_upd UPDATE ON health - BEGIN - UPDATE health set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TABLE IF NOT EXISTS "eventcalendar" ( - uuid TEXT NOT NULL, - datefrom DATE, - dateto DATE, - timefrom TEXT, - timeto TEXT, - description TEXT, - activityuuid TEXT, - staffuuid TEXT, - location TEXT, - color TEXT, - freq TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "staffplanning" ( - eventcalendaruuid TEXT, - staffuuid TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (eventcalendaruuid,staffuuid) -); -CREATE TRIGGER trg_staffplanning_upd UPDATE ON staffplanning - BEGIN - UPDATE staffplanning set lastmodified=CURRENT_TIMESTAMP where eventcalendaruuid=NEW.eventcalendaruuid and staffuuid=NEW.staffuuid; - END; -CREATE TABLE IF NOT EXISTS "accounting" ( - accmonth DATE, - childuuid TEXT, - invoicedate DATE, - payeddate DATE, - payedamount REAL, - invoiceamount REAL, - reference TEXT, - reminderdate1 DATE, - reminderdate2 DATE, - reminderdate3 DATE, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - invoicefile TEXT, - benefitfile TEXT, - benefitamount REAL, idcheckservice TEXT, - PRIMARY KEY (accmonth,childuuid) -); -CREATE TRIGGER trg_eventcalendar_upd UPDATE ON eventcalendar - BEGIN - UPDATE eventcalendar set lastmodified=CURRENT_TIMESTAMP where uuid=NEW.uuid; - END; -CREATE TRIGGER trg_accounting_upd UPDATE ON accounting - BEGIN - UPDATE accounting set lastmodified=CURRENT_TIMESTAMP where accmonth=NEW.accmonth and childuuid=NEW.childuuid; - END; -CREATE TABLE IF NOT EXISTS "costs" ( - startdate DATE, - costsperhour REAL, - weeklyhourslimit REAL, - dailylunchcosts REAL, - uuid TEXT NOT NULL, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - costperhourfallback REAL, - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "vacancycalendar" ( - uuid TEXT NOT NULL, - datefrom DATE, - dateto DATE, - timefrom TEXT, - timeto TEXT, - description TEXT, - staffuuid TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, type integer, accepted BOOLEAN DEFAULT '0', vacyear integer, - PRIMARY KEY (uuid) -); -CREATE TRIGGER trg_creche_upd UPDATE ON costs - BEGIN - UPDATE creche set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TRIGGER trg_costs_upd UPDATE ON costs - BEGIN - UPDATE costs set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TRIGGER trg_vacancycalendar_upd UPDATE ON vacancycalendar - BEGIN - UPDATE vacancycalendar set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TABLE IF NOT EXISTS "staffvacancydays" ( - staffuuid TEXT, - vacancyyear integer, - days real, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, hours real, - PRIMARY KEY (staffuuid,vacancyyear) -); -CREATE TRIGGER trg_staffvacancydays_upd UPDATE ON staffvacancydays - BEGIN - UPDATE staffvacancydays set lastmodified=CURRENT_TIMESTAMP where staffuuid = NEW.staffuuid and vacancyyear = NEW.vacancyyear; - END; -CREATE TABLE IF NOT EXISTS "expenses" ( - uuid TEXT, - expensedate DATE, - remitter TEXT, - expenseamount REAL - expensefile TEXT, - statementfile TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (uuid) -); -CREATE TRIGGER trg_expenses_upd UPDATE ON expenses - BEGIN - UPDATE expenses set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TABLE IF NOT EXISTS "vacancy" ( - vacancydate DATE, - vacancydateto DATE, - vacancydescription TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (vacancydate,vacancydateto) -); -CREATE TRIGGER trg_vacancy_upd UPDATE ON vacancy - BEGIN - UPDATE vacancy set lastmodified=CURRENT_TIMESTAMP where vacancydate = NEW.vacancydate and vacancydateto = NEW.vacancydateto; - END; -CREATE TABLE IF NOT EXISTS "staff" ( - jobtitle TEXT, - prename TEXT, - surname TEXT, - address TEXT, - zip TEXT, - city TEXT, - country TEXT, - entrydate DATE, - exitdate DATE, - iban TEXT, - bic TEXT, - accountname TEXT, - phone TEXT, - email TEXT, - uuid TEXT NOT NULL, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - color TEXT, - weekhours integer, password TEXT, editor TEXT, maxdayhours real, - PRIMARY KEY (uuid) -); -CREATE TRIGGER trg_staff_upd UPDATE ON staff - BEGIN - UPDATE staff set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TABLE IF NOT EXISTS "groups" ( - grpname TEXT, - maxchilds INTEGER, - minage INTEGER, - maxage INTEGER, - uuid TEXT NOT NULL, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, minstaff integer DEFAULT 1, color TEXT, - PRIMARY KEY (uuid) -); -CREATE TRIGGER trg_groups_upd UPDATE ON groups - BEGIN - UPDATE groups set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TABLE childslog ( - uuid TEXT not null, - logdate DATE, - logmessage TEXT, - childuuid TEXT, - editorstaffuuid TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, editor TEXT, - PRIMARY KEY (uuid) -); -CREATE TABLE stafflog ( - uuid TEXT not null, - logdate DATE, - logmessage TEXT, - staffuuid TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, editor TEXT, - PRIMARY KEY (uuid) -); -CREATE TRIGGER trg_childslog_upd UPDATE ON childslog - BEGIN - UPDATE childslog set lastmodified=CURRENT_TIMESTAMP where uuid=NEW.uuid; - END; -CREATE TABLE activitylog - ( - uuid TEXT NOT NULL, - logdatefrom DATETIME, - logdateto DATETIME, - logtitle TEXT, - logmessage TEXT, - editorstaffuuid TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, editor TEXT, - PRIMARY KEY (uuid) - ); -CREATE TRIGGER trg_activitylog_upd UPDATE ON activitylog - BEGIN - UPDATE activitylog set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TABLE cautionstatus ( - uuid TEXT NOT NULL, - childuuid TEXT, - statusdate DATE, - amount NUMERIC, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, statementnumber TEXT, - PRIMARY KEY (uuid) -); -CREATE TRIGGER trg_cautionstatus_upd UPDATE ON cautionstatus - BEGIN - UPDATE cautionstatus set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TABLE planningtemplate - ( - uuid TEXT NOT NULL, - montimebegin TEXT, - montimeend TEXT, - monlunch BOOLEAN, - tuetimebegin TEXT, - tuetimeend TEXT, - tuelunch BOOLEAN, - wedtimebegin TEXT, - wedtimeend TEXT, - wedlunch BOOLEAN, - thutimebegin TEXT, - thutimeend TEXT, - thulunch BOOLEAN, - fritimebegin TEXT, - fritimeend TEXT, - frilunch BOOLEAN, - sattimebegin TEXT, - sattimeend TEXT, - satlunch BOOLEAN, - suntimebegin TEXT, - suntimeend TEXT, - sunlunch BOOLEAN, - montimebegin2 TEXT, - montimeend2 TEXT, - tuetimebegin2 TEXT, - tuetimeend2 TEXT, - wedtimebegin2 TEXT, - wedtimeend2 TEXT, - thutimebegin2 TEXT, - thutimeend2 TEXT, - fritimebegin2 TEXT, - fritimeend2 TEXT, - sattimebegin2 TEXT, - sattimeend2 TEXT, - suntimebegin2 TEXT, - suntimeend2 TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, templatename TEXT, - PRIMARY KEY (uuid) - ); -CREATE TRIGGER trg_planningtemplate_upd UPDATE ON planningtemplate - BEGIN - UPDATE planningtemplate set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TABLE messagelog - ( - uuid TEXT NOT NULL, - logdate DATETIME, - logtitle TEXT, - logmessage TEXT, - editorstaffuuid TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, editor TEXT, - PRIMARY KEY (uuid) - ); -CREATE TRIGGER trg_message_upd UPDATE ON messagelog - BEGIN - UPDATE messagelog set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; diff --git a/dev/db/underatert.old.schema.sql b/dev/db/underatert.old.schema.sql deleted file mode 100644 index 6384a9c..0000000 --- a/dev/db/underatert.old.schema.sql +++ /dev/null @@ -1,520 +0,0 @@ -CREATE TABLE IF NOT EXISTS "creche" ( - crechename TEXT, - adress TEXT, - city TEXT, - country TEXT, - zip TEXT, - maxchilds INTEGER, - uuid TEXT NOT NULL, - minage INTEGER, - maxage INTEGER, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, editor TEXT, stafflist boolean, - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "childs" ( - clientnumber TEXT, - prename TEXT, - surname TEXT, - birthday DATE, - address TEXT, - city TEXT, - zip TEXT, - country TEXT, - entrydate DATE, - checkservicenumber TEXT, - leavedate DATE, - nationality TEXT, - nativelanguage TEXT, - bankaccount TEXT, - bankbic TEXT, - cautionamount NUMERIC, - cautionpayed NUMERIC, - cautionremark TEXT, - cautionpayedback TEXT, - cautionstatusdate DATE, - remark TEXT, - checkserviceexpiration DATE, - uuid TEXT NOT NULL, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, infohealth TEXT, bankaccountowner TEXT, infoimportant TEXT, infolunch TEXT, editor TEXT, - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "refpersons" ( - reftype TEXT, - surname TEXT, - prename TEXT, - address TEXT, - phone TEXT, - mobile TEXT, - job TEXT, - email TEXT, - workphone TEXT, - zip TEXT, - country TEXT, - city TEXT, - authsubscriber BOOLEAN, - childuuid TEXT, - uuid TEXT NOT NULL, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, remark TEXT, priority INTEGER, - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "workinghours" ( - uuid TEXT NOT NULL, - datestart DATE NOT NULL, - montimeopen TEXT, - montimeclose TEXT, - tuetimeopen TEXT, - tuetimeclose TEXT, - wedtimeopen TEXT, - wedtimeclose TEXT, - thutimeopen TEXT, - thutimeclose TEXT, - fritimeopen TEXT, - fritimeclose TEXT, - sattimeopen TEXT, - sattimeclose TEXT, - suntimeopen TEXT, - suntimeclose TEXT, - crecheuuid TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "planning" ( - datebegin DATE, - dateend DATE, - montimebegin TEXT, - montimeend TEXT, - monlunch BOOLEAN, - tuetimebegin TEXT, - tuetimeend TEXT, - tuelunch BOOLEAN, - wedtimebegin TEXT, - wedtimeend TEXT, - wedlunch BOOLEAN, - thutimebegin TEXT, - thutimeend TEXT, - thulunch BOOLEAN, - fritimebegin TEXT, - fritimeend TEXT, - frilunch BOOLEAN, - sattimebegin TEXT, - sattimeend TEXT, - satlunch BOOLEAN, - suntimebegin TEXT, - suntimeend TEXT, - sunlunch BOOLEAN, - childuuid TEXT, - uuid TEXT NOT NULL, - groupuuid TEXT, - montimebegin2 TEXT, - montimeend2 TEXT, - tuetimebegin2 TEXT, - tuetimeend2 TEXT, - wedtimebegin2 TEXT, - wedtimeend2 TEXT, - thutimebegin2 TEXT, - thutimeend2 TEXT, - fritimebegin2 TEXT, - fritimeend2 TEXT, - sattimebegin2 TEXT, - sattimeend2 TEXT, - suntimebegin2 TEXT, - suntimeend2 TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "health" ( - uuid TEXT NOT NULL, - docname TEXT, - docaddress TEXT, - docphone TEXT, - doczip TEXT, - doccountry TEXT, - doccity TEXT, - healthinfo TEXT, - childuuid TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "planningstaff" ( - uuid TEXT NOT NULL, - staffuuid TEXT NOT NULL, - note TEXT, - datebegin DATE, - dateend DATE, - montimebegin TEXT, - montimeend TEXT, - mongroupuuid TEXT, - tuetimebegin TEXT, - tuetimeend TEXT, - tuegroupuuid TEXT, - wedtimebegin TEXT, - wedtimeend TEXT, - wedgroupuuid TEXT, - thutimebegin TEXT, - thutimeend TEXT, - thugroupuuid TEXT, - fritimebegin TEXT, - fritimeend TEXT, - frigroupuuid TEXT, - sattimebegin TEXT, - sattimeend TEXT, - satgroupuuid TEXT, - suntimebegin TEXT, - suntimeend TEXT, - sungroupuuid TEXT, - montimebegin2 TEXT, - montimeend2 TEXT, - mongroupuuid2 TEXT, - tuetimebegin2 TEXT, - tuetimeend2 TEXT, - tuegroupuuid2 TEXT, - wedtimebegin2 TEXT, - wedtimeend2 TEXT, - wedgroupuuid2 TEXT, - thutimebegin2 TEXT, - thutimeend2 TEXT, - thugroupuuid2 TEXT, - fritimebegin2 TEXT, - fritimeend2 TEXT, - frigroupuuid2 TEXT, - sattimebegin2 TEXT, - sattimeend2 TEXT, - satgroupuuid2 TEXT, - suntimebegin2 TEXT, - suntimeend2 TEXT, - sungroupuuid2 TEXT, - montimebegin3 TEXT, - montimeend3 TEXT, - mongroupuuid3 TEXT, - tuetimebegin3 TEXT, - tuetimeend3 TEXT, - tuegroupuuid3 TEXT, - wedtimebegin3 TEXT, - wedtimeend3 TEXT, - wedgroupuuid3 TEXT, - thutimebegin3 TEXT, - thutimeend3 TEXT, - thugroupuuid3 TEXT, - fritimebegin3 TEXT, - fritimeend3 TEXT, - frigroupuuid3 TEXT, - sattimebegin3 TEXT, - sattimeend3 TEXT, - satgroupuuid3 TEXT, - suntimebegin3 TEXT, - suntimeend3 TEXT, - sungroupuuid3 TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "presence" ( - daydate DATE, - lunch BOOLEAN, - status INTEGER, - childuuid TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, begintime1 TEXT, endtime1 TEXT, begintime2 TEXT, endtime2 TEXT, editor TEXT, - PRIMARY KEY (daydate,childuuid) -); -CREATE TABLE IF NOT EXISTS "waitlist" ( - uuid TEXT NOT NULL, - waitdate DATE NOT NULL, - name TEXT, - phone TEXT, - email TEXT, - age TEXT, - note TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, editor TEXT, - PRIMARY KEY (uuid) -); -CREATE TRIGGER trg_childs_upd UPDATE ON childs - BEGIN - UPDATE childs set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TRIGGER trg_waitlist_upd UPDATE ON waitlist - BEGIN - UPDATE waitlist set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TRIGGER trg_refpersons_upd UPDATE ON refpersons - BEGIN - UPDATE refpersons set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TRIGGER trg_presence_upd UPDATE ON presence - BEGIN - UPDATE presence set lastmodified=CURRENT_TIMESTAMP where daydate = NEW.daydate and childuuid = new.childuuid; - END; -CREATE TRIGGER trg_planningstaff_upd UPDATE ON planningstaff - BEGIN - UPDATE planningstaff set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TRIGGER trg_planning_upd UPDATE ON planning - BEGIN - UPDATE planning set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TRIGGER trg_health_upd UPDATE ON health - BEGIN - UPDATE health set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TABLE IF NOT EXISTS "eventcalendar" ( - uuid TEXT NOT NULL, - datefrom DATE, - dateto DATE, - timefrom TEXT, - timeto TEXT, - description TEXT, - activityuuid TEXT, - staffuuid TEXT, - location TEXT, - color TEXT, - freq TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "staffplanning" ( - eventcalendaruuid TEXT, - staffuuid TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (eventcalendaruuid,staffuuid) -); -CREATE TRIGGER trg_staffplanning_upd UPDATE ON staffplanning - BEGIN - UPDATE staffplanning set lastmodified=CURRENT_TIMESTAMP where eventcalendaruuid=NEW.eventcalendaruuid and staffuuid=NEW.staffuuid; - END; -CREATE TABLE IF NOT EXISTS "accounting" ( - accmonth DATE, - childuuid TEXT, - invoicedate DATE, - payeddate DATE, - payedamount REAL, - invoiceamount REAL, - reference TEXT, - reminderdate1 DATE, - reminderdate2 DATE, - reminderdate3 DATE, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - invoicefile TEXT, - benefitfile TEXT, - benefitamount REAL, - PRIMARY KEY (accmonth,childuuid) -); -CREATE TRIGGER trg_eventcalendar_upd UPDATE ON eventcalendar - BEGIN - UPDATE eventcalendar set lastmodified=CURRENT_TIMESTAMP where uuid=NEW.uuid; - END; -CREATE TRIGGER trg_accounting_upd UPDATE ON accounting - BEGIN - UPDATE accounting set lastmodified=CURRENT_TIMESTAMP where accmonth=NEW.accmonth and childuuid=NEW.childuuid; - END; -CREATE TABLE IF NOT EXISTS "costs" ( - startdate DATE, - costsperhour REAL, - weeklyhourslimit REAL, - dailylunchcosts REAL, - uuid TEXT NOT NULL, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - costperhourfallback REAL, - PRIMARY KEY (uuid) -); -CREATE TABLE IF NOT EXISTS "vacancycalendar" ( - uuid TEXT NOT NULL, - datefrom DATE, - dateto DATE, - timefrom TEXT, - timeto TEXT, - description TEXT, - staffuuid TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, type integer, accepted BOOLEAN DEFAULT '0', - PRIMARY KEY (uuid) -); -CREATE TRIGGER trg_creche_upd UPDATE ON costs - BEGIN - UPDATE creche set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TRIGGER trg_costs_upd UPDATE ON costs - BEGIN - UPDATE costs set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TRIGGER trg_vacancycalendar_upd UPDATE ON vacancycalendar - BEGIN - UPDATE vacancycalendar set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TABLE IF NOT EXISTS "staffvacancydays" ( - staffuuid TEXT, - vacancyyear integer, - days real, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, hours real, - PRIMARY KEY (staffuuid,vacancyyear) -); -CREATE TRIGGER trg_staffvacancydays_upd UPDATE ON staffvacancydays - BEGIN - UPDATE staffvacancydays set lastmodified=CURRENT_TIMESTAMP where staffuuid = NEW.staffuuid and vacancyyear = NEW.vacancyyear; - END; -CREATE TABLE IF NOT EXISTS "expenses" ( - uuid TEXT, - expensedate DATE, - remitter TEXT, - expenseamount REAL - expensefile TEXT, - statementfile TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (uuid) -); -CREATE TRIGGER trg_expenses_upd UPDATE ON expenses - BEGIN - UPDATE expenses set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TABLE IF NOT EXISTS "vacancy" ( - vacancydate DATE, - vacancydateto DATE, - vacancydescription TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (vacancydate,vacancydateto) -); -CREATE TRIGGER trg_vacancy_upd UPDATE ON vacancy - BEGIN - UPDATE vacancy set lastmodified=CURRENT_TIMESTAMP where vacancydate = NEW.vacancydate and vacancydateto = NEW.vacancydateto; - END; -CREATE TABLE IF NOT EXISTS "staff" ( - jobtitle TEXT, - prename TEXT, - surname TEXT, - address TEXT, - zip TEXT, - city TEXT, - country TEXT, - entrydate DATE, - exitdate DATE, - iban TEXT, - bic TEXT, - accountname TEXT, - phone TEXT, - email TEXT, - uuid TEXT NOT NULL, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, - color TEXT, - weekhours integer, password TEXT, editor TEXT, - PRIMARY KEY (uuid) -); -CREATE TRIGGER trg_staff_upd UPDATE ON staff - BEGIN - UPDATE staff set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TABLE IF NOT EXISTS "groups" ( - grpname TEXT, - maxchilds INTEGER, - minage INTEGER, - maxage INTEGER, - uuid TEXT NOT NULL, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, minstaff integer DEFAULT 1, color TEXT, - PRIMARY KEY (uuid) -); -CREATE TRIGGER trg_groups_upd UPDATE ON groups - BEGIN - UPDATE groups set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TABLE childslog ( - uuid TEXT not null, - logdate DATE, - logmessage TEXT, - childuuid TEXT, - editorstaffuuid TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, editor TEXT, - PRIMARY KEY (uuid) -); -CREATE TABLE stafflog ( - uuid TEXT not null, - logdate DATE, - logmessage TEXT, - staffuuid TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, editor TEXT, - PRIMARY KEY (uuid) -); -CREATE TRIGGER trg_childslog_upd UPDATE ON childslog - BEGIN - UPDATE childslog set lastmodified=CURRENT_TIMESTAMP where uuid=NEW.uuid; - END; -CREATE TABLE activitylog - ( - uuid TEXT NOT NULL, - logdatefrom DATETIME, - logdateto DATETIME, - logtitle TEXT, - logmessage TEXT, - editorstaffuuid TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, editor TEXT, - PRIMARY KEY (uuid) - ); -CREATE TRIGGER trg_activitylog_upd UPDATE ON activitylog - BEGIN - UPDATE activitylog set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TABLE cautionstatus ( - uuid TEXT NOT NULL, - childuuid TEXT, - statusdate DATE, - amount NUMERIC, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, statementnumber TEXT, - PRIMARY KEY (uuid) -); -CREATE TRIGGER trg_cautionstatus_upd UPDATE ON cautionstatus - BEGIN - UPDATE cautionstatus set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TABLE planningtemplate - ( - uuid TEXT NOT NULL, - montimebegin TEXT, - montimeend TEXT, - monlunch BOOLEAN, - tuetimebegin TEXT, - tuetimeend TEXT, - tuelunch BOOLEAN, - wedtimebegin TEXT, - wedtimeend TEXT, - wedlunch BOOLEAN, - thutimebegin TEXT, - thutimeend TEXT, - thulunch BOOLEAN, - fritimebegin TEXT, - fritimeend TEXT, - frilunch BOOLEAN, - sattimebegin TEXT, - sattimeend TEXT, - satlunch BOOLEAN, - suntimebegin TEXT, - suntimeend TEXT, - sunlunch BOOLEAN, - montimebegin2 TEXT, - montimeend2 TEXT, - tuetimebegin2 TEXT, - tuetimeend2 TEXT, - wedtimebegin2 TEXT, - wedtimeend2 TEXT, - thutimebegin2 TEXT, - thutimeend2 TEXT, - fritimebegin2 TEXT, - fritimeend2 TEXT, - sattimebegin2 TEXT, - sattimeend2 TEXT, - suntimebegin2 TEXT, - suntimeend2 TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, templatename TEXT, - PRIMARY KEY (uuid) - ); -CREATE TRIGGER trg_planningtemplate_upd UPDATE ON planningtemplate - BEGIN - UPDATE planningtemplate set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; -CREATE TABLE messagelog - ( - uuid TEXT NOT NULL, - logdate DATETIME, - logtitle TEXT, - logmessage TEXT, - editorstaffuuid TEXT, - lastmodified DATETIME DEFAULT CURRENT_TIMESTAMP, editor TEXT, - PRIMARY KEY (uuid) - ); -CREATE TRIGGER trg_message_upd UPDATE ON messagelog - BEGIN - UPDATE messagelog set lastmodified=CURRENT_TIMESTAMP where uuid = NEW.uuid; - END; diff --git a/dev/db/underatert.old.sqlite b/dev/db/underatert.old.sqlite deleted file mode 100644 index 106b441..0000000 Binary files a/dev/db/underatert.old.sqlite and /dev/null differ diff --git a/download/.DS_Store b/download/.DS_Store deleted file mode 100644 index f65861f..0000000 Binary files a/download/.DS_Store and /dev/null differ diff --git a/img/Creorga_1000px.png b/img/Creorga_1000px.png deleted file mode 100644 index 4a09df9..0000000 Binary files a/img/Creorga_1000px.png and /dev/null differ diff --git a/img/applescript.png b/img/applescript.png deleted file mode 100644 index b3f5277..0000000 Binary files a/img/applescript.png and /dev/null differ diff --git a/img/apps/cashboxlogo.svg b/img/apps/cashboxlogo.svg deleted file mode 100644 index ca774ca..0000000 --- a/img/apps/cashboxlogo.svg +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/img/apps/coloradiologo.svg b/img/apps/coloradiologo.svg deleted file mode 100644 index 63e8e28..0000000 --- a/img/apps/coloradiologo.svg +++ /dev/null @@ -1,87 +0,0 @@ - -image/svg+xml - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/img/apps/creorgalogo.svg b/img/apps/creorgalogo.svg deleted file mode 100644 index fde1faa..0000000 --- a/img/apps/creorgalogo.svg +++ /dev/null @@ -1,931 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/img/apps/dkstools.svg b/img/apps/dkstools.svg deleted file mode 100644 index 3682c85..0000000 --- a/img/apps/dkstools.svg +++ /dev/null @@ -1,137 +0,0 @@ - - - -image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/img/apps/dksvpn.svg b/img/apps/dksvpn.svg deleted file mode 100644 index eed30e7..0000000 --- a/img/apps/dksvpn.svg +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/img/apps/hourtraxlogo.svg b/img/apps/hourtraxlogo.svg deleted file mode 100644 index 36ca456..0000000 --- a/img/apps/hourtraxlogo.svg +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - diff --git a/img/apps/invoicejournallogo.svg b/img/apps/invoicejournallogo.svg deleted file mode 100644 index 4806135..0000000 --- a/img/apps/invoicejournallogo.svg +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - diff --git a/img/apps/qrcodegenerateorlogo.svg b/img/apps/qrcodegenerateorlogo.svg deleted file mode 100644 index 173e819..0000000 --- a/img/apps/qrcodegenerateorlogo.svg +++ /dev/null @@ -1,2322 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/img/apps/websiteeditorlogo.svg b/img/apps/websiteeditorlogo.svg deleted file mode 100644 index 7cdd819..0000000 --- a/img/apps/websiteeditorlogo.svg +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - diff --git a/img/bash.png b/img/bash.png deleted file mode 100644 index e0331c1..0000000 Binary files a/img/bash.png and /dev/null differ diff --git a/img/bg.jpg b/img/bg.jpg deleted file mode 100644 index 5ad4139..0000000 Binary files a/img/bg.jpg and /dev/null differ diff --git a/img/bg_bw.jpg b/img/bg_bw.jpg deleted file mode 100644 index c3f063f..0000000 Binary files a/img/bg_bw.jpg and /dev/null differ diff --git a/img/bg_creorga.jpg b/img/bg_creorga.jpg deleted file mode 100644 index d7f782c..0000000 Binary files a/img/bg_creorga.jpg and /dev/null differ