website/app
desktopapp/node_modules
+desktopapp/release-builds
desktopapp/node_modules/package-lock.json
OLD/
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
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,
// 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}`)
}
})
})
"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",
"electron-packager": "^14.2.1"
},
"dependencies": {
- "machine-uuid": "^1.2.0"
}
}
--- /dev/null
+@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"
+
--- /dev/null
+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
; NOTE: The value of AppId uniquely identifies this application.\r
; Do not use the same AppId value in installers for other applications.\r
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)\r
-AppId={{31A01E9B-0999-4A24-8C69-B10F526961C7}\r
+AppId={{1de7bf31-d2bf-4890-a51d-9bd45cf7c7ba}\r
AppName={#MyAppName}\r
AppVersion={#MyAppVersion}\r
;AppVerName={#MyAppName} {#MyAppVersion}\r
--- /dev/null
+; 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
+
-var choice = {"company":{"schemata":null}};\r
+var choice = {"current_schemata":null};\r
\r
var admin = {\r
loadpage: function(modulepage, modulename) {\r
location.href = 'login.html';\r
},\r
changedataset: function(){\r
- var schemata = document.getElementById("schemata").nodeValue;\r
- req.reqdata("POST","db.cgi")\r
+ var schemata = document.getElementById("current_schemata").nodeValue;\r
+ //req.reqdata("POST","db.cgi")\r
+ },\r
+ getCurrentSchemata: function(){\r
+ return document.getElementById("current_schemata").value;\r
},\r
// getschemata: function(){\r
// req.reqdata("POST","app.cgi",{"fn":"getschemaaccess"},admin.fillschematalist);\r
\r
// return false;\r
// },\r
- changedataset(){\r
+ changedataset: function(){\r
\r
},\r
- reload_page() {\r
+ reload_page: function() {\r
location.href = location.href;\r
},\r
initselectlist: function(obj,objid, changeevt){\r
}\r
\r
}\r
- obj = new Choices('#schemata',{\r
+ obj = new Choices('#current_schemata',{\r
searchEnabled: false,\r
itemSelectText: '',\r
removeItemButton: false,\r
\r
// console.log(document.getElementById("schemata").childNodes);\r
// choice["company"]["schemata"] = \r
- admin.initselectlist(choice["company"]["schemata"],'schemata',admin.changedataset());\r
+ admin.initselectlist(choice["current_schemata"],'current_schemata',admin.changedataset());\r
\r
});\r
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);
// }
--- /dev/null
+<div class="panel white" id="pnl_nodata">
+ <div class="bar moduletoolbar">
+ <div class="bar-item PageHeadTitle"> </div>
+ </div>
+ <div class="row center " style="margin-top: 200px; height: calc(100vh - 160px);">
+ <img src="[% abpspath%][% staticpath %]img/toplogo.png" style="margin: auto;">
+ </div>
+ </div>
\ No newline at end of file
<div class="display-container" >
<div class="bar border-bottom toolbar" id="toolbar">
- <button onclick="admin.loadpage('index.html','Dashboard');" class="bar-item toolbarbtn">
- <img src="[% abspath %][% staticpath %]img/POT-logo.png" style="border-radius: 2px;width: 22px; background-color: #fff;"><br/>POT
+ <button class="bar-item toolbarbtn">
+ <img src="[% abspath %][% staticpath %]img/POT-logo.png" style="border-radius: 2px;width: 40px; background-color: #fff;">
</button>
- <button onclick="admin.loadpage('[% abspath %]staff.html','');" class="bar-item toolbarbtn">
- <span class="icon-group" style="font-size: 22px;"></span>
- <br/>Salariés
- </button>
+
<button onclick="admin.loadpage('[% abspath %]periods.html','');" class="bar-item toolbarbtn">
<span class="icon-calendar" style="font-size: 22px;"></span>
<br/>Périodes
<span class="icon-template" style="font-size: 22px;"></span>
<br/>Modèles
</button>
+ <button onclick="admin.loadpage('[% abspath %]staff.html','');" class="bar-item toolbarbtn">
+ <span class="icon-group" style="font-size: 22px;"></span>
+ <br/>Salariés
+ </button>
<button onclick="admin.loadpage('[% abspath %]companies.html','');" class="bar-item toolbarbtn">
<span class="icon-shop" style="font-size: 22px;"></span>
<br/>Entreprise
</button>
- <button onclick="admin.loadpage('[% abspath %]users.html','');" class="bar-item toolbarbtn">
- <span class="icon-user" style="font-size: 22px;"></span>
- <br/>Utilisateurs
- </button>
<button onclick="admin.loadpage('[% abspath %]profile.html','');" class="bar-item toolbarbtn right">
<label for="company_schemata" class="label text-white" style="font-size: 10pt;">DataSet</label>
<!-- <input type="hidden" id="schemata" value="portanova"/> -->
<!-- <input type="text" readonly style="border: unset; background-color: unset; color: #fff; " id="schemata_company" value="Porta Nova"/> -->
- <select id="schemata" value="portanova" >
+ <select id="current_schemata" value="portanova" >
[% IF (session.usergroup == 'admin') %]
[% FOREACH ds = dksdb.query("select schemaname,company from vw_schemata order by company;") %];
<option value="[% ds.schemaname %]">[% ds.company %]</option>
--- /dev/null
+[% FOREACH ilbl= dksdb.query("select id,${lang} as lbl from labels;") %]
+[% lbl.${ilbl.item('id')} = ilbl.item('lbl') %]
+[% END %]
\ No newline at end of file
-[% PROCESS macro/fields.tt %]
<div class="display-container">
<div class="bar moduletoolbar">
- <button class="bar-item toolbarbtn" onclick="companies.gettbldata();module.viewpanel('tbl_companies');"><span class="icon-table" style="font-size: 16px;"></span><br/>Tableau</button>
+ <!-- <button class="bar-item toolbarbtn" onclick="companies.gettbldata();module.viewpanel('tbl_companies');"><span class="icon-table" style="font-size: 16px;"></span><br/>Tableau</button> -->
<div class="bar-item PageHeadTitle">Entreprises</div>
+ <button class="bar-item toolbarbtn" onclick="companies.setview('basedata');"><span class="icon-staff" style="font-size: 16px;"></span><br/>Données de base</button>
+ <button class="bar-item toolbarbtn" onclick="users.gettbldata();companies.setview('users');"><span class="icon-user" style="font-size: 16px;"></span><br/>Utilisateurs</button>
+ [% IF (session.usergroup == 'admin') %]
+ <button class="bar-item toolbarbtn" onclick="worktimes.gettbldata();companies.setview('worktimes');"><span class="icon-package" style="font-size: 16px;"></span><br/>Secteur</button>
+ [% END %]
<div class="toolbar" id="tbar_tbl_companies">
-<button class="bar-item toolbarbtn right" onclick="companies.remove();"><span class="icon-remove text-red" style="font-size: 16px;"></span><br/>supprimer</button>
-<button class="bar-item toolbarbtn right" onclick="companies.edit();"><span class="icon-edit" style="font-size: 16px;"><br/>éditer</button>
-<button class="bar-item toolbarbtn right" onclick="companies.add();"><span class="icon-plus" style="font-size: 16px;"><br/>ajouter</button>
+ [% IF (session.usergroup == 'admin') %]
+<button class="bar-item toolbarbtn right" onclick="companies.remove();"><span class="icon-remove text-red" style="font-size: 16px;"></span><br/>supprimer</button>
+<!-- <button class="bar-item toolbarbtn right" onclick="companies.edit();"><span class="icon-edit" style="font-size: 16px;"><br/>éditer</button> -->
+<button class="bar-item toolbarbtn right" onclick="companies.add();"><span class="icon-plus" style="font-size: 16px;"><br/>ajouter</button>
+ [% END %]
</div>
</div>
<div class="cell" style="width: 200px;">
<div id="tbl_companies"></div>
</div>
- <div class="cell" >
- <div class="panel" id="pnl_nodata">
- <div class="bar moduletoolbar">
- <div class="bar-item PageHeadTitle"> </div>
- </div>
- <div class="row center" style="margin-top: 200px;">
- <img src="[% abpspath%][% staticpath %]img/toplogo.png" style="margin: auto;">
- </div>
- </div>
- <div class="panel" id="pnl_basedata" style="display: none;">
+ <div class="cell moduletoolbar" >
+ [% INCLUDE block/pnl_nodata.tt %]
+ <div class="panel moduletoolbar" id="pnl_basedata" style="display: none;">
<div class="bar moduletoolbar">
<div class="bar-item PageHeadTitle">Données de base</div>
</div>
<form id="frm_companies">
[% fieldhidden('id','companies','ident') %]
- <div class="row" >
- <form id="frm_companies">
- [% fieldhidden('id','companies','ident') %]
- <div class="cell">
+ <div class="row " >
+ <div class="cell white">
<div class="row">
<div class="cell">
<div class="row" style="margin-top: 5px;">
<div class="cell" style="width: 300px;">
[% fieldeditbox('datasetname','companies','DataSet','','','','','record.savefield(this);') %]
</div>
-
</div>
<div class="row" style="margin-top: 5px;">
<div class="cell" style="width: 300px;">
</div>
<div class="row">
<div class="cell" style="width: 250px;">[% fieldeditbox('email','companies','E-Mail','','','','','record.savefield(this);') %]</div>
- <div class="cell">[% rdonly = 'readonly' %]
+ <div class="cell">
[% IF (session.usergroup == 'admin') %]
- [% fieldeditbox('schemata','companies','Database-Schema','','readonly','','') %]
- [% rdonly = '' %]
+ [% fieldeditbox('schemata','companies','Database-Schema','','readonly','','','','') %]
+
[% END %]</div>
</div>
</div>
<div class="cell" style="width: 250px;">
<div class="bar moduletoolbar">
<div class="bar-item">Départements</div>
- <button class="bar-item toolbarbtn right" id="btn_delete_staffgroup" onclick="staffgroup.remove(); return false;"><span class="icon-remove text-red" style="font-size: 12px;"></span></button>
- <button class="bar-item toolbarbtn right" onclick="staffgroup.edit(); return false;"><span class="icon-edit" style="font-size: 12px;"></button>
- <button class="bar-item toolbarbtn right" onclick="staffgroup.add(); return false;"><span class="icon-plus" style="font-size: 12px;"></button>
+ <button class="bar-item toolbarbtn right" id="btn_delete_staffgroup" onclick="staffgroups.remove(); return false;"><span class="icon-remove text-red" style="font-size: 12px;"></span></button>
+ <button class="bar-item toolbarbtn right" onclick="staffgroups.edit(); return false;"><span class="icon-edit" style="font-size: 12px;"></button>
+ <button class="bar-item toolbarbtn right" onclick="staffgroups.add(); return false;"><span class="icon-plus" style="font-size: 12px;"></button>
</div>
<div id="tbl_staffgroups"></div>
</div>
- </form>
-
</div>
- <div class="row">
- <div class="bar moduletoolbar">
+ </form>
+ </div>
+ <div class="panel" id="pnl_worktimes" style="display: none;">
+ <div class="bar moduletoolbar">
<div class="bar-item PageHeadTitle">Configuration sectoriel POT</div>
<button class="bar-item toolbarbtn right" id="btn_delete_staffcontract" onclick="worktimes.remove(); return false;"><span class="icon-remove text-red" style="font-size: 16px;"></span><br/>supprimer</button>
- <button class="bar-item toolbarbtn right" onclick="worktimes.edit(); return false;"><span class="icon-edit" style="font-size: 16px;"><br/>éditer</button>
- <button class="bar-item toolbarbtn right" onclick="worktimes.add(); return false;"><span class="icon-plus" style="font-size: 16px;"><br/>ajouter</button>
+ <button class="bar-item toolbarbtn right" onclick="worktimes.edit(); return false;"><span class="icon-edit" style="font-size: 16px;"><br/>éditer</button>
+ <button class="bar-item toolbarbtn right" onclick="worktimes.add(); return false;"><span class="icon-plus" style="font-size: 16px;"><br/>ajouter</button>
</div>
- <div id="tbl_worktimes"></div>
- </div>
-
- </form>
+ <div id="tbl_worktimes"></div>
+ </div>
+ <div class="panel" id="pnl_users" style="display: none;">
+ <div class="bar moduletoolbar">
+ <div class="bar-item PageHeadTitle">Utilisateurs</div>
+ <button class="bar-item toolbarbtn right" id="btn_delete_staffcontract" onclick="users.remove(); return false;"><span class="icon-remove text-red" style="font-size: 16px;"></span><br/>supprimer</button>
+ <button class="bar-item toolbarbtn right" onclick="users.edit(); return false;"><span class="icon-edit" style="font-size: 16px;"><br/>éditer</button>
+ <button class="bar-item toolbarbtn right" onclick="users.add(); return false;"><span class="icon-plus" style="font-size: 16px;"><br/>ajouter</button>
+ </div>
+ <div id="tbl_users"></div>
</div>
-
</div>
</div>
</div>
-<div id="dlg_staffgroups" class="modal">
-
- <div class="modal-content animate-top card-4">
- <header>
- <span onclick="document.getElementById('dlg_staffgroups').style.display='none'; return false;"
- class="button toolbarbtn display-topright" ><span class="icon-remove" style="font-size: 18px;"></span></span>
- <h2 id="">Département</h2>
- </header>
- <div class="container">
- <form id="frm_staffgroups">
- [% fieldhidden("id_staffgroups","staffgroups",'ident','') %]
- [% fieldeditbox("groupname","staffgroups","Nom du Département",'third','','','') %]
- </form>
- </div>
- <footer>
- <button class="button margin-right border" onclick="document.getElementById('dlg_staffgroups').style.display='none'; return false;"><span class="icon-remove"></span> Annuler</button>
- <button class="button margin-right border" onclick="staffgroups.save();"><span class="icon-Save"></span> Sauvegarder</button>
- </footer>
- </div>
-</div>
-<div id="dlg_worktimes" class="modal">
-
- <div class="modal-content animate-top card-4">
- <header>
- <span onclick="document.getElementById('dlg_worktimes').style.display='none'; return false;"
- class="button toolbarbtn display-topright" ><span class="icon-remove" style="font-size: 18px;"></span></span>
- <h2 id="">Configuration Heures Sectoriel</h2>
- </header>
- <div class="container">
- <form id="frm_worktimes">
- [% fieldhidden("id_worktimes","worktimes",'ident','') %]
- <div class="container" id="worktimedates">
- [% fielddatebox('startdate','worktimes',"date Début",'fifth','','') %]
- [% fielddatebox('enddate','worktimes',"date Fin",'fifth','','') %]
- </div>
- <div class="container">
- [% fieldintervalbox("defaultdayhours",'worktimes','Heures/Jours','third','','') %]
- [% fieldintervalbox("maxdayhours",'worktimes','Max Heures/jour','third','','') %]
- </div>
- <div class="container">
- [% fieldintervalbox("defaultweekhours",'worktimes','Heures/Semaine','third','','') %]
- [% fieldintervalbox("maxweekhours",'worktimes','Max Heures/Semaine','third','','') %]
- </div>
- <div class="container">
- [% fieldintervalbox("maxinterruptionhours",'worktimes','Max Coupure','third','','') %]
-
- </div>
- </form>
- </div>
- <footer>
- <button class="button margin-right border" onclick="document.getElementById('dlg_worktimes').style.display='none'; return false;"><span class="icon-remove"></span> Annuler</button>
- <button class="button margin-right border" onclick="worktimes.save();"><span class="icon-Save"></span> Sauvegarder</button>
- </footer>
- </div>
-</div>
+[% INCLUDE module/companies/dlg_staffgroups.tt %]
+[% INCLUDE module/companies/dlg_worktimes.tt %]
+[% INCLUDE module/companies/dlg_users.tt %]
[% INCLUDE block/dlgdeleterow.tt %]
[% INCLUDE block/dlgmessage.tt %]
<script src="companies/companies.js"></script>
<script src="companies/staffgroups.js"></script>
-<script src="companies/worktimes.js"></script>
\ No newline at end of file
+<script src="companies/worktimes.js"></script>
+<script src="companies/users.js"></script>
\ No newline at end of file
companies.inittable();
staffgroups.inittable();
worktimes.inittable();
+ users.inittable();
// module.viewpanel("tbl_companies");
}
shouldSortItems: false,
choices : [{"value":"week","label":"semaine(s)"},{"value":"month","label":"mois"}]
});
+
},
inittable: function(){
companies.initform();
selectable: 1,
rowClick:function(e, row){
console.log("Filter selected");
- let fsel = companies.tbl.getSelectedData();
- console.log(fsel);
- companies.current_schemata = fsel[0].schemaname;
+
companies.edit();
//invoices.gettbldata(fsel);
//invoices.getsums(fsel);
},
rowContext:function(e, row){e.preventDefault();},
columns:[
- {title:"entreprise",field:"company",resizeable: false}
+ {title:"entreprise",field:"company",resizable:false}
// {title:"address",field:"address",headerFilter:"input"},
// {title:"cp",field:"zip",headerFilter:"input"},
// {title:"ville",field:"city",headerFilter:"input"},
//document.getElementById("company").removeEventListener('blur',function(){},true);
var udata = companies.tbl.getSelectedData();
if (udata[0]) {
+ // console.log(udata[0]);
+ // console.log("company schema:" + udata[0].schemata);
+ companies.current_schemata = udata[0].schemata;
//admin.setschemata();
//TODO: parent.setschemata(udata[0].schemata);
cleanform2("companies",companies.choices);
req.reqdata("POST", "db.cgi", { "get": "companies" + "data","schemata":schemata, "filter":"id='" + udata[0].id + "'"}, companies.fillform);
staffgroups.gettbldata();
worktimes.gettbldata();
+ //if (companies.current_view == 'nodata'){ companies.current_view = 'basedata';}
companies.setview(companies.current_view);
//module.viewpanel('frm_' +"companies");
+ } else {
+ module.viewpanel('nodata');
}
},
fillform: function(data){
module.viewpanel('tbl_' + "companies");
},
setview: function(viewname){
- companies.current_view = viewname;
- // if (viewname == 'periods'){
- // staffperiods.gettbldata();
- // }
- // if (viewname == 'basedata'){
- // //staff.edit();
- // }
- module.viewpanel(viewname);
-
+ let sel = companies.tbl.getSelectedData();
+ if (sel[0]){
+ companies.current_view = viewname;
+ module.viewpanel(viewname);
+ }
}
}
--- /dev/null
+<div id="dlg_staffgroups" class="modal">
+
+ <div class="modal-content animate-top card-4">
+ <header>
+ <span onclick="document.getElementById('dlg_staffgroups').style.display='none'; return false;"
+ class="button toolbarbtn display-topright" ><span class="icon-remove" style="font-size: 18px;"></span></span>
+ <h2 id="">Département</h2>
+ </header>
+ <div class="container">
+ <form id="frm_staffgroups">
+ [% fieldhidden("id_staffgroups","staffgroups",'ident','') %]
+ [% fieldeditbox("groupname","staffgroups","Nom du Département",'third','','','') %]
+ </form>
+ </div>
+ <footer>
+ <button class="button margin-right border" onclick="document.getElementById('dlg_staffgroups').style.display='none'; return false;"><span class="icon-remove"></span> Annuler</button>
+ <button class="button margin-right border" onclick="staffgroups.save();"><span class="icon-Save"></span> Sauvegarder</button>
+ </footer>
+ </div>
+</div>
\ No newline at end of file
-
-[% PROCESS macro/fields.tt %]
-<div class="display-container">
-<div class="bar moduletoolbar">
- <button class="bar-item toolbarbtn" onclick="users.viewtable();"><span class="icon-table" style="font-size: 16px;"></span><br/>Tableau</button>
- <div class="bar-item PageHeadTitle">Utilisateurs</div>
- <div class="toolbar" id="tbar_tbl_users">
- <button class="bar-item toolbarbtn right" onclick="users.remove();"><span class="icon-remove text-red" style="font-size: 16px;"></span><br/>supprimer</button>
- <!-- <button class="bar-item toolbarbtn right" onclick="users.edit();"><span class="icon-edit" style="font-size: 16px;"><br/>éditer</button> -->
- <button class="bar-item toolbarbtn right" onclick="users.add();"><span class="icon-plus" style="font-size: 16px;"><br/>ajouter</button>
- <button class="bar-item toolbarbtn right" onclick="users.sendnewpassword(); return false;"><span class="icon-sendemail" style="font-size: 16px;"><br/>envoyer mot de passe</button>
-</div>
- </div>
-</div>
-<div class="display-container">
-<div class="cell-row">
-<div class="cell" style="width: 400px;">
- <div id="tbl_users"></div>
- </div>
-<div class="cell" >
- <div class="panel" id="pnl_nodata">
- <div class="bar moduletoolbar">
- <div class="bar-item PageHeadTitle"> </div>
- </div>
- <div class="row center" style="margin-top: 200px;">
- <img src="[% abpspath%][% staticpath %]img/toplogo.png" style="margin: auto;">
- </div>
- </div>
- <div class="panel" id="pnl_users" style="display: none;">
- <div class="bar moduletoolbar">
- <div class="bar-item PageHeadTitle">Données de base du utilisateur</div>
-
- </div>
+<div id="dlg_users" class="modal">
+ <div class="modal-content animate-top card-4">
+ <header>
+ <span onclick="document.getElementById('dlg_users').style.display='none'; return false;"
+ class="button toolbarbtn display-topright" ><span class="icon-remove" style="font-size: 18px;"></span></span>
+ <h2>Utilisateur</h2>
+ </header>
+ <div class="container">
+ <div id="usermsg" ></div>
<form id="frm_users">
[% ro = 'readonly' %]
[% IF session.usergroup == 'admin' %]
[% ro = '' %]
[% END %]
- [% fieldhidden('id','users','ident') %]
+ [% fieldhidden('users_id','users','ident') %]
<div class="row" style="margin-top: 5px;">
<div class="row">
<div class="cell" style="width: 300px;">
- [% fieldeditbox("username","users","Login / E-Mail",'','','','','record.savefield(this);') %]
+ [% fieldeditbox("username","users","Login / E-Mail",'','','','','') %]
</div>
<div class="cell" style="width: 200px;">
[% fieldcheckbox("blocked","users","compte blocké",'',ro,'1') %]
</div>
<div class="row">
<div class="cell" style="width: 250px;">
- [% fieldeditbox('surname','users','Nom','','','','','record.savefield(this);') %]
+ [% fieldeditbox('surname','users','Nom','','','','','') %]
</div>
<div class="cell" style="width: 250px;">
- [% fieldeditbox('prename','users','Prénom','','','','','record.savefield(this);') %]
+ [% fieldeditbox('prename','users','Prénom','','','','','') %]
</div>
</div>
- <div class="row">
+ <!-- <div class="row">
<div class="cell" style="width: 250px;">
- [% fieldeditbox('job','users','Position','','','','','record.savefield(this);') %]
+ [% fieldeditbox('job','users','Position','','','','','') %]
</div>
<div class="cell" style="width: 250px;">
- [% fieldeditbox('phone','users','Téléphone','','','','','record.savefield(this);') %]
+ [% fieldeditbox('phone','users','Téléphone','','','','','') %]
</div>
- </div>
-
-
-
-
- </div>
+ </div>
+ </div>-->
<div class="row">
<div class="bar moduletoolbar">
<div class="bar-item PageHeadTitle">Accès du utilisateur</div>
[% fieldselectbox("id_usergroup","users","Accès Groupe",'','','') %]
</div>
<div class="cell">
- [% fieldmultiselectbox("schemaaccess","users","Accès DataSet",'',ro,'') %]
+ [% fieldmultiselectbox("schemaaccess","users","Accès DataSet",'','','') %]
</div>
</div>
</div>
</div>
</form>
-
- </div>
-</div>
-</div>
-</div>
-
-[% INCLUDE block/dlgdeleterow.tt %]
-[% INCLUDE block/dlgmessage.tt %]
-
-<div id="dlg_users" class="modal">
- <div class="modal-content animate-top card-4">
- <header>
- <span onclick="document.getElementById('dlg_users').style.display='none'; return false;"
- class="button toolbarbtn display-topright" ><span class="icon-remove" style="font-size: 18px;"></span></span>
- <h2>Données de base du utilisateur</h2>
- </header>
- <div class="container">
- <div id="usermsg" ></div>
-
</div>
<footer>
<button class="button orange border" id="btnnewpasswd" onclick="users.sendnewpassword(); return false;">Envoyer mot de passe</button>
<button class="button margin right-align" onclick="users.validateform();"><span class="icon-Save"></span> Sauvegarder</button>
</footer>
</div>
-</div>
-<script src="users/users.js"></script>
-
+</div>
\ No newline at end of file
--- /dev/null
+<div id="dlg_worktimes" class="modal">
+
+ <div class="modal-content animate-top card-4">
+ <header>
+ <span onclick="document.getElementById('dlg_worktimes').style.display='none'; return false;"
+ class="button toolbarbtn display-topright" ><span class="icon-remove" style="font-size: 18px;"></span></span>
+ <h2 id="">Configuration Heures Sectoriel</h2>
+ </header>
+ <div class="container">
+ <form id="frm_worktimes">
+ [% fieldhidden("id_worktimes","worktimes",'ident','') %]
+ <div class="container" id="worktimedates">
+ [% fielddatebox('startdate','worktimes',"date Début",'fifth','','') %]
+ [% fielddatebox('enddate','worktimes',"date Fin",'fifth','','') %]
+ </div>
+ <div class="container">
+ [% fieldintervalbox("defaultdayhours",'worktimes','Heures/Jours','third','','') %]
+ [% fieldintervalbox("maxdayhours",'worktimes','Max Heures/jour','third','','') %]
+ </div>
+ <div class="container">
+ [% fieldintervalbox("defaultweekhours",'worktimes','Heures/Semaine','third','','') %]
+ [% fieldintervalbox("maxweekhours",'worktimes','Max Heures/Semaine','third','','') %]
+ </div>
+ <div class="container">
+ [% fieldintervalbox("maxinterruptionhours",'worktimes','Max Coupure','third','','') %]
+
+ </div>
+ </form>
+ </div>
+ <footer>
+ <button class="button margin-right border" onclick="document.getElementById('dlg_worktimes').style.display='none'; return false;"><span class="icon-remove"></span> Annuler</button>
+ <button class="button margin-right border" onclick="worktimes.save();"><span class="icon-Save"></span> Sauvegarder</button>
+ </footer>
+ </div>
+</div>
\ No newline at end of file
inittable: function(){
staffgroups.tbl = new Tabulator("#tbl_staffgroups", {
headerVisible:false,
- height: "240px",
+ height: "254px",
layout: "fitDataStretch",
selectable: 1,
rowContext:function(e, row){ e.preventDefault(); },
columns: [{ title: "Département", field: "groupname" }]
});
- staffgroups.gettbldata();
+ //staffgroups.gettbldata();
},
gettbldata: function(){
sel = companies.tbl.getSelectedData();
if (sel[0]){
- req.reqdata("POST", "db.cgi", { "get": "staffgroupslist","schemata":companies.current_schemata}, staffgroups.loadtbldata);
+ console.log(sel[0]);
+ req.reqdata("POST", "db.cgi", { "get": "staffgroupslist","schemata":sel[0].schemata}, staffgroups.loadtbldata);
}
},
-var schemata = "public";
-var currentview = null;
-function initpage(){
- users.inittable();
- //module.viewpanel("tbl_users");
-}
+
var users ={
tbl: null,
},
inittable: function(){
users.initform();
- users.tbl = new Tabulator("#tbl_" + "users", {
- height: "calc(100vh - 120px)",
+ users.tbl = new Tabulator("#tbl_users", {
+ height: "calc(100vh - 176px)",
layout: "fitDataStretch",
selectable: 1,
- rowClick:function(e, row){
- console.log("Filter selected");
- let fsel = users.tbl.getSelectedData();
- console.log(fsel);
- users.edit();
- //invoices.gettbldata(fsel);
- //invoices.getsums(fsel);
- },
+ // rowClick:function(e, row){
+ // console.log("Filter selected");
+ // let fsel = users.tbl.getSelectedData();
+ // console.log(fsel);
+ // users.edit();
+ // //invoices.gettbldata(fsel);
+ // //invoices.getsums(fsel);
+ // },
rowContext:function(e, row){ e.preventDefault();},
columns:[
// {title:"Entreprise", field:"company",headerFilter:"input"},
{title:"Nom", field:"surname",resizable: false},
- {title:"Prénom", field:"prename",resizeable: false},
+ {title:"Prénom", field:"prename",resizable:false},
+ {title:"Accès", field:"usergroup",resizable:false},
+ {title:"Bloqué", field:"blocked",formatter:"tickCross",hozAlign:"center",
+ formatterParams:{allowEmpty:true,allowTruthy:true,tickElement:'<span style="color: green;">✔</span>'}},
// {title:"Accès",field:"groupname",headerFilter:"input"},
// {title:"Position",field:"job"},
// {title:"Téléphone",field:"phone"},
// {title:"E-mail",field:"username"},
- // {title:"Bloqué", field:"blocked",formatter:"tickCross",align:"center",
- // formatterParams:{allowEmpty:true,allowTruthy:true,tickElement:'<span style="color: green;">✔</span>'}},
+ //
],
});
- users.gettbldata();
+ //users.gettbldata();
},
gettbldata: function(){
- //console.log("[% session.usergroup %]");
- // [% IF session.usergroup == 'admin' %]
- // req.reqdata("POST", "db.cgi", { "get": "users" + "list","schemata":schemata}, users.loadtbldata);
- // [% ELSE %]
- var ds = document.getElementById('schemata').value;
- req.reqdata("POST", "db.cgi", { "get": "userslist","schemata":schemata,"filter":"schemaaccess='" + ds + "'"}, users.loadtbldata);
- // [% END %]
+ let sel= companies.tbl.getSelectedData();
+ if (sel[0]){
+ req.reqdata("POST", "db.cgi", { "get": "userslist","schemata":schemata,"filter":" schemaaccess='" + sel[0].schemata + "'"}, users.loadtbldata);
+ }
},
loadtbldata: function(data){
if (data && data.sqldata) { users.tbl.setData(data.sqldata);}
if (udata[0]) {
cleanform2("users",users.choices);
req.reqdata("POST", "db.cgi", { "get": "users" + "data","schemata":schemata, "filter":"id='" + udata[0].id + "'"}, users.fillform);
- //module.viewdialog("users");
+ module.viewdialog("users");
}
},
fillform: function(data){
var filter = "username='"+ newusername+ "'";
if (iduser != ''){
- filter += " and id!=" + iduser;
+ filter += " and id !=" + iduser;
}
req.reqdata("POST","db.cgi",{"get":"usersdata","filter":filter},users.checkmailreturn);
}else {
inittable: function(){
worktimes.tbl = new Tabulator("#tbl_" + "worktimes", {
headerFilterPlaceholder: "filter...",
- height: "calc(100vh - 517px)",
- layout: "fitData",
+ height: "calc(100vh - 176px)",
+ layout: "fitDataStretch",
selectable: 1,
rowContext:function(e, row){ e.preventDefault(); },
columns: [
- { title: "Date Début", field: "startdate",headerSort: true,formatter:"datetime",formatterParams:{inputFormat:"YYYY-MM-DD",outputFormat:"DD.MM.YYYY",invalidPlaceholder:""}},
- { title: "Date Fin", field: "enddate",headerSort: true,formatter:"datetime",formatterParams:{inputFormat:"YYYY-MM-DD",outputFormat:"DD.MM.YYYY",invalidPlaceholder:""}},
- { title: "Heures/Jour", field: "defaultdayhours",headerSort: false},
- { title: "Max Heures/jour", field: "maxdayhours",headerSort: false},
- { title: "Heures/Semaine", field: "defaultweekhours",headerSort: false},
- { title: "Max Heures/Semaine", field: "maxweekhours",headerSort: false},
- { title: "Max Coupure", field: "maxinterruptionhours",headerSort: false},
+ { title: "Début", field: "startdate",headerSort: true,formatter:"datetime",formatterParams:{inputFormat:"YYYY-MM-DD",outputFormat:"DD.MM.YYYY",invalidPlaceholder:""}},
+ { title: "Fin", field: "enddate",headerSort: true,formatter:"datetime",formatterParams:{inputFormat:"YYYY-MM-DD",outputFormat:"DD.MM.YYYY",invalidPlaceholder:""}},
+ { title: "H/j", field: "defaultdayhours",headerSort: false},
+ { title: "Max H/j", field: "maxdayhours",headerSort: false},
+ { title: "H/Sem.", field: "defaultweekhours",headerSort: false},
+ { title: "Max H/Sem.", field: "maxweekhours",headerSort: false},
+ { title: "Max Coup.", field: "maxinterruptionhours",headerSort: false},
{ title: "Standard", field: "isdefault",headerSort: false}
]
});
worktimes.initform();
- worktimes.gettbldata();
+ //worktimes.gettbldata();
},
gettbldata: function(){
- req.reqdata("POST", "db.cgi", { "get": "worktimes" + "list","schemata":companies.current_schemata}, worktimes.loadtbldata);
+ let sel = companies.tbl.getSelectedData();
+ if (sel[0]){
+ req.reqdata("POST", "db.cgi", { "get": "worktimes" + "list","schemata":sel[0].schemata}, worktimes.loadtbldata);
+ }
+
},
loadtbldata: function(data){
if (data && data.sqldata) { worktimes.tbl.setData(data.sqldata);}
-
-
-<div class="display-container">
- <div class="container">
- <div class="panel" id="msg"></div>
- </div>
- <div class="container">
- <div class="row">
-
- </div>
- </div>
-</div>
+[% INCLUDE module/periods.tt %]
-[% PROCESS macro/fields.tt %]
+[% #PROCESS macro/fields.tt %]
[% #wd = [ {'wd' => 'mon' ,'day' => 'Lundi'}, {'wd' => 'tue','day' => 'Mardi'}, {'wd' => 'wed','day' => 'Mercredi'}, {'wd' => 'thu','day' => 'Jeudi'}, {'wd' => 'fri','day' => 'Vendredi'}, {'wd' => 'sat' ,'day' => 'Samedi'},{'wd' => 'sun','day' =>'Dimanche'} ] %]
<div class="display-container">
<div class="bar moduletoolbar">
- <button class="bar-item toolbarbtn" onclick="staff.viewtable();"><span class="icon-table" style="font-size: 16px;"></span><br/>Tableau</button>
+ <!-- <button class="bar-item toolbarbtn" onclick="staff.viewtable();"><span class="icon-table" style="font-size: 16px;"></span><br/>Tableau</button> -->
<div class="bar-item PageHeadTitle">Périodes de références</div>
<div class="toolbar paneltoolbar" id="tlb_periods">
<button class="bar-item toolbarbtn right" onclick="reportperiod.add();"><span class="icon-plus" style="font-size: 16px;"><br/>ajouter</button>
<div id="tbl_reportperiodfilter"></div>
</div>
<div class="cell">
- <div class="panel" id="pnl_nodata">
- <div class="bar moduletoolbar">
- <div class="bar-item PageHeadTitle"> </div>
- </div>
- <div class="row center" style="margin-top: 200px;">
- <img src="[% abpspath%][% staticpath %]img/toplogo.png" style="margin: auto;">
- </div>
- </div>
+ [% INCLUDE block/pnl_nodata.tt %]
<div class="panel" id="pnl_periods" style="display: none;">
<div id="tbl_reportperiod"></div>
</div>
</div>
</div>
</div>
-
- [% #INCLUDE %]
-
[% INCLUDE block/dlgdeleterow.tt %]
[% INCLUDE block/dlgmessage.tt %]
[% INCLUDE block/dlgdataload.tt %]
// {title:"#", formatter:"rownum",align:"right",sorter:false},
// {title: "No.", field: "staffnumber",sorter: "String", headerFilter: "input" },
{title: "Départment", field: "groupname", visible: false },
- {title: "Nom", field: "surname" ,resizeable: false },
- {title: "Prénom",field: "prename",resizeable: false},
+ {title: "Nom", field: "surname" ,resizable:false },
+ {title: "Prénom",field: "prename",resizable:false},
// {title: "Job", field: "job",sorter: "String", headerFilter: "input" },
]
[% PROCESS macro/fields.tt %]
-[% wd = [
- {'wd' => 'mon' ,'day' => 'Lundi'}, {'wd' => 'tue','day' => 'Mardi'}, {'wd' => 'wed','day' => 'Mercredi'}, {'wd' => 'thu','day' => 'Jeudi'}, {'wd' => 'fri','day' => 'Vendredi'}, {'wd' => 'sat' ,'day' => 'Samedi'}, {'wd' => 'sun','day' =>'Dimanche'}
-]
-%]
+
<div class="display-container">
<div class="bar moduletoolbar">
<button class="bar-item toolbarbtn" onclick="staff.viewtable();"><span class="icon-table" style="font-size: 16px;"></span><br/>Tableau</button>
<div class="bar-item PageHeadTitle">Plans de travail (modèles)</div>
<div class="toolbar" id="tbar_tbl_workplans">
<button class="bar-item toolbarbtn right" onclick="workplans.remove();"><span class="icon-remove text-red" style="font-size: 16px;"></span><br/>supprimer</button>
- <button class="bar-item toolbarbtn right" onclick="workplans.edit();"><span class="icon-edit" style="font-size: 16px;"><br/>éditer</button>
+ <!-- -->
<button class="bar-item toolbarbtn right" onclick="workplans.add();"><span class="icon-plus" style="font-size: 16px;"><br/>ajouter</button>
<button class="bar-item toolbarbtn right" onclick="workplans.rename();"><span class="icon-rename" style="font-size: 16px;"><br/>renomer</button>
</div>
<div class="toolbar" id="tbar_frm_staff" style="display: none;">
</div>
+</div>
+</div>
+<div class="display-container">
+ <div class="cell-row">
+ <div class="cell" style="width: 300px;">
+ <div id="tbl_workplans"></div>
+ </div>
+ <div class="cell">
+ <div class="panel" id="pnl_nodata">
+ <div class="bar moduletoolbar">
+ <div class="bar-item PageHeadTitle"> </div>
+ </div>
+ <div class="row center" style="margin-top: 200px;">
+ <img src="[% abpspath%][% staticpath %]img/toplogo.png" style="margin: auto;">
+ </div>
+ </div>
+ <div class="panel" id="pnl_workplans" style="display: none;">
+ <div class="bar moduletoolbar">
+ <div class="bar-item PageHeadTitle">Modèle</div>
+ <button class="bar-item toolbarbtn right" onclick="workplans.addweek();"><span class="icon-plus" style="font-size: 16px;"><br/>ajouter semaine</button>
+ <button class="bar-item toolbarbtn right text-red" onclick="workplans.removewek();"><span class="icon-remove" style="font-size: 16px;"><br/>supprimer semaine</button>
+ <button class="bar-item toolbarbtn right" onclick="workplans.edit();"><span class="icon-edit" style="font-size: 16px;"><br/>éditer</button>
+ </div>
+ <div id="tbl_workplandata"></div>
+ </div>
+
</div>
- <div class="display-container panel" id="pnl_tbl_workplans">
- <div id="tbl_workplans"></div>
</div>
+</div>
+
+
+
<!-- DLG BEGIN workplanday -->
<div id="dlg_workplanday" class="modal">
<div class="modal-content animate-top card-4">
</form>
</div>
<footer>
- <button class="button theme-light margin-right border" onclick="document.getElementById('dlg_workplanday').style.display='none'; return false;"><span class="icon-remove"></span> <span class="icon-remove"></span> Annuler</button>
- <button class="button blue-grey margin-right border" id="btn_saveday" onclick="workplans.save();return false;"><span class="icon-Save"></span> <span class="icon-Save"></span> Sauvegarder</button>
+ <button class="button theme-light margin-right border" onclick="document.getElementById('dlg_workplanday').style.display='none'; return false;"><span class="icon-remove"></span Annuler</button>
+ <button class="button blue-grey margin-right border" id="btn_saveday" onclick="workplans.save();return false;"><span class="icon-Save"></span> Sauvegarder</button>
</footer>
</div>
</div>
</div>
</div>
<!-- DLG END workplan -->
-</div>
+
[% INCLUDE block/dlgdeleterow.tt %]
<script src="workplans/workplans.js"></script>
var weekdays= ["","lundi","mardi","mercredi","jeudi","vendredi","samedi","dimanche"];
var workplans ={
- name:"workplans",
choices:{},
tbl: null,
+ tblfilter: null,
+ current_view: 'workplans',
initform: function(){
flatpickr(".timefield",{
dateFormat: "H:i",
}
},
inittable: function(){
- workplans.tbl = new Tabulator("#tbl_" + workplans.name, {
+ workplans.tblfilter = new Tabulator("#tbl_workplans", {
headerFilterPlaceholder: "filter...",
- height: "93vh",
- layout: "fitDataFill",
+ height: "calc(100vh - 120px)",
+ layout: "fitDataStretch",
selectable: 1,
+ rowClick:function(e, row){
+ // console.log("Filter selected");
+ // let fsel = workplans.tblfilter.getSelectedData();
+ // console.log(fsel);
+ workplans.viewplan();
+ //invoices.gettbldata(fsel);
+ //invoices.getsums(fsel);
+ },
rowContext:function(e, row){e.preventDefault(); },
- groupBy:["workplan"],
+ // groupBy:["workplan"],
+ // groupStartOpen:[true],
+ // groupClosedShowCalcs:true,
+ // groupHeader:[
+ // function(value, count, data){
+ // return value;
+ // },
+ // ],
+ columns: [
+ { title: "Modèle",field: "workplan",headerSort: true },
+ ]
+ });
+ workplans.tbl = new Tabulator("#tbl_workplandata", {
+ headerFilterPlaceholder: "filter...",
+ height: "calc(100vh - 180px)",
+ layout: "fitDataStretch",
+ selectable: 1,
+ rowContext:function(e, row){e.preventDefault(); },
+ groupBy:["weeknum"],
groupStartOpen:[true],
groupClosedShowCalcs:true,
groupHeader:[
function(value, count, data){
- return value;
+ return "Semaine " + value;
},
],
columns: [
{ title: "total",field: "dayhours",headerSort: false,bottomCalc:workplans.weekhourssum },
]
});
- workplans.gettbldata();
+ workplans.gettblfilterdata();
workplans.initform();
},
- gettbldata: function(){
- req.reqdata("POST", "db.cgi", {"get": "workplandayslist" ,"schemata":schemata}, workplans.loadtbldata);
+ gettblfilterdata: function(){
+ req.reqdata("POST", "db.cgi", {"get": "workplanlist" ,"schemata":schemata}, workplans.loadtblfilterdata);
+ },
+ loadtblfilterdata: function(data){
+ if (data && data.sqldata) {
+ workplans.tblfilter.setData(data.sqldata);
+ }
+ },
+ gettbldata: function(wkid){
+ req.reqdata("POST", "db.cgi", {"get": "workplandayslist" ,"filter":" id_workplan='" + wkid + "'","schemata":schemata}, workplans.loadtbldata);
},
loadtbldata: function(data){
if (data && data.sqldata) {
workplans.tbl.setData(data.sqldata);
}
},
+ viewplan: function(){
+ let wpsel = workplans.tblfilter.getSelectedData();
+ workplans.gettbldata(wpsel[0].id);
+ workplans.setview("workplans");
+ },
+ setview: function(viewname){
+ workplans.current_view = viewname;
+ module.viewpanel(viewname);
+ },
edit: function() {
cleanform("workplandays");
var udata = workplans.tbl.getSelectedData();