aTableData: null,
aTableType: null,
aColumns: null,
- keywords: ['ABORT','ACTION','ADD','AFTER','ALL','ALTER','ANALYZE','AND','AS','ASC','ATTACH','AUTOINCREMENT','BEFORE','BEGIN','BETWEEN','BY','CASCADE','CASE','CAST','CHECK','COLLATE','COLUMN','COMMIT','CONFLICT','CONSTRAINT','CREATE','CROSS','CURRENT_DATE','CURRENT_TIME','CURRENT_TIMESTAMP','DATABASE','DEFAULT','DEFERRABLE','DEFERRED','DELETE','DESC','DETACH','DISTINCT','DROP','EACH','ELSE','END','ESCAPE','EXCEPT','EXCLUSIVE','EXISTS','EXPLAIN','FAIL','FOR','FOREIGN','FROM','FULL','GLOB','GROUP','HAVING','IF','IGNORE','IMMEDIATE','IN','INDEX','INDEXED','INITIALLY','INNER','INSERT','INSTEAD','INTERSECT','INTO','IS','ISNULL','JOIN','KEY','LEFT','LIKE','LIMIT','MATCH','NATURAL','NO','NOT','not','null','NOTNULL','NULL','OF','OFFSET','ON','OR','ORDER','OUTER','PLAN','PRAGMA','PRIMARY','QUERY','RAISE','RECURSIVE','REFERENCES','REGEXP','REINDEX','RELEASE','RENAME','REPLACE','RESTRICT','RIGHT','ROLLBACK','ROW','SAVEPOINT','SELECT','SET','TABLE','TEMP','TEMPORARY','THEN','TO','TRANSACTION','TRIGGER','UNION','UNIQUE','UPDATE','USING','VACUUM','VALUES','VIEW','VIRTUAL','WHEN','WHERE','WITH','WITHOUT'],
+ // keywords: ['ABORT','ACTION','ADD','AFTER','ALL','ALTER','ANALYZE','AND','AS','ASC','ATTACH','AUTOINCREMENT','BEFORE','BEGIN','BETWEEN','BY','CASCADE','CASE','CAST','CHECK','COLLATE','COLUMN','COMMIT','CONFLICT','CONSTRAINT','CREATE','CROSS','CURRENT_DATE','CURRENT_TIME','CURRENT_TIMESTAMP','DATABASE','DEFAULT','DEFERRABLE','DEFERRED','DELETE','DESC','DETACH','DISTINCT','DROP','EACH','ELSE','END','ESCAPE','EXCEPT','EXCLUSIVE','EXISTS','EXPLAIN','FAIL','FOR','FOREIGN','FROM','FULL','GLOB','GROUP','HAVING','IF','IGNORE','IMMEDIATE','IN','INDEX','INDEXED','INITIALLY','INNER','INSERT','INSTEAD','INTERSECT','INTO','IS','ISNULL','JOIN','KEY','LEFT','LIKE','LIMIT','MATCH','NATURAL','NO','NOT','not','null','NOTNULL','NULL','OF','OFFSET','ON','OR','ORDER','OUTER','PLAN','PRAGMA','PRIMARY','QUERY','RAISE','RECURSIVE','REFERENCES','REGEXP','REINDEX','RELEASE','RENAME','REPLACE','RESTRICT','RIGHT','ROLLBACK','ROW','SAVEPOINT','SELECT','SET','TABLE','TEMP','TEMPORARY','THEN','TO','TRANSACTION','TRIGGER','UNION','UNIQUE','UPDATE','USING','VACUUM','VALUES','VIEW','VIRTUAL','WHEN','WHERE','WITH','WITHOUT'],
setdbFile: function(fname){
this.dbFile=FileUtils.File(fname);
},
+++ /dev/null
-//Source-code licensed under EUPL v1.2 ( Copyright 2019 By DKS s.à r.l. - Kilian Saffran - Luxembourg )
-
-Components.utils["import"]("resource://gre/modules/NetUtil.jsm");
-Components.utils["import"]("resource://gre/modules/FileUtils.jsm");
-
-var license = {
- url: "https://www.dks.lu/creorga/license.cgi",
- activate: function(){
- document.getElementById("licerror").setAttribute("hidden",true);
- var reglid = /(\w{4,})\-(\w{4,})\-(\w{4,})\-(\w{4,})\-(\w{4,})/;
- var licensekey = document.getElementById("txtlicensekey").value;
- if (!licensekey.match(reglid)){
- document.getElementById("licerror").value="License pas valide!";
- document.getElementById("licerror").setAttribute("hidden",false);
- return;
- }
-
- //verify licensse
- this.checklicense(licensekey,this.setactiveview);
-
-//
-// if (!chkcrpart){
-// var cruuid = appdb.generate_uuid();
-// var dbname = system.profiledir() + system.sep() + cruuid +".sqlite";
-// var dbclone = system.appdir() + system.sep() +"defaults"+system.sep()+"profile"+system.sep()+"creorga.sqlite";
-// OS.File.copy(dbclone, dbname);
-
- },
-
- setcreche: function(){
- var chk = document.getElementById("chk_setcreche").checked;
- //"Is checked" + chk + "\n");
- if (chk === true){
- document.getElementById("vbox_liccreche").style.removeProperty("display");
- } else {
- document.getElementById("vbox_liccreche").style.setProperty("display","none");
- }
- },
-// browsecreche(lastdir,wmsg){
-// var nsIFilePicker = Components.interfaces.nsIFilePicker;
-// var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
-// fp.init(window, wmsg, nsIFilePicker.modeOpen);
-// fp.appendFilter("Database Files", "*.sqlite");
-// var selfile = null;
-// if ((lastdir) && (lastdir != '')) {
-// var nsILocalFile= Components.interfaces.nsILocalFile;
-// var f = Components.classes["@mozilla.org/file/local;1"].createInstance(nsILocalFile);
-// f.initWithPath(lastdir);
-// fp.displayDirectory = f;
-// }
-// var res = fp.show();
-// if (res != nsIFilePicker.returnCancel) {
-// selfile = fp.file;
-// }
-// return selfile;
-// },
- checklicense: function(lickey,callback){
- var data = null;
-
- var appinfo = system.b64EncodeUnicode(JSON.stringify(system.appinfo()));
- //dump(this.url + '?lic=' + lickey + ';appinfo=' + appinfo +"\n !!!!!\n");
- NetUtil.asyncFetch(this.url + '?lic=' + lickey + ';appinfo=' + appinfo, function(inputStream, status) {
-
- if (!Components.isSuccessCode(status)) {
- document.getElementById("licerror").value="Impossible de verifier la license!";
- document.getElementById("licerror").setAttribute("hidden",false);
- document.getElementById("apploadmsg").value="Serveur de DKS pas accessible! Contacter le support!";
- } else {
- var strdata = NetUtil.readInputStreamToString(inputStream, inputStream.available());
-
- //dump("Data returned:" + strdata + "\n");
- try {
- data = JSON.parse(strdata);
- } catch(e){
- document.getElementById("apploadmsg").value="Impossible de valider la license! Connection internet requis!";
-// var expiration = apppref.getpreference("support.expiration");
-// var today = new Date();
-// var test = today.toLocaleFormat("%Y-%m-%d");
-// var reglid = /(\w{4,})\-(\w{4,})\-(\w{4,})\-(\w{4,})\-(\w{4,})/;
-// if (lickey.match(reglid) != "" && (expiration) && (test <= expiration)){
-// navigation.load_deck(2);
-// }
- //dump(e.message);
- return data;
- }
-
- if (callback != null){
- callback(data)
- }
-// if (data.valid) && (data.valid == 1) {
-// //apppref.setpreference("support.license",data.license);
-// //apppref.setpreference("support.expiration",data.expiration);
-// navigation.load_deck(2);
-// }else {
-// document.getElementById("licerror").value="license pas valide!";
-// document.getElementById("licerror").setAttribute("hidden",false);
-// }
-
- }
- });
- return data;
- },
- setactiveview: function(ldata){
- //dump("Data returned:" + JSON.stringify(ldata) + "\n");
- //dump("database returned:" + this.dbname + "\n");
- if ((ldata.valid) && (ldata.valid == 1)) {
- apppref.setpreference("support.license",ldata.license);
- apppref.setpreference("support.expiration",ldata.expiration);
- //dump("Clone Database!\n");
- if (!apppref.getpreference("support.database.currentdb.db")){
- var cruuid = appdb.generate_uuid();
- var dbname = system.profiledir() + system.sep() + cruuid +".sqlite";
- var dbclone = system.appdir() + system.sep() +"defaults"+system.sep()+"profile"+system.sep()+"creorga.sqlite";
- //dump("DB to clone: " + dbclone);
- OS.File.copy(dbclone, dbname);
- apppref.setpreference("support.database.currentdb.num", 1);
- apppref.setpreference("support.database.currentdb.db",dbname);
- appdb.dbFile=FileUtils.File(apppref.getpreference("support.database.currentdb.db"));
- var nb = {name:'Crèche',uuid:cruuid,dbnum:1,path:{local:system.profiledir(),remote:null},lastsync:null};
- //dump("Database set:" + JSON.stringify(nb) + "\n");
- apppref.setpreference("support.database.1", nb);
- curcfg.loadconfig(1);
- //dump(appdb.dbFile.path + "\n");
- appdb.openDatabase();
- apppref.setpreference("pageconfig.creche",{"activetab":"groups"});
-
- navigation.load_appview("creche",null,null,"Crèche");
- }
- system.setappdata();
- navigation.load_deck(2);
- //document.getElementById("deckglobal").selectedIndex=2;
- }else {
- document.getElementById("licerror").value="license pas valide!";
- document.getElementById("licerror").setAttribute("hidden",false);
- }
- return;
-
-
-
- }
-
-}
\ No newline at end of file
}
},
- gotoUrl: function(url) {
- var nsioservice = Components.classes["@mozilla.org/network/io-service;1"]
- .getService(Components.interfaces.nsIIOService);
+ // gotoUrl: function(url) {
+ // var nsioservice = Components.classes["@mozilla.org/network/io-service;1"]
+ // .getService(Components.interfaces.nsIIOService);
- var uri = nsioservice.newURI(url, null, null);
+ // var uri = nsioservice.newURI(url, null, null);
- var eps = Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
- .getService(Components.interfaces.nsIExternalProtocolService);
+ // var eps = Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
+ // .getService(Components.interfaces.nsIExternalProtocolService);
- eps.loadURI(uri, null);
- },
+ // eps.loadURI(uri, null);
+ // },
openFile: function(filepath) {
if (system.os == "WINNT") {
system.runcmdline(filepath,[],null);
}
},
- getBackups:function(){
+ // getBackups:function(){
- var dir = new FileUtils.File(curcfg.path.local + system.sep() + 'backup');
- var entries = dir.directoryEntries;
- var array = [];
- while(entries.hasMoreElements()) {
- var entry = entries.getNext();
- entry.QueryInterface(Components.interfaces.nsIFile);
- if (entry.path.indexOf(curcfg.uuid) > 0){
- array.push(entry);
- }
- }
- return array;
- },
+ // var dir = new FileUtils.File(curcfg.path.local + system.sep() + 'backup');
+ // var entries = dir.directoryEntries;
+ // var array = [];
+ // while(entries.hasMoreElements()) {
+ // var entry = entries.getNext();
+ // entry.QueryInterface(Components.interfaces.nsIFile);
+ // if (entry.path.indexOf(curcfg.uuid) > 0){
+ // array.push(entry);
+ // }
+ // }
+ // return array;
+ // },
getReports:function(cruuid){
var dir = new FileUtils.File(curcfg.path.local + system.sep() + 'reports' + system.sep() +cruuid);
}
return array;
},
- getModtime: function(somePath){
- var file = new FileUtils.File(somePath);
- return new Date(file.lastModifiedTime).toLocaleFormat("%Y-%m-%d %H:%M:%S");
- },
+ // getModtime: function(somePath){
+ // var file = new FileUtils.File(somePath);
+ // return new Date(file.lastModifiedTime).toLocaleFormat("%Y-%m-%d %H:%M:%S");
+ // },
closecreorga: function(){
var appStartup = Components.classes["@mozilla.org/toolkit/app-startup;1"].getService(Components.interfaces.nsIAppStartup);
appStartup.quit(Components.interfaces.nsIAppStartup.eForceQuit );
//"Error selecting folder! " + ex + "\n");
}
return seldir;
- },
- changelicense:function(){
- navigation.load_deck(1);
}
+ // changelicense:function(){
+ // navigation.load_deck(1);
+ // }
}
\ No newline at end of file