From: kilian Date: Mon, 6 Jul 2020 08:35:55 +0000 (+0200) Subject: v20200705 X-Git-Tag: 1.0.15~57 X-Git-Url: http://cloud.dks.lu/git/?a=commitdiff_plain;h=d73d837dcf03f6846bdf4ffff4f34b136dbf6035;p=pot_lu.git v20200705 --- diff --git a/.gitignore b/.gitignore index c5b114ba..1e4b8e6b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ website/app desktopapp/node_modules +desktopapp/release-builds desktopapp/node_modules/package-lock.json OLD/ diff --git a/desktopapp/img/POT-logo.ico b/desktopapp/img/POT-logo.ico new file mode 100644 index 00000000..f731cb01 Binary files /dev/null and b/desktopapp/img/POT-logo.ico differ diff --git a/desktopapp/img/POT-logo.png b/desktopapp/img/POT-logo.png index e2c80285..9e0e71ae 100644 Binary files a/desktopapp/img/POT-logo.png and b/desktopapp/img/POT-logo.png differ diff --git a/desktopapp/main.js b/desktopapp/main.js index 35f2c398..168982ab 100644 --- a/desktopapp/main.js +++ b/desktopapp/main.js @@ -6,7 +6,7 @@ const fs = require('fs') const url = require('url') const {ipcMain} = require('electron') // var child = require('child_process').execFile -const machineUuid = require("machine-uuid") +// const machineUuid = require("machine-uuid") // var { spawn } = require('child_process'); //var { spawn } = require('child_process').execFile; // Keep a global reference of the window object, if you don't, the window will @@ -20,14 +20,14 @@ function createWindow () { let executablePath = ""; let parameters = []; let appcfg = localcfg(); - console.log(app.getAppPath()); - console.log(app.getVersion()); - console.log(app.getLocale()); - console.log(os.platform()); - console.log(app.getName()); - machineUuid().then((uuid)=>console.log(uuid)) + //console.log(app.getAppPath()); + //console.log(app.getVersion()); + //console.log(app.getLocale()); + //console.log(os.platform()); + //console.log(app.getName()); + //machineUuid().then((uuid)=>console.log(uuid)) //console.log(os); - console.log(parameters); + //console.log(parameters); let ua = app.getName() + '/' + app.getVersion() + ' ' + os.type() + '/' + os.release() + '/' + os.arch mainWindow = new BrowserWindow({ show: false, @@ -73,51 +73,51 @@ function createWindow () { // subprocess.unref(); // } // } - console.log(appcfg.host) + //console.log(appcfg.host) // and load the index.html of the app. mainWindow.loadURL(appcfg.host,{userAgent: ua}) mainWindow.setMenu(null) mainWindow.maximize() mainWindow.webContents.session.on('will-download', (event, item, webContents) => { - console.log("Download-URL:" + item.getURL()) - console.log(app.getPath("temp")) + //console.log("Download-URL:" + item.getURL()) + //console.log(app.getPath("temp")) var savepath=app.getPath("temp") + '/' + item.getFilename() var actionurl = item.getURL(); - console.log(savepath) + //console.log(savepath) if (fs.existsSync(savepath)) { fs.unlink(savepath,function(err){ if(err) return console.log(err); - console.log('file deleted successfully'); + //console.log('file deleted successfully'); }); } item.setSavePath(savepath); item.on('updated', (event, state) => { if (state === 'interrupted') { - console.log('Download is interrupted but can be resumed') + //console.log('Download is interrupted but can be resumed') } else if (state === 'progressing') { if (item.isPaused()) { - console.log('Download is paused') + //console.log('Download is paused') } else { - console.log(`Received bytes: ${item.getReceivedBytes()}`) + //console.log(`Received bytes: ${item.getReceivedBytes()}`) } } }) item.once('done', (event, state) => { if (state === 'completed') { let tmpurl = url.parse(actionurl) - console.log('Download successfully') - console.log(tmpurl); + //console.log('Download successfully') + //console.log(tmpurl); if (actionurl.indexOf("action=sendmail") > 0){ - console.log(appcfg.mailapp); - backgroundProcess(appcfg.mailapp,) + //console.log(appcfg.mailapp); + //backgroundProcess(appcfg.mailapp,) //-compose to="servais@asst.lu",subject="Rechnung fir Konfiguratioun vum neien PC",body="Moien Servais\nan der Annexe fënns du d\'Rechnung fir Konfiguratioun vum neien PC",attachment='C:\Users\kilian\Downloads\DKS_20200605-0043 (5).pdf' } else { shell.openExternal('file://' + savepath) } } else { - console.log(`Download failed: ${state}`) + //console.log(`Download failed: ${state}`) } }) }) diff --git a/desktopapp/package.json b/desktopapp/package.json index f1097efb..404a936f 100644 --- a/desktopapp/package.json +++ b/desktopapp/package.json @@ -5,7 +5,10 @@ "main": "main.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "start": "electron ." + "start": "electron .", + "package-win64": "electron-packager . pot --overwrite --platform=win32 --arch=x64 --asar --out=release-builds --version-string.CompanyName=DKS --version-string.FileDescription=DKS --version-string.ProductName=POT --icon=img/POT-logo.ico", + "package-win32": "electron-packager . pot --overwrite --platform=win32 --arch=ia32 --asar --out=release-builds --version-string.CompanyName=DKS --version-string.FileDescription=DKS --version-string.ProductName=POT --icon=img/POT-logo.ico" + }, "keywords": [ "planning", @@ -19,6 +22,5 @@ "electron-packager": "^14.2.1" }, "dependencies": { - "machine-uuid": "^1.2.0" } } diff --git a/dev/createicon.bat b/dev/createicon.bat new file mode 100644 index 00000000..dd908130 --- /dev/null +++ b/dev/createicon.bat @@ -0,0 +1,8 @@ +@echo off + +cd C:\Users\kilian\Workspace\pot_lu\desktopapp\img\ + +"C:\Users\kilian\Tools\Images\convert.exe" -background transparent "POT-logo.png" -define icon:auto-resize=16,24,32,48,64,72,96,128,256 "POT-logo.ico" +cd C:\Users\kilian\Workspace\pot_lu\install\windows\icons +"C:\Users\kilian\Tools\Images\convert.exe" -background transparent "Install-Icon.png" -define icon:auto-resize=16,24,32,48,64,72,96,128,256 "Install-Icon.ico" + diff --git a/install/license.txt b/install/license.txt new file mode 100644 index 00000000..9eef97b7 --- /dev/null +++ b/install/license.txt @@ -0,0 +1,37 @@ +End-User License Agreement (EULA) of POT +This End-User License Agreement ("EULA") is a legal agreement between you and DKS SARL + +This EULA agreement governs your acquisition and use of our POT software ("Software") directly from DKS SARL or indirectly through a DKS SARL authorized reseller or distributor (a "Reseller"). + +Please read this EULA agreement carefully before completing the installation process and using the POT software. It provides a license to use the POT software and contains warranty information and liability disclaimers. + +If you register for a free trial of the POT software, this EULA agreement will also govern that trial. By clicking "accept" or installing and/or using the POT software, you are confirming your acceptance of the Software and agreeing to become bound by the terms of this EULA agreement. + +If you are entering into this EULA agreement on behalf of a company or other legal entity, you represent that you have the authority to bind such entity and its affiliates to these terms and conditions. If you do not have such authority or if you do not agree with the terms and conditions of this EULA agreement, do not install or use the Software, and you must not accept this EULA agreement. + +This EULA agreement shall apply only to the Software supplied by DKS SARL herewith regardless of whether other software is referred to or described herein. The terms also apply to any DKS SARL updates, supplements, Internet-based services, and support services for the Software, unless other terms accompany those items on delivery. If so, those terms apply. + +License Grant +DKS SARL hereby grants you a personal, non-transferable, non-exclusive licence to use the POT software on your devices in accordance with the terms of this EULA agreement. + +You are permitted to load the POT software (for example a PC, laptop, mobile or tablet) under your control. You are responsible for ensuring your device meets the minimum requirements of the POT software. + +You are not permitted to: + +Edit, alter, modify, adapt, translate or otherwise change the whole or any part of the Software nor permit the whole or any part of the Software to be combined with or become incorporated in any other software, nor decompile, disassemble or reverse engineer the Software or attempt to do any such things +Reproduce, copy, distribute, resell or otherwise use the Software for any commercial purpose +Allow any third party to use the Software on behalf of or for the benefit of any third party +Use the Software in any way which breaches any applicable local, national or international law +use the Software for any purpose that DKS SARL considers is a breach of this EULA agreement +Intellectual Property and Ownership +DKS SARL shall at all times retain ownership of the Software as originally downloaded by you and all subsequent downloads of the Software by you. The Software (and the copyright, and other intellectual property rights of whatever nature in the Software, including any modifications made thereto) are and shall remain the property of DKS SARL. + +DKS SARL reserves the right to grant licences to use the Software to third parties. + +Termination +This EULA agreement is effective from the date you first use the Software and shall continue until terminated. You may terminate it at any time upon written notice to DKS SARL. + +It will also terminate immediately if you fail to comply with any term of this EULA agreement. Upon such termination, the licenses granted by this EULA agreement will immediately terminate and you agree to stop all access and use of the Software. The provisions that by their nature continue and survive will survive any termination of this EULA agreement. + +Governing Law +This EULA agreement, and any dispute arising out of or in connection with this EULA agreement, shall be governed by and construed in accordance with the laws of Luxembourg. \ No newline at end of file diff --git a/install/setups/mysetup.exe b/install/setups/mysetup.exe new file mode 100644 index 00000000..869aef94 Binary files /dev/null and b/install/setups/mysetup.exe differ diff --git a/install/windows/icons/Install-Icon.ico b/install/windows/icons/Install-Icon.ico new file mode 100644 index 00000000..a2335d82 Binary files /dev/null and b/install/windows/icons/Install-Icon.ico differ diff --git a/install/windows/icons/Install-Icon.png b/install/windows/icons/Install-Icon.png new file mode 100644 index 00000000..00fe0282 Binary files /dev/null and b/install/windows/icons/Install-Icon.png differ diff --git a/install/windows/pot_setup.iss b/install/windows/pot_setup.iss index 48024abb..28e1b39c 100644 --- a/install/windows/pot_setup.iss +++ b/install/windows/pot_setup.iss @@ -12,7 +12,7 @@ ; NOTE: The value of AppId uniquely identifies this application. ; Do not use the same AppId value in installers for other applications. ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) -AppId={{31A01E9B-0999-4A24-8C69-B10F526961C7} +AppId={{1de7bf31-d2bf-4890-a51d-9bd45cf7c7ba} AppName={#MyAppName} AppVersion={#MyAppVersion} ;AppVerName={#MyAppName} {#MyAppVersion} diff --git a/install/windows/pot_setup_new.iss b/install/windows/pot_setup_new.iss new file mode 100644 index 00000000..fb748f1a --- /dev/null +++ b/install/windows/pot_setup_new.iss @@ -0,0 +1,53 @@ +; Script generated by the Inno Setup Script Wizard. +; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! + +#define MyAppName "POT - Plan d'Organisation du Travail" +#define MyAppVersion "0.8" +#define MyAppPublisher "DKS s.à r.l." +#define MyAppURL "http://pot.dks.lu/" +#define MyAppExeName "pot.exe" + +[Setup] +; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications. +; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) +AppId={{C583A11C-7811-4C73-B26C-1D61A6F5B679} +AppName={#MyAppName} +AppVersion={#MyAppVersion} +;AppVerName={#MyAppName} {#MyAppVersion} +AppPublisher={#MyAppPublisher} +AppPublisherURL={#MyAppURL} +AppSupportURL={#MyAppURL} +AppUpdatesURL={#MyAppURL} +DefaultDirName={autopf}\POT - Plan d'Orgaisation du Travail +DisableProgramGroupPage=yes +LicenseFile=C:\Users\kilian\Workspace\pot_lu\install\license.txt +; Uncomment the following line to run in non administrative install mode (install for current user only.) +;PrivilegesRequired=lowest +PrivilegesRequiredOverridesAllowed=dialog +OutputDir=C:\Users\kilian\Workspace\pot_lu\install\setups +OutputBaseFilename=mysetup +SetupIconFile=C:\Users\kilian\Workspace\pot_lu\install\windows\icons\Install-Icon.ico +Compression=lzma +SolidCompression=yes +WizardStyle=modern + +[Languages] +Name: "english"; MessagesFile: "compiler:Default.isl" +Name: "french"; MessagesFile: "compiler:Languages\French.isl" +Name: "german"; MessagesFile: "compiler:Languages\German.isl" + +[Tasks] +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked + +[Files] +Source: "C:\Users\kilian\Workspace\pot_lu\desktopapp\release-builds\pot-win32-ia32\pot.exe"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Users\kilian\Workspace\pot_lu\desktopapp\release-builds\pot-win32-ia32\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs +; NOTE: Don't use "Flags: ignoreversion" on any shared system files + +[Icons] +Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" +Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon + +[Run] +Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent + diff --git a/webapp/static/js/admin.js b/webapp/static/js/admin.js index 5c9be0ec..4b751c3d 100644 --- a/webapp/static/js/admin.js +++ b/webapp/static/js/admin.js @@ -1,4 +1,4 @@ -var choice = {"company":{"schemata":null}}; +var choice = {"current_schemata":null}; var admin = { loadpage: function(modulepage, modulename) { @@ -12,8 +12,11 @@ var admin = { location.href = 'login.html'; }, changedataset: function(){ - var schemata = document.getElementById("schemata").nodeValue; - req.reqdata("POST","db.cgi") + var schemata = document.getElementById("current_schemata").nodeValue; + //req.reqdata("POST","db.cgi") + }, + getCurrentSchemata: function(){ + return document.getElementById("current_schemata").value; }, // getschemata: function(){ // req.reqdata("POST","app.cgi",{"fn":"getschemaaccess"},admin.fillschematalist); @@ -25,10 +28,10 @@ var admin = { // return false; // }, - changedataset(){ + changedataset: function(){ }, - reload_page() { + reload_page: function() { location.href = location.href; }, initselectlist: function(obj,objid, changeevt){ @@ -42,7 +45,7 @@ var admin = { } } - obj = new Choices('#schemata',{ + obj = new Choices('#current_schemata',{ searchEnabled: false, itemSelectText: '', removeItemButton: false, @@ -66,6 +69,6 @@ document.addEventListener("DOMContentLoaded", function() { // console.log(document.getElementById("schemata").childNodes); // choice["company"]["schemata"] = - admin.initselectlist(choice["company"]["schemata"],'schemata',admin.changedataset()); + admin.initselectlist(choice["current_schemata"],'current_schemata',admin.changedataset()); }); diff --git a/webapp/static/js/formsave.js b/webapp/static/js/formsave.js index d9a050cf..1406fed7 100644 --- a/webapp/static/js/formsave.js +++ b/webapp/static/js/formsave.js @@ -222,17 +222,17 @@ function cleanform2(frmname,choices){ function fillformbydataclass2(dataclass,choices,data,onblur){ var frm = document.querySelectorAll('.data_'+ dataclass); - console.log("Data to fill"); - console.log(data); + //console.log("Data to fill"); + //console.log(data); if (data){ for (var f in frm){ - console.log(frm[f].id); + //console.log(frm[f].id); if (frm[f].id){ frm[f].dataset.id=data['id']; } if (data[frm[f].id]){ - console.log("=>"); - console.log(data[frm[f].id]); + //console.log("=>"); + //console.log(data[frm[f].id]); // if (onblur){ // frm[f].addEventListener('blur',onblur); // } diff --git a/webapp/tmpl/block/pnl_nodata.tt b/webapp/tmpl/block/pnl_nodata.tt new file mode 100644 index 00000000..37018f72 --- /dev/null +++ b/webapp/tmpl/block/pnl_nodata.tt @@ -0,0 +1,8 @@ +
+
+
 
+
+
+ +
+
\ No newline at end of file diff --git a/webapp/tmpl/index.tt b/webapp/tmpl/index.tt index 45dd111c..a980151e 100644 --- a/webapp/tmpl/index.tt +++ b/webapp/tmpl/index.tt @@ -46,14 +46,11 @@
- - + + - +
Entreprises
+ + + [% IF (session.usergroup == 'admin') %] + + [% END %]
- - - + [% IF (session.usergroup == 'admin') %] + + + + [% END %]
@@ -16,32 +22,22 @@
-
-
-
-
 
-
-
- -
-
-