From 1cc3060926d3ec9eb79f7d7fe6ca47f90cd14e1a Mon Sep 17 00:00:00 2001 From: "kilian@dks-pc1" Date: Tue, 22 Sep 2020 07:37:45 +0200 Subject: [PATCH] v20200922 macmenu --- app/tmpl/module/periods/reportperiod.js | 26 ++++++++++----------- app/tmpl/module/staff/staffperiods.js | 31 ++++++++++++------------- desktopapp/main.js | 15 ++++++++++-- desktopapp/package.json | 2 +- 4 files changed, 42 insertions(+), 32 deletions(-) diff --git a/app/tmpl/module/periods/reportperiod.js b/app/tmpl/module/periods/reportperiod.js index 123231f8..2ac82d4b 100644 --- a/app/tmpl/module/periods/reportperiod.js +++ b/app/tmpl/module/periods/reportperiod.js @@ -45,19 +45,19 @@ let reportperiod ={ // {title: "Département",field:"groupname" , visible: false}, - {title: "Prénom", field:"prename",headerSort: false}, - {title: "Nom", field:"surname",headerSort: false}, - {title: "Contrat", field:"contracthours",hozAlign:"right",headerSort: false}, - {title: "Travail", field:"workhours",hozAlign:"right",headerSort: false}, - {title: "Récup", field:"recuperationhours",hozAlign:"right",headerSort: false,formatter:periodRecupFormatter}, - {title: "congé", field:"vacancynormal",hozAlign:"right",headerSort: false}, - {title: "congé
maladie", field:"vacancyill",hozAlign:"right",headerSort: false}, - {title: "Total", field:"totalhours",hozAlign:"right",headerSort: false,formatter:periodTotalFormatter}, - {title: "décompte
reporté", field:"transferedhours",hozAlign:"right",headerSort: false}, - {title: "payés", field:"payedhours",hozAlign:"right",headerSort: false} , - {title: "décompte
fin POT", field:"hoursdiff",hozAlign:"right",headerSort: false}, - {title: "congé suppl.
+44 h", field:"suppvacancy44hours",hozAlign:"right",headerSort: false}, - {title: "congé suppl.
trav dim.", field:"suppvacancysunwork",hozAlign:"right",headerSort: false}, + {title: 'Prénom', field:"prename",headerSort: false}, + {title: 'Nom', field:"surname",headerSort: false}, + {title: 'Contrat', field:"contracthours",hozAlign:"right",headerSort: false}, + {title: 'Travail', field:"workhours",hozAlign:"right",headerSort: false}, + {title: 'Récup', field:"recuperationhours",hozAlign:"right",headerSort: false,formatter:periodRecupFormatter}, + {title: 'Congé', field:"vacancynormal",hozAlign:"right",headerSort: false}, + {title: 'Congé
maladie
', field:"vacancyill",hozAlign:"right",headerSort: false}, + {title: 'Total', field:"totalhours",hozAlign:"right",headerSort: false,formatter:periodTotalFormatter}, + {title: 'Décompte
reporté
', field:"transferedhours",hozAlign:"right",headerSort: false}, + {title: 'Payés', field:"payedhours",hozAlign:"right",headerSort: false} , + {title: 'Décompte
fin POT
', field:"hoursdiff",hozAlign:"right",headerSort: false}, + {title: 'suppl.
+44h
', field:"suppvacancy44hours",hozAlign:"right",headerSort: false,headerVertical:true}, + {title: 'suppl.
trav dim.
', field:"suppvacancysunwork",hozAlign:"right",headerSort: false,headerVertical:true}, //{title: "jours
ouvrables", field:"maxdays",hozAlign:"right",headerSort: false}, {title: "moy.
hebd.", field:"avgtotalweekhours",hozAlign:"right",headerSort: false,formatter:periodAVGFormatter}, {title: "validé", field:"isvalidated",hozAlign:"center",headerSort: false,formatter:"tickCross", formatterParams:{allowEmpty:true,allowTruthy: false}}, diff --git a/app/tmpl/module/staff/staffperiods.js b/app/tmpl/module/staff/staffperiods.js index 5a15c851..d158ab6f 100644 --- a/app/tmpl/module/staff/staffperiods.js +++ b/app/tmpl/module/staff/staffperiods.js @@ -13,22 +13,21 @@ let staffperiods = { columns: [ - {title: "Début",field: "startdate",headerSort:"datetime",formatter:"datetime",formatterParams:{inputFormat:"YYYY-MM-DD",outputFormat:"DD.MM.YYYY",invalidPlaceholder:""} }, - {title: "Fin",field: "enddate",headerSort:"datetime",formatter:"datetime",formatterParams:{inputFormat:"YYYY-MM-DD",outputFormat:"DD.MM.YYYY",invalidPlaceholder:""} }, - {title: "Contrat", field:"contracthours",hozAlign:"right", headerSort: false}, - {title: "Travail", field:"workhours",hozAlign:"right",headerSort: false}, - {title: "Récup", field:"recuperationhours",hozAlign:"right",headerSort: false,formatter:periodRecupFormatter}, - {title: "congé", field:"vacancynormal",hozAlign:"right",headerSort: false}, - {title: "congé
maladie", field:"vacancyill",hozAlign:"right",headerSort: false}, - {title: "Total", field:"totalhours",hozAlign:"right",headerSort: false,formatter:periodTotalFormatter}, - {title: "décompte
reporté", field:"transferedhours",hozAlign:"right",headerSort: false}, - {title: "payés", field:"payedhours",hozAlign:"right",headerSort: false} , - {title: "décompte
fin POT", field:"hoursdiff",headerSort: false,hozAlign:"right"}, - {title: "congé suppl.
+44 h", field:"suppvacancy44hours",hozAlign:"right",headerSort: false}, - {title: "congé suppl.
trav dim.", field:"suppvacancysunwork",hozAlign:"right",headerSort: false}, - {title: "jours
ouvrables", field:"maxdays",hozAlign:"right",headerSort: false}, - {title: "moy.
hebd.", field:"avgtotalweekhours",hozAlign:"right",headerSort: false,formatter:periodAVGFormatter}, - {title: "validé", field:"isvalidated",hozAlign:"center",headerSort: false,formatter:"tickCross", formatterParams:{allowEmpty:true,allowTruthy: false}} + {title: 'Début',field: "startdate",headerSort:"datetime",formatter:"datetime",formatterParams:{inputFormat:"YYYY-MM-DD",outputFormat:"DD.MM.YYYY",invalidPlaceholder:""} }, + {title: 'Fin',field: "enddate",headerSort:"datetime",formatter:"datetime",formatterParams:{inputFormat:"YYYY-MM-DD",outputFormat:"DD.MM.YYYY",invalidPlaceholder:""} }, + {title: 'Contrat', field:"contracthours",hozAlign:"right", headerSort: false}, + {title: 'Travail', field:"workhours",hozAlign:"right",headerSort: false}, + {title: 'Récup', field:"recuperationhours",hozAlign:"right",headerSort: false,formatter:periodRecupFormatter}, + {title: 'congé', field:"vacancynormal",hozAlign:"right",headerSort: false}, + {title: 'Congé
maladie
', field:"vacancyill",hozAlign:"right",headerSort: false}, + {title: 'Total', field:"totalhours",hozAlign:"right",headerSort: false,formatter:periodTotalFormatter}, + {title: 'décompte
reporté
', field:"transferedhours",hozAlign:"right",headerSort: false}, + {title: 'payés', field:"payedhours",hozAlign:"right",headerSort: false} , + {title: 'décompte
fin POT
', field:"hoursdiff",headerSort: false,hozAlign:"right"}, + {title: 'suppl.
+44 h
', field:"suppvacancy44hours",hozAlign:"right",headerSort: false,headerVertical:true}, + {title: 'suppl.
trav dim.
', field:"suppvacancysunwork",hozAlign:"right",headerSort: false,headerVertical:true}, + {title: 'moy.
hebd.
', field:"avgtotalweekhours",hozAlign:"right",headerSort: false,formatter:periodAVGFormatter}, + {title: 'validé', field:"isvalidated",hozAlign:"center",headerSort: false,formatter:"tickCross", formatterParams:{allowEmpty:true,allowTruthy: false}} ] }); diff --git a/desktopapp/main.js b/desktopapp/main.js index 8618095a..827baf36 100644 --- a/desktopapp/main.js +++ b/desktopapp/main.js @@ -1,5 +1,5 @@ -const {app,shell, BrowserWindow, globalShortcut} = require('electron') +const {app,shell, BrowserWindow, globalShortcut, Menu} = require('electron') const path = require('path') const os = require('os') const fs = require('fs') @@ -39,7 +39,18 @@ function createWindow () { console.log("loding URL:" + appcfg.host) mainWindow.loadURL(appcfg.host,{userAgent: ua}); if (os.platform() == "darwin"){ - mainWindow.setMenuBarVisibility(false) + const template = [ + {label: 'Edit',submenu: [ {role: 'undo'}, {role: 'redo'},{type: 'separator'},{role: 'cut'},{role: 'copy'},{role: 'paste'},{role: 'pasteandmatchstyle'},{role: 'delete'},{role: 'selectall'}]}, + {label: 'View',submenu: [{role: 'reload'}, {role: 'forcereload'},{role: 'toggledevtools'},{type: 'separator'},{role: 'resetzoom'},{role: 'zoomin'},{role: 'zoomout'},{type: 'separator'},{role: 'togglefullscreen'}]}, + {role: 'window',submenu: [{role: 'minimize'},{role: 'close'}]}, + {role: 'help',submenu: [{label: 'Learn More',click () { require('electron').shell.openExternal('https://electronjs.org') }}]}] + template.unshift({ label: app.getName(), submenu: [ {role: 'about'}, {type: 'separator'}, {role: 'services', submenu: []}, {type: 'separator'}, {role: 'hide'}, {role: 'hideothers'}, {role: 'unhide'}, {type: 'separator'}, {role: 'quit'} + ] + }) + template[1].submenu.push( {type: 'separator'}, { label: 'Speech', submenu: [ {role: 'startspeaking'}, {role: 'stopspeaking'} ] } ) + template[3].submenu = [ {role: 'close'}, {role: 'minimize'}, {role: 'zoom'}, {type: 'separator'}, {role: 'front'} ] + const menu = Menu.buildFromTemplate(template) + Menu.setApplicationMenu(menu) } else { mainWindow.setMenu(null) } diff --git a/desktopapp/package.json b/desktopapp/package.json index dc0600d0..0b8ecd43 100644 --- a/desktopapp/package.json +++ b/desktopapp/package.json @@ -7,7 +7,7 @@ "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", - "package-macos": "electron-packager . pot --overwrite --plattform=darwin --arch=x64 --asar --out=../release-builds --icon=img/POT-logo.icns --prune=true" + "package-macos": "electron-packager . POT --overwrite --plattform=darwin --arch=x64 --asar --out=../release-builds --icon=img/POT-logo.icns --prune=true" }, "keywords": [ "planning", -- 2.39.5