auto commit on 2019-07-05 18:22 master
authorKilian Saffran <ksaffran@dks.lu>
Fri, 5 Jul 2019 16:22:52 +0000 (18:22 +0200)
committerKilian Saffran <ksaffran@dks.lu>
Fri, 5 Jul 2019 16:22:52 +0000 (18:22 +0200)
.DS_Store [new file with mode: 0644]
app_v3/.DS_Store [new file with mode: 0644]
app_v3/chrome/.DS_Store [new file with mode: 0644]
app_v3/chrome/content/.DS_Store [new file with mode: 0644]
app_v3/chrome/content/js/database.js
app_v3/chrome/content/js/license.js [deleted file]
app_v3/chrome/content/js/sync.js [deleted file]
app_v3/chrome/content/js/system.js
app_v3/chrome/content/web/.DS_Store [new file with mode: 0644]

diff --git a/.DS_Store b/.DS_Store
new file mode 100644 (file)
index 0000000..70bb19b
Binary files /dev/null and b/.DS_Store differ
diff --git a/app_v3/.DS_Store b/app_v3/.DS_Store
new file mode 100644 (file)
index 0000000..c61b00e
Binary files /dev/null and b/app_v3/.DS_Store differ
diff --git a/app_v3/chrome/.DS_Store b/app_v3/chrome/.DS_Store
new file mode 100644 (file)
index 0000000..77fc116
Binary files /dev/null and b/app_v3/chrome/.DS_Store differ
diff --git a/app_v3/chrome/content/.DS_Store b/app_v3/chrome/content/.DS_Store
new file mode 100644 (file)
index 0000000..21c8c47
Binary files /dev/null and b/app_v3/chrome/content/.DS_Store differ
index c27fa2a..dcad6fd 100644 (file)
@@ -10,7 +10,7 @@ var appdb = {
   aTableData: null,   
   aTableType: null,
   aColumns: null,
   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);
   },
   setdbFile: function(fname){
          this.dbFile=FileUtils.File(fname);
   },
diff --git a/app_v3/chrome/content/js/license.js b/app_v3/chrome/content/js/license.js
deleted file mode 100644 (file)
index ca2f99c..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-//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
diff --git a/app_v3/chrome/content/js/sync.js b/app_v3/chrome/content/js/sync.js
deleted file mode 100644 (file)
index e69de29..0000000
index 6be1ac3..5d8fc11 100644 (file)
@@ -89,17 +89,17 @@ var system = {
     }
   },
   
     }
   },
   
-  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);
   openFile: function(filepath) {
     if (system.os == "WINNT") {
       system.runcmdline(filepath,[],null);
@@ -224,20 +224,20 @@ var system = {
     }
     
   },
     }
     
   },
-  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);
   getReports:function(cruuid){
 
     var dir =  new FileUtils.File(curcfg.path.local  + system.sep() + 'reports' + system.sep() +cruuid);
@@ -290,10 +290,10 @@ var system = {
     }
     return array;
   },
     }
     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 );
   closecreorga: function(){
     var appStartup = Components.classes["@mozilla.org/toolkit/app-startup;1"].getService(Components.interfaces.nsIAppStartup);
           appStartup.quit(Components.interfaces.nsIAppStartup.eForceQuit );
@@ -414,9 +414,9 @@ var system = {
       //"Error selecting folder! " + ex + "\n");
     }
     return seldir;
       //"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
   
 }
\ No newline at end of file
diff --git a/app_v3/chrome/content/web/.DS_Store b/app_v3/chrome/content/web/.DS_Store
new file mode 100644 (file)
index 0000000..ba3b77f
Binary files /dev/null and b/app_v3/chrome/content/web/.DS_Store differ