v20200215
authorkilian (dks-laptop) <ksaffran@dks.lu>
Sun, 16 Feb 2020 08:23:16 +0000 (09:23 +0100)
committerkilian (dks-laptop) <ksaffran@dks.lu>
Sun, 16 Feb 2020 08:23:16 +0000 (09:23 +0100)
24 files changed:
backoffice/data/output/pot/periode_20191230-20200223_pot_period.pdf
backoffice/data/tmp/pot_period1348.footer.html [new file with mode: 0644]
backoffice/data/tmp/pot_period1348.header.html [new file with mode: 0644]
backoffice/data/tmp/pot_period1348.html [new file with mode: 0644]
backoffice/img/icons/coin.svg [new file with mode: 0644]
backoffice/img/icons/edit.svg
backoffice/img/icons/pay.svg [new file with mode: 0644]
backoffice/img/icons/plus.svg
backoffice/img/icons/plus2.svg [new file with mode: 0644]
backoffice/img/icons/remove.svg
backoffice/img/icons/remove_2.svg [new file with mode: 0644]
backoffice/img/icons/rename.svg [new file with mode: 0644]
backoffice/img/icons/table.svg [new file with mode: 0644]
backoffice/js/formsave.js
backoffice/js/module_global.js
backoffice/tmpl/module/companies/index.tt
backoffice/tmpl/module/companies/staffgroups.js
backoffice/tmpl/module/periods/index.tt
backoffice/tmpl/module/periods/reportperiod.js
backoffice/tmpl/module/staff/index.tt
backoffice/tmpl/module/staff/staffcontract.js
backoffice/tmpl/module/users/index.tt
backoffice/tmpl/module/workplans/index.tt
backoffice/tmpl/module/workplans/workplans.js

index 548398e..dde6855 100644 (file)
Binary files a/backoffice/data/output/pot/periode_20191230-20200223_pot_period.pdf and b/backoffice/data/output/pot/periode_20191230-20200223_pot_period.pdf differ
diff --git a/backoffice/data/tmp/pot_period1348.footer.html b/backoffice/data/tmp/pot_period1348.footer.html
new file mode 100644 (file)
index 0000000..8a5797b
--- /dev/null
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="UTF-8">
+<script>
+function subst() {
+    var vars = {};
+    var query_strings_from_url = document.location.search.substring(1).split('&');
+    for (var query_string in query_strings_from_url) {
+        if (query_strings_from_url.hasOwnProperty(query_string)) {
+            var temp_var = query_strings_from_url[query_string].split('=', 2);
+            vars[temp_var[0]] = decodeURI(temp_var[1]);
+        }
+    }
+    var css_selector_classes = ['page', 'frompage', 'topage', 'webpage', 'section', 'subsection', 'date', 'isodate', 'time', 'title', 'doctitle', 'sitepage', 'sitepages'];
+    for (var css_class in css_selector_classes) {
+        if (css_selector_classes.hasOwnProperty(css_class)) {
+            var element = document.getElementsByClassName(css_selector_classes[css_class]);
+            for (var j = 0; j < element.length; ++j) {
+                element[j].textContent = vars[css_selector_classes[css_class]];
+            }
+        }
+    }
+}
+</script></head>
+<body style="border:0; margin: 0;" onload="subst()">
+<table style="width: 100%;" >
+  <tr><td colspan="2" style="text-align: center;"><span class="date"></span>&nbsp;<span class="time"></span></td></tr>
+  <tr>
+    <td></td>
+    <td style="text-align:right">
+      Page <span class="page"></span>/<span class="topage"></span>
+    </td>
+  </tr>
+</table>
+</body></html>
\ No newline at end of file
diff --git a/backoffice/data/tmp/pot_period1348.header.html b/backoffice/data/tmp/pot_period1348.header.html
new file mode 100644 (file)
index 0000000..dcac0a4
--- /dev/null
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+<!DOCTYPE html>
+<html><head>
+<meta charset="UTF-8">
+</head><body style="border:0; margin: 0;" o>
+<table style="width: 100%;">
+  <tr>
+    <td style="width: 150mm; margin-top:5mm;">
+      <h2>Plan d'Organisation du Travail<h2>
+      <h4>du 30.12.2019 au 23.02.2020</h4>
+    </td>
+    <td style="width: 60mm;text-align: right;">
+      <div style="text-align: left;width: 60mm; font-size: 12pt;font: sans;">
+          <b>Portanova s.à r.l.</b><br/>
+          rue de la faïencerie<br/> 
+           Luxembourg<br/><br/>
+          <br/>
+          TVA: <br/>
+      </div>
+    </td>
+    <tr><td style="text-align: left;"></td><td></td></tr>
+  </tr>
+</table>
+</body></html>
diff --git a/backoffice/data/tmp/pot_period1348.html b/backoffice/data/tmp/pot_period1348.html
new file mode 100644 (file)
index 0000000..b8d46dd
--- /dev/null
@@ -0,0 +1,71 @@
+
+
+<!DOCTYPE html>
+<html>
+<head>
+  <title>Invoice</title>
+  <style>
+  div {
+  font-size: 18pt;
+}
+table {
+  font-size: 18pt;
+  border-spacing: unset;
+  border-collapse: unset;
+}
+td.invdatalbl {
+  font-weight: bold;
+  margin: 1mm; 
+  padding: 2mm;
+  border-collapse:collapse;;
+  width: 30mm;
+  background-color: #c6c6c6;
+}
+td.invdataval {
+  font-weight: normal; 
+  margin: 1mm; 
+  padding: 2mm;
+}
+.right{
+  text-align: right;
+}
+table#tbl_products {
+  border-spacing: 0;
+  border-collapse: 0;
+  margin-top: 10mm;
+  width: 100%;
+}
+table#tbl_products td {
+  padding: 2mm;
+  border-bottom: 1px solid black;
+}
+
+table#tbl_products th {
+  margin: 1mm; 
+  border: 1px solid #fff;
+  border-bottom: 0px;
+  padding: 2mm;
+  background-color: #c6c6c6;
+}
+
+th.footer {
+  margin: 1mm; 
+  border: 1px solid #fff;
+  background-color: unset;
+  border-bottom: 0px;
+  padding: 2mm;
+  text-align: right;
+}
+  </style>
+</head>
+<body>
+  <table>
+    <thead>
+      <tr><td></td></tr>
+    </thead>
+    <tbody>
+      <tr><td></td></tr>
+    </tbody>
+  </table>
+</body>
+</html>
\ No newline at end of file
diff --git a/backoffice/img/icons/coin.svg b/backoffice/img/icons/coin.svg
new file mode 100644 (file)
index 0000000..bd41fa8
--- /dev/null
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="utf-8"?> \r<svg version="1.2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" \r      x="0px" y="0px" width="50px" height="50px" viewBox="0 0 64 64"> \r<path d="M33.268005,19.220637C30.104004,19.220637 27.630007,20.520768 25.836,23.120908 24.764009,24.671055 24.026003,26.491116 23.632021,28.581213L19.980014,28.581213 19.255008,31.041451 23.365999,31.041451C23.33301,31.461399 23.317019,31.891479 23.317019,32.32156 23.317019,32.801571 23.33301,33.291594 23.365999,33.761593L19.980014,33.761593 19.255008,36.201811 23.599001,36.201811C24.042025,39.211887 25.067019,41.562132 26.654024,43.232161 28.339022,45.022314 30.419006,45.902372 32.874023,45.902372 35.755005,45.902372 38.024017,44.822348 39.708008,42.642157 41.123016,40.831984 41.958008,38.601864 42.210999,35.941784L39.406006,35.941784C39.108002,37.611811 38.684998,38.941973 38.085022,39.981956 36.984009,41.92214 35.344025,42.892172 33.220001,42.892172 30.906006,42.892172 29.173004,41.972071 28.025026,40.13199 27.315004,39.021935 26.828005,37.721804 26.546022,36.221708L35.565002,36.221708 36.307007,33.761593 26.292025,33.761593C26.276003,33.501566 26.276003,33.201622 26.276003,32.901554 26.276003,32.251488 26.292025,31.621443 26.340029,31.041451L35.582001,31.041451 36.307007,28.581213 26.687014,28.581213C27.001009,27.06122 27.505007,25.81114 28.214022,24.840986 29.503998,23.090877 31.205017,22.210815 33.301025,22.210815 35.014008,22.210815 36.351013,22.680938 37.299011,23.64096 38.258026,24.58096 38.887024,25.891102 39.201019,27.511198L42.022003,27.511198C41.848999,25.37105 41.031006,23.451006 39.535004,21.750826 38.052002,20.070788 35.960022,19.220637 33.268005,19.220637z M32.003021,8.5999718C44.921021,8.5999722 55.402004,19.080613 55.402004,32.001472 55.402004,44.922331 44.921021,55.402971 32.003021,55.402971 19.08002,55.402971 8.5990036,44.922331 8.5990038,32.001472 8.5990036,19.080613 19.061007,8.5999722 32.003021,8.5999718z M32.004,3.1699991C16.104,3.1699996 3.1679997,16.1 3.1679993,32 3.1679997,47.9 16.104,60.83 32.004,60.83 47.899998,60.83 60.832001,47.9 60.832001,32 60.832001,16.1 47.899998,3.1699996 32.004,3.1699991z M32.004,0C49.646,0 64,14.35 64,32 64,49.640001 49.646,63.999998 32.004,63.999998 14.355999,63.999998 0,49.640001 0,32 0,14.35 14.355999,0 32.004,0z"/> \r</svg>
\ No newline at end of file
index c0bb9ac..ab200c3 100644 (file)
@@ -1,3 +1 @@
-<svg id="glyphicons-basic" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
-  <path id="square-edit" d="M24,16.65674l3-3V23.5A3.50424,3.50424,0,0,1,23.5,27H8.5A3.50424,3.50424,0,0,1,5,23.5V8.5A3.50424,3.50424,0,0,1,8.5,5h15a3.48475,3.48475,0,0,1,.756.08728L21.34326,8H8.5a.50641.50641,0,0,0-.5.5v15a.50641.50641,0,0,0,.5.5h15a.50641.50641,0,0,0,.5-.5ZM13.81323,20.63306c-.20654.5122.04108.76013.55316.55322,1.38123-.55786,3.8205-1.54492,3.84064-1.56519,0,0-2.82855-2.82812-2.85669-2.80029Zm12.8938-9.512L23.8786,8.293l-7.08588,7.08545L19.62128,18.207Zm2.92462-3.63183-2.12127-2.1211a.49991.49991,0,0,0-.7071,0L25.29285,6.87842,28.12128,9.707l1.51037-1.51025A.50052.50052,0,0,0,29.63165,7.48926Z"/>
-</svg>
+<?xml version="1.0" encoding="utf-8"?> \r<svg version="1.2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" \r      x="0px" y="0px" width="50px" height="50px" viewBox="0 0 45.17 64"> \r<path d="M0,51.811003L12.293,58.86939 1.1757193,63.999998z M18.11735,12.648L38.103998,24.119321 22.75799,50.853998 21.614605,47.435965 15.750179,46.830458 14.753991,43.156118 9.0027626,42.957916 7.3934724,38.929478 2.7749995,39.382679z M27.724333,0.00095844269C28.275374,-0.012296677,28.813618,0.11171532,29.298115,0.38925457L43.451544,8.5127215C45.170199,9.5000639,45.55559,12.057143,44.314722,14.221125L42.627268,17.164001 22.244999,5.4634366 23.932455,2.5205812C24.82433,0.96517754,26.316117,0.034832954,27.724333,0.00095844269z"/> \r</svg>
\ No newline at end of file
diff --git a/backoffice/img/icons/pay.svg b/backoffice/img/icons/pay.svg
new file mode 100644 (file)
index 0000000..559f80d
--- /dev/null
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="utf-8"?> \r<svg version="1.2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" \r      x="0px" y="0px" width="50px" height="50px" viewBox="0 0 47.64 61.79"> \r<path d="M10.477999,55.232002L31.059999,55.232002 31.059999,61.785002 10.477999,61.785002z M32.417159,28.473481C33.70256,28.4235,34.953872,29.131779,35.53502,30.368215L39.840081,39.530168C40.469497,40.869559,40.119949,42.418693,39.081754,43.368135L38.891232,43.52566 31.381672,51.425687 31.339984,51.517884C30.892864,52.445679,29.943482,53.086002,28.844799,53.086002L13.062199,53.086002C11.5336,53.086002,10.293999,51.84651,10.293999,50.317823L10.293999,40.611001 17.803291,48.120142C18.746099,49.062719 19.998712,49.581107 21.330724,49.581107 22.662837,49.581107 23.915349,49.062719 24.856857,48.120142L31.612998,41.364197 31.612998,43.237227 33.397169,41.599575 29.461611,33.222456C28.685346,31.572674,29.395205,29.607777,31.045043,28.831638L31.143951,28.784737C31.556437,28.591052,31.988692,28.490141,32.417159,28.473481z M23.179852,25.222441L20.11737,28.283819C21.320463,29.10534 22.295757,29.141841 23.043053,28.394422 23.668149,27.769406 23.713749,26.712079 23.179852,25.222441z M25.885637,18.194962C25.36344,18.192261 24.916842,18.377266 24.545744,18.748276 24.153747,19.141685 23.940248,19.568697 23.905048,20.032209 23.869848,20.49572 23.996248,21.125937 24.284046,21.921556L27.457228,18.748276C26.931031,18.381067,26.406434,18.197462,25.885637,18.194962z M30.359412,15.846001L31.457204,16.94363 30.057413,18.343365C31.276106,19.625898,31.991002,20.637724,32.202,21.378643L30.50011,23.080585C30.274911,22.007559,29.640815,20.916431,28.595222,19.807003L24.928542,23.473696C25.696838,25.322743 26.067836,26.74338 26.041835,27.735605 26.014436,28.726431 25.679838,29.542851 25.039242,30.183468 24.259246,30.963588 23.307451,31.315097 22.181058,31.238194 21.054864,31.161392 19.884271,30.66008 18.670678,29.731756L16.944188,31.457 15.846595,30.359272 17.508085,28.69783C16.187693,27.376196,15.340097,26.072762,14.969,24.79013L16.74229,23.016685C16.824489,23.661201 17.080888,24.38912 17.513285,25.20164 17.944182,26.015461 18.42988,26.692578 18.971477,27.234193L22.510556,23.695103C21.683761,21.711952 21.307463,20.270414 21.381663,19.369492 21.455862,18.467169 21.82566,17.683149 22.494956,17.015232 23.284052,16.224911 24.282646,15.857702 25.488439,15.913704 26.694132,15.969505 27.841326,16.424116 28.928519,17.276937z M26.035416,0C26.744892,0,27.45452,0.27081299,27.996172,0.81244278L46.553442,19.36985C47.63685,20.453253,47.63685,22.208361,46.553442,23.290361L37.835485,32.008381 36.788542,29.779791C36.548048,29.2687,36.220076,28.814073,35.827597,28.43053L35.673601,28.290204 42.632998,21.330835 26.03528,4.7330017 4.7329998,26.035172 21.330749,42.633007 28.829777,35.134007 30.709622,39.1343 23.290453,46.553525C22.208451,47.636826,20.453145,47.636826,19.36974,46.553525L0.8125,27.996074C-0.27083397,26.912871,-0.27083397,25.157567,0.8125,24.075563L24.075558,0.81244278C24.61661,0.27081299,25.325938,0,26.035416,0z"/> \r</svg>
\ No newline at end of file
index 08e85b5..c46887f 100644 (file)
@@ -1,3 +1 @@
-<svg id="glyphicons-basic" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
-  <path id="square-empty-plus" d="M24.5,4H7.5A3.50424,3.50424,0,0,0,4,7.5v17A3.50424,3.50424,0,0,0,7.5,28h17A3.50424,3.50424,0,0,0,28,24.5V7.5A3.50424,3.50424,0,0,0,24.5,4ZM25,24.5a.50641.50641,0,0,1-.5.5H7.5a.50641.50641,0,0,1-.5-.5V7.5A.50641.50641,0,0,1,7.5,7h17a.50641.50641,0,0,1,.5.5ZM22,15v2a1,1,0,0,1-1,1H18v3a1,1,0,0,1-1,1H15a1,1,0,0,1-1-1V18H11a1,1,0,0,1-1-1V15a1,1,0,0,1,1-1h3V11a1,1,0,0,1,1-1h2a1,1,0,0,1,1,1v3h3A1,1,0,0,1,22,15Z"/>
-</svg>
+<?xml version="1.0" encoding="utf-8"?> \r<svg version="1.2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" \r      x="0px" y="0px" width="50px" height="50px" viewBox="0 0 52.33 52.33"> \r<path d="M19.833,0L32.501,0 32.501,19.833999 52.334,19.833999 52.334,32.500999 32.501,32.500999 32.501,52.333 19.833,52.333 19.833,32.500999 0,32.500999 0,19.833999 19.833,19.833999z"/> \r</svg>
\ No newline at end of file
diff --git a/backoffice/img/icons/plus2.svg b/backoffice/img/icons/plus2.svg
new file mode 100644 (file)
index 0000000..08e85b5
--- /dev/null
@@ -0,0 +1,3 @@
+<svg id="glyphicons-basic" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
+  <path id="square-empty-plus" d="M24.5,4H7.5A3.50424,3.50424,0,0,0,4,7.5v17A3.50424,3.50424,0,0,0,7.5,28h17A3.50424,3.50424,0,0,0,28,24.5V7.5A3.50424,3.50424,0,0,0,24.5,4ZM25,24.5a.50641.50641,0,0,1-.5.5H7.5a.50641.50641,0,0,1-.5-.5V7.5A.50641.50641,0,0,1,7.5,7h17a.50641.50641,0,0,1,.5.5ZM22,15v2a1,1,0,0,1-1,1H18v3a1,1,0,0,1-1,1H15a1,1,0,0,1-1-1V18H11a1,1,0,0,1-1-1V15a1,1,0,0,1,1-1h3V11a1,1,0,0,1,1-1h2a1,1,0,0,1,1,1v3h3A1,1,0,0,1,22,15Z"/>
+</svg>
index e459477..026b9ee 100644 (file)
@@ -1,3 +1,5 @@
-<svg id="glyphicons-basic" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
-  <path id="square-empty-remove" d="M24.5,4H7.5A3.50424,3.50424,0,0,0,4,7.5v17A3.50424,3.50424,0,0,0,7.5,28h17A3.50424,3.50424,0,0,0,28,24.5V7.5A3.50424,3.50424,0,0,0,24.5,4ZM25,24.5a.50641.50641,0,0,1-.5.5H7.5a.50641.50641,0,0,1-.5-.5V7.5A.50641.50641,0,0,1,7.5,7h17a.50641.50641,0,0,1,.5.5ZM21.30328,13.52515,18.82843,16l2.47485,2.47485a.50007.50007,0,0,1,0,.70716L19.182,21.30328a.50007.50007,0,0,1-.70716,0L16,18.82843l-2.47485,2.47485a.50007.50007,0,0,1-.70716,0L10.69672,19.182a.50007.50007,0,0,1,0-.70716L13.17157,16l-2.47485-2.47485a.50007.50007,0,0,1,0-.70716L12.818,10.69672a.50007.50007,0,0,1,.70716,0L16,13.17157l2.47485-2.47485a.50007.50007,0,0,1,.70716,0L21.30328,12.818A.50007.50007,0,0,1,21.30328,13.52515Z"/>
-</svg>
+<?xml version="1.0" encoding="utf-8"?> \r
+<svg version="1.2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" \r
+        x="0px" y="0px" width="50px" height="50px" viewBox="0 0 64 64"> \r
+<path fill="red" d="M51.527958,0L64,12.4741 44.47221,32.001027 64,51.52871 51.528,64.000001 32.000016,44.472668 12.471823,64.000001 0.0010004044,51.528802 19.528015,32.001088 0,12.473726 12.472,0.0010004044 31.999884,19.528773z"/> \r
+</svg>
\ No newline at end of file
diff --git a/backoffice/img/icons/remove_2.svg b/backoffice/img/icons/remove_2.svg
new file mode 100644 (file)
index 0000000..e459477
--- /dev/null
@@ -0,0 +1,3 @@
+<svg id="glyphicons-basic" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
+  <path id="square-empty-remove" d="M24.5,4H7.5A3.50424,3.50424,0,0,0,4,7.5v17A3.50424,3.50424,0,0,0,7.5,28h17A3.50424,3.50424,0,0,0,28,24.5V7.5A3.50424,3.50424,0,0,0,24.5,4ZM25,24.5a.50641.50641,0,0,1-.5.5H7.5a.50641.50641,0,0,1-.5-.5V7.5A.50641.50641,0,0,1,7.5,7h17a.50641.50641,0,0,1,.5.5ZM21.30328,13.52515,18.82843,16l2.47485,2.47485a.50007.50007,0,0,1,0,.70716L19.182,21.30328a.50007.50007,0,0,1-.70716,0L16,18.82843l-2.47485,2.47485a.50007.50007,0,0,1-.70716,0L10.69672,19.182a.50007.50007,0,0,1,0-.70716L13.17157,16l-2.47485-2.47485a.50007.50007,0,0,1,0-.70716L12.818,10.69672a.50007.50007,0,0,1,.70716,0L16,13.17157l2.47485-2.47485a.50007.50007,0,0,1,.70716,0L21.30328,12.818A.50007.50007,0,0,1,21.30328,13.52515Z"/>
+</svg>
diff --git a/backoffice/img/icons/rename.svg b/backoffice/img/icons/rename.svg
new file mode 100644 (file)
index 0000000..d1d7f31
--- /dev/null
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="utf-8"?> \r<svg version="1.2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" \r      x="0px" y="0px" width="50px" height="50px" viewBox="0 0 27.42 64"> \r<path d="M0,0L27.421999,0 27.421999,1.7448702 25.109486,1.7448702C22.496771,1.7448699 20.593859,2.51563 19.398455,4.0573702 18.611448,5.0651898 18.218746,7.4870601 18.218746,11.3256L18.218746,41.810001 23.85,41.810001 23.85,45.810001 18.218746,45.810001 18.218746,52.671902C18.218746,55.911499 18.422548,58.052101 18.83205,59.091202 19.146452,59.877701 19.806755,60.552101 20.813862,61.1199 22.166769,61.875 23.598976,62.251999 25.109486,62.251999L27.421999,62.251999 27.421999,64 0,64 0,62.251999 2.2655831,62.251999C4.9088484,62.251999 6.8274795,61.4818 8.0234862,59.940201 8.7786914,58.9324 9.156293,56.510502 9.156293,52.671902L9.156293,45.810001 3.3340007,45.810001 3.3340007,41.810001 9.156293,41.810001 9.156293,11.3256C9.156293,8.0859404 8.951192,5.9453101 8.5429898,4.9089394 8.2278882,4.1224399 7.5826841,3.4453101 6.6073791,2.8776903 5.2226902,2.1224401 3.7760216,1.7448699 2.2655831,1.7448702L0,1.7448702z"/> \r</svg>
\ No newline at end of file
diff --git a/backoffice/img/icons/table.svg b/backoffice/img/icons/table.svg
new file mode 100644 (file)
index 0000000..d398197
--- /dev/null
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="utf-8"?> \r<svg version="1.2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" \r      x="0px" y="0px" width="50px" height="50px" viewBox="0 0 37.81 31.81"> \r<path d="M0,27.006001L37.806999,27.006001 37.806999,31.806 0,31.806z M0,18.003L37.806999,18.003 37.806999,22.806 0,22.806z M0,8.9999999L37.806999,8.9999999 37.806999,13.803 0,13.803z M0,0L37.806999,0 37.806999,4.8030009 0,4.8030009z"/> \r</svg>
\ No newline at end of file
index 9e2e214..4bd5f2e 100644 (file)
@@ -261,7 +261,7 @@ function fillformbydataclass2(dataclass,choices,data){
     for (var f in frm){
       //console.log(frm[f]);
       if (data[frm[f].id]){
-        //console.log(frm[f].id + " => " + data[frm[f].id]);
+        
         
         if (frm[f].tagName == 'INPUT'){
           if (frm[f].type == "checkbox"){
@@ -271,7 +271,9 @@ function fillformbydataclass2(dataclass,choices,data){
               frm[f].checked = false;
             }
           } else if (frm[f].classList.contains("datefield")){ 
+            console.log("DateField:" + frm[f].id + " => " + data[frm[f].id]);
             frm[f]._flatpickr.setDate(data[frm[f].id]);
+
           } else if (frm[f].classList.contains("timefield")){ 
             frm[f]._flatpickr.setDate(data[frm[f].id]);
           }else if (frm[f].classList.contains("choices__input")){ 
index 000f66b..da31dc8 100644 (file)
@@ -81,22 +81,22 @@ var timecalc = {
   StringToTime: function(strin){
     strin = strin.substring(0,5);
     strin = strin.replace(/\D/g,'');
-    console.log(strin);
+    //console.log(strin);
     if (strin.length == 0){ return "";}
     if (strin.length <= 2){
-      console.log(strin + "<=2");
+      //console.log(strin + "<=2");
       if (strin > "23") {return ""} else {
         return timecalc.lpad(strin,2,'0')+":00";
       }
     } else if (strin.length == 3){
-      console.log(strin + "==3");
+      //console.log(strin + "==3");
       var hours = strin.substring(0,1);
       var minutes = strin.substring(1,3);
-      console.log(hours + ":" + minutes)
+      //console.log(hours + ":" + minutes)
       if (minutes > "59"){ return "";} 
       return timecalc.lpad(hours,2,'0')+ ":"+ timecalc.lpad(minutes,2,'0');
     } else if (strin.length == 4){
-      console.log(strin + "==4");
+      //console.log(strin + "==4");
       var hours = strin.substring(0,2);
       var minutes = strin.substring(2,4);
       if ((hours > "23") || (minutes > "59")){return "";}
@@ -123,6 +123,31 @@ var timecalc = {
     return strin + ":00";
     
   },
+  MinutesToInterval: function(minutes){
+    if ((minutes == null) || (minutes == "")){ return "0:00";}
+    var prep ="";
+    if (minutes < 0){
+      prep = "-";
+      minutes = minutes * -1;
+    }
+    var hours = parseInt(minutes/60);
+    var restminutes = minutes-(hours*60);
+    return prep+hours+ ":"+ timecalc.lpad(restminutes,2,'0');
+  },
+  IntervalToMinutes: function(strin){
+    if (strin == "" || strin == null){
+      return 0;
+    }
+    var mult = 1;
+    if (strin.startsWith("-")){
+      mult = -1;
+      strin =  strin.replace(/-/g,'');
+    }
+    var spl = strin.split(":");
+    var hours = parseInt(spl[0]) * 60;
+    var minutes = parseInt(spl[1]);
+    return (hours+minutes) * mult;
+  },
   validateTime(obj){
     obj.value = timecalc.StringToTime(obj.value);
     return false;
index eb09b47..d16b8a0 100644 (file)
@@ -3,12 +3,12 @@
 <div class="w3-display-container">
   <div class="w3-top w3-theme-light w3-border-bottom">
     <div class="w3-bar">
-      <button class="w3-bar-item w3-button w3-border  w3-blue-grey w3-hover-text-white" onclick="companies.gettbldata();module.viewpanel('tbl_companies');">Entreprises</button>
+      <button class="w3-bar-item w3-button w3-border  w3-hover-text-white" onclick="companies.gettbldata();module.viewpanel('tbl_companies');"><img src="[% abspath%]img/icons/table.svg" style="height: 24px;"/>&nbsp;Entreprises</button>
       
       <div class="toolbar" id="tbar_tbl_companies" style="display: none;">
-        <button class="w3-bar-item w3-button w3-border  w3-right w3-red" onclick="companies.remove();"><img src="[% abspath%]img/icons/remove_white.svg" style="height: 24px;"/></button>
-        <button class="w3-bar-item w3-button w3-border  w3-right w3-blue-grey" onclick="companies.edit();"><img src="[% abspath%]img/icons/edit_white.svg" style="height: 24px;"/></button>
-        <button class="w3-bar-item w3-button w3-border  w3-right w3-blue-grey" onclick="companies.add();"><img src="[% abspath%]img/icons/plus_white.svg" style="height: 24px;"/></button> 
+        <button class="w3-bar-item w3-button w3-border  w3-right " onclick="companies.remove();"><img src="[% abspath%]img/icons/remove.svg" style="height: 24px;"/></button>
+        <button class="w3-bar-item w3-button w3-border  w3-right" onclick="companies.edit();"><img src="[% abspath%]img/icons/edit.svg" style="height: 24px;"/></button>
+        <button class="w3-bar-item w3-button w3-border  w3-right" onclick="companies.add();"><img src="[% abspath%]img/icons/plus.svg" style="height: 24px;"/></button> 
       </div>
 <div class="toolbar" id="tbar_frm_companies" style="display: none;">
 </div>
@@ -55,7 +55,7 @@
                   
               </div>
               <div class="w3-container w3-right-align">
-                <button class="w3-button w3-blue-grey w3-margin" id="btnsave_companies" onclick="companies.save();return false;">sauvegarder</button>
+                <button class="w3-button w3-margin" id="btnsave_companies" onclick="companies.save();return false;">sauvegarder</button>
               </div>
             </div>
           </form>
@@ -67,9 +67,9 @@
             <h3>Départements</h3>
             </div>
           <div class="w3-bar">
-            <button class="w3-bar-item w3-button w3-border  w3-right w3-red" onclick="staffgroups.remove();"><img src="[% abspath%]img/icons/remove_white.svg" style="height: 24px;"/></button>
-            <button class="w3-bar-item w3-button w3-border  w3-right w3-blue-grey" onclick="staffgroups.edit();"><img src="[% abspath%]img/icons/edit_white.svg" style="height: 24px;"/></button>
-            <button class="w3-bar-item w3-button w3-border  w3-right w3-blue-grey" onclick="staffgroups.add();"><img src="[% abspath%]img/icons/plus_white.svg" style="height: 24px;"/></button>
+            <button class="w3-bar-item w3-button w3-border w3-right" onclick="staffgroups.remove();"><img src="[% abspath%]img/icons/remove.svg" style="height: 24px;"/></button>
+            <button class="w3-bar-item w3-button w3-border w3-right" onclick="staffgroups.edit();"><img src="[% abspath%]img/icons/edit.svg" style="height: 24px;"/></button>
+            <button class="w3-bar-item w3-button w3-border w3-right" onclick="staffgroups.add();"><img src="[% abspath%]img/icons/plus.svg" style="height: 24px;"/></button>
           </div>
           <div id="tbl_staffgroups"></div>
         </div>
@@ -95,7 +95,7 @@
       </form>
     </div>
     <footer class="w3-container w3-right-align w3-padding-16">
-    <button class="w3-button w3-blue-grey w3-margin-right w3-border" onclick="document.getElementById('dlg_staffgroups').style.display='none'; return false;">Annuler</button>  
+    <button class="w3-button w3-margin-right w3-border" onclick="document.getElementById('dlg_staffgroups').style.display='none'; return false;">Annuler</button>  
     <button class="w3-button w3-margin-right w3-border" onclick="staffgroups.save();">Sauvegarder</button>
     </footer>
   </div>
index 6fc25a0..8e6e959 100644 (file)
@@ -11,23 +11,18 @@ var staffgroups = {
       height: "400px",
       layout: "fitDataFill",
       selectable: 1,
-      rowContext:function(e, row){
-        //e - the click event object
-        //row - row component
-        e.preventDefault(); // prevent the browsers default context menu form appearing.
-        },
-    columns: [{
-      title: "Département",
-      field: "groupname"
-  },{
-  title: "Groupe standard",
-  field: "isdefault",formatter:"tickCross", formatterParams:{
-    allowEmpty:true,
-    allowTruthy:true,
-    tickElement:'<span style="color: green;">&#10004;</span>',
-    crossElement:'<span style="color: red;">&times;</span>',
-}
-}]
+      rowContext:function(e, row){ e.preventDefault(); },
+    columns: [{ title: "Département",  field: "groupname" }
+//   ,{
+//   title: "Groupe standard",
+//   field: "isdefault",formatter:"tickCross", formatterParams:{
+//     allowEmpty:true,
+//     allowTruthy:true,
+//     tickElement:'<span style="color: green;">&#10004;</span>',
+//     crossElement:'<span style="color: red;">&times;</span>',
+// }
+// }
+]
   });
     staffgroups.gettbldata();
   },
index d531dc1..8e2899c 100644 (file)
@@ -3,8 +3,7 @@
 <div class="w3-display-container">
     <div class="w3-top w3-theme-light w3-border-bottom">
         <div class="w3-bar">
-            <button class="w3-bar-item w3-button w3-border" onclick="reportperiod.reloadview();"><img
-      src="[% abspath%]img/icons/poticon.svg" style="height: 24px;" />&nbsp;Périodes de référence</button>
+            <button class="w3-bar-item w3-button w3-border" onclick="reportperiod.reloadview();"><img src="[% abspath%]img/icons/table.svg" style="height: 24px;"/>&nbsp;Périodes de référence</button>
             <div class="toolbar" id="tbar_tbl_reportperiod" style="display: none;">
                 <button class="w3-bar-item w3-button w3-border  w3-right" onclick="reportperiod.add();"><img
       src="[% abspath%]img/icons/plus.svg" style="height: 24px;" /></button>
@@ -14,6 +13,8 @@
       src="[% abspath%]img/icons/pdf.svg" style="height: 24px;" /></button>
       <button class="w3-bar-item w3-button w3-border w3-right" onclick="reportperiod.datarefresh();"><img
         src="[% abspath%]img/icons/data_refresh.svg" style="height: 24px;" /></button>
+        <button class="w3-bar-item w3-button w3-border w3-right" onclick="reportperiod.showdlgpayedhours();"><img
+        src="[% abspath%]img/icons/pay.svg" style="height: 24px;" /></button>
       <!--<button class="w3-bar-item w3-button w3-border w3-right" onclick="reportperiod.togglegroups();"><img
        rc="[% abspath%]img/icons/expand.svg" style="height: 24px;" /></button>-->
             </div>
     <div class="w3-display-container panel" id="pnl_tbl_staffreportperiodweeks" style="margin-top: 45px;">
         <div id="tbl_staffreportperiodweeks"></div>
     </div>
-    
+    <!-- DLG BEGIN reportperiod setpayed -->
+    <div id="dlg_rppayedhours" class="w3-modal">
+      <div class="w3-modal-content w3-animate-top w3-card-4">
+        <header class="w3-container">
+          <span onclick="document.getElementById('dlg_rppayedhours').style.display='none'; return false;" class="w3-button w3-display-topright">&times;</span>
+          <h2 id="dlg_rppayedhours">Heures Payés</h2>
+        </header>
+        <div class="w3-container">
+        <div id="rppayedhours_infomsg"></div>
+        <form id="frm_rppayedhours">
+          <div class="w3-container w3-padding">
+            <h4 id="title_rppayedhours">Periode du .. au ..</h4>
+                <div class="w3-container">
+                  [% fieldhidden("id_staffreportperiod",'staffreportperiod','ident') %] 
+                  [% fieldintervalbox("payedhours",'staffreportperiod','Heures Payés','','','') %]    
+                </div>
+
+          </div>
+        </form>
+      </div>
+      <footer class="w3-container w3-right-align w3-padding-16">
+        <button class="w3-button w3-theme-light w3-margin-right w3-border" onclick="document.getElementById('dlg_rppayedhours').style.display='none'; return false;">Annuler</button>
+        <button class="w3-button w3-blue-grey w3-margin-right w3-border" id="btn_savepayedhours" onclick="reportperiod.savepayedhours();return false;">Sauvegarder</button>
+      </footer>
+    </div>
+  </div>
+    <!-- DLG END report period setpayed -->
+    <!-- DLG BEGIN staffreportperioddays -->
     <div id="dlg_staffreportperioddays" class="w3-modal">
       <div class="w3-modal-content w3-animate-top w3-card-4">
         <header class="w3-container">
       </footer>
     </div>
   </div>
+  <!-- DLG END staffreportperioddays -->
 </div>    
     [% INCLUDE block/dlgdeleterow.tt %] 
     [% INCLUDE block/dlgmessage.tt %] 
index 7006006..6a41521 100644 (file)
@@ -23,7 +23,7 @@ var reportperiod ={
       groupStartOpen:[true],
       groupClosedShowCalcs:true,
       groupHeader:[
-        function(value, count, data){ //generate header contents for gender groups
+        function(value, count, data){ //generate header 
           return value;
         },
       ],
@@ -41,7 +41,8 @@ var reportperiod ={
             {title: "Récup", field:"recuperationhours",sorter: false},
             {title: "congé", field:"vacancyhours",sorter: false},
             {title: "Total", field:"totalhours",sorter: false},
-            {title: "Rest", field:"hoursdiff",sorter: false,bottomCalc:reportperiod.periodrestsum} // ,bottomCalcFormatter:"html"
+            {title: "à récup.", field:"hoursdiff",sorter: false,bottomCalc:reportperiod.periodrestsum},
+            {title: "payés", field:"payedhours",sorter: false} 
           ]
       }
       ]
@@ -88,11 +89,36 @@ var reportperiod ={
     return false;
   },
   periodrestsum: function(values, data, calcParams){
-    return '00:00';
+    var mts = 0;
+    //console.log(values);
+    for (var m in values){
+      mts += timecalc.IntervalToMinutes(values[m]);
+    } 
+    return timecalc.MinutesToInterval(mts);
   },
-  togglegroups: function(){
+  showdlgpayedhours: function(){
+    cleanform2("rppayedhours",{});
+    var prd = reportperiod.tbl.getSelectedData();
+    if (prd[0]){
+      document.getElementById("title_rppayedhours").innerHTML = "Période du " +moment(prd[0].startdate).format("DD.MM.YYYY") + " au " + moment(prd[0].enddate).format("DD.MM.YYYY");
+      document.getElementById("id_staffreportperiod").value=prd[0].id;
+      document.getElementById("payedhours").value=prd[0].payedhours;
+      //fillformbydataclass2("staffreportperioddays",{},prd[0]);
+      module.viewdialog('rppayedhours');
+    }
+  },
+  savepayedhours: function(){
+    document.getElementById('dlg_rppayedhours').style.display='none';
+    var rpdata = getformcontent("rppayedhours");
+    rpdata["ident_staffreportperiod_id"] = rpdata["ident_staffreportperiod_id_staffreportperiod"];
+    delete rpdata["ident_staffreportperiod_id_staffreportperiod"];
+    rpdata["fn"] ="saveform";
+    rpdata["schemata"] = schemata;
 
+    console.log(rpdata);
+    formsaved({});
+    req.reqdata("POST","index.cgi",rpdata,reportperiod.gettbldata);
+    
+    return false;
   }
-  
-  
 }
\ No newline at end of file
index 8c67d6b..0f39011 100644 (file)
@@ -2,11 +2,11 @@
 <div class="w3-display-container">
   <div class="w3-top w3-theme-light w3-border-bottom">
     <div class="w3-bar">
-      <button class="w3-bar-item w3-button w3-border  w3-blue-grey w3-hover-text-white" onclick="staff.viewtable();">Salariés</button>
+      <button class="w3-bar-item w3-button w3-border  w3-hover-text-white" onclick="staff.viewtable();"><img src="[% abspath%]img/icons/table.svg" style="height: 24px;"/>&nbsp;Salariés</button>
       <div class="toolbar" id="tbar_tbl_staff" style="display: none;">
-  <button class="w3-bar-item w3-button w3-border  w3-right w3-red" onclick="staff.remove();"><img src="[% abspath%]img/icons/remove_white.svg" style="height: 24px;"/></button>
-  <button class="w3-bar-item w3-button w3-border  w3-right w3-blue-grey" onclick="staff.edit();"><img src="[% abspath%]img/icons/edit_white.svg" style="height: 24px;"/></button>
-  <button class="w3-bar-item w3-button w3-border  w3-right w3-blue-grey" onclick="staff.add();"><img src="[% abspath%]img/icons/plus_white.svg" style="height: 24px;"/></button> 
+  <button class="w3-bar-item w3-button w3-border  w3-right" onclick="staff.remove();"><img src="[% abspath%]img/icons/remove.svg" style="height: 24px;"/></button>
+  <button class="w3-bar-item w3-button w3-border  w3-right" onclick="staff.edit();"><img src="[% abspath%]img/icons/edit.svg" style="height: 24px;"/></button>
+  <button class="w3-bar-item w3-button w3-border  w3-right" onclick="staff.add();"><img src="[% abspath%]img/icons/plus.svg" style="height: 24px;"/></button> 
 </div>
 <div class="toolbar" id="tbar_frm_staff" style="display: none;">
 </div>
@@ -43,7 +43,7 @@
         </div>
         
             <div class="w3-container w3-right-align">
-                        <button class="w3-button w3-blue-grey w3-margin" id="btnsave_staff" onclick="staff.save();return false;">sauvegarder</button>
+                        <button class="w3-button w3-margin" id="btnsave_staff" onclick="staff.save();return false;">sauvegarder</button>
                     </div>
             </div>
         </form>
@@ -54,9 +54,9 @@
         <div class="subtoolbar"  >
 <div class="w3-bar">
       
-      <button class="w3-bar-item w3-button w3-border  w3-right w3-red" id="btn_delete_staffcontract" onclick="staffcontract.remove();"><img src="[% abspath%]img/icons/remove_white.svg" style="height: 24px;"/></button>
-      <button class="w3-bar-item w3-button w3-border  w3-right w3-blue-grey" onclick="staffcontract.edit();"><img src="[% abspath%]img/icons/edit_white.svg" style="height: 24px;"/></button>
-      <button class="w3-bar-item w3-button w3-border  w3-right w3-blue-grey"  onclick="staffcontract.add();"><img src="[% abspath%]img/icons/plus_white.svg" style="height: 24px;"/></button> 
+      <button class="w3-bar-item w3-button w3-border  w3-right" id="btn_delete_staffcontract" onclick="staffcontract.remove();"><img src="[% abspath%]img/icons/remove.svg" style="height: 24px;"/></button>
+      <button class="w3-bar-item w3-button w3-border  w3-right" onclick="staffcontract.edit();"><img src="[% abspath%]img/icons/edit.svg" style="height: 24px;"/></button>
+      <button class="w3-bar-item w3-button w3-border  w3-right"  onclick="staffcontract.add();"><img src="[% abspath%]img/icons/plus.svg" style="height: 24px;"/></button> 
       </div>
       </div>
         <div id="tbl_staffcontract" >
         </div>
         <div class="w3-container">
         [% fieldintervalbox("weekhours","staffcontract","heures par semaine","w3-third","","","") %]
-        [% fieldselectbox("weekdays","staffcontract","jours par semaine","w3-third","","","") %]
+        [% fieldselectbox("weekdays","staffcontract","jours de travail par semaine","w3-third","","","") %]
+        <div class="w3-container">
+        [% fieldmultiselectbox("defaultfreedays","staffcontract","Jours de semaines libre ","","","","") %]
+        </div>
         [% fieldselectbox('id_workplan','staffcontract','POT (Modèle)','w3-third','','','') %]
         </div>
         </form>
     </div>
     <footer class="w3-container w3-right-align w3-padding-16">
     <button class="w3-button w3-theme-light w3-margin-right w3-border" onclick="document.getElementById('dlg_staffcontract').style.display='none'; return false;">Annuler</button>
-    <button class="w3-button w3-blue-grey w3-margin-right w3-border" onclick="staffcontract.save();">sauvegarder</button>  
+    <button class="w3-button w3-margin-right w3-border" onclick="staffcontract.save();">sauvegarder</button>  
     </footer>
   </div>
 </div>
index dc79824..b458f33 100644 (file)
@@ -1,7 +1,8 @@
 var staffcontract = {
   name: "staffcontract",
   tbl: null,
-  choices:{"weekdays":null,"id_workplan":null},
+  choices:{"weekdays":null,"id_workplan":null,"defaultfreedays":null},
+  maxfreedays: 1,
   initform: function(){
     staffcontract.choices["id_workplan"] = new Choices('#id_workplan',{
       searchEnabled: false,
@@ -15,30 +16,44 @@ var staffcontract = {
       removeItemButton: false,
       choices : [{value:"1",label:"1"},{value:"2",label:"2"},{value:"3",label:"3"},{value:"4",label:"4"},{value:"5",label:"5"},{value:"6",label:"6"},{value:"7",label:"7"}]
     });
+    staffcontract.choices["defaultfreedays"] = new Choices('#defaultfreedays',{
+      searchEnabled: false,
+      itemSelectText: '',
+      itemSort: false,
+      removeItemButton: true,
+      shouldSort: false,
+      shouldSortItems: false,
+      maxItemCount: staffcontract.maxfreedays,
+      maxItemText: (maxItemCount) => {
+        return `max. de jours de semaine ajoutées`;
+      },
+      choices : [{label:"lundi",value:"1"},{label:"mardi",value:"2"},{label:"mercredi",value:"3"},{label:"jeudi",value:"4"},{label:"vendredi",value:"5"},{label:"samedi",value:"6"},{label:"dimanche",value:"7"}]
+    });
     flatpickr("#startdate",{altInput: true,
       altFormat: "d.m.Y",
       dateFormat: "Y-m-d",
       "locale": "fr",
       weekNumbers: true,
-      "disable": [
-        function(date) {
-            // return true to disable
-            return (date.getDay() !== 1);
-        }
-      ],
+      // "disable": [
+      //   function(date) {
+      //       // return true to disable
+      //       return (date.getDay() !== 1);
+      //   }
+      // ],
     });
     flatpickr("#enddate",{altInput: true,
       altFormat: "d.m.Y",
       dateFormat: "Y-m-d",
       "locale": "fr",
       weekNumbers: true,
-      "disable": [
-        function(date) {
-            // return true to disable
-            return (date.getDay() !== 0);
-        }
-      ],
+      // "disable": [
+      //   function(date) {
+      //       // return true to disable
+      //       return (date.getDay() !== 0);
+      //   }
+      // ],
     });
+    document.getElementById("weekdays").addEventListener('change', function(event){staffcontract.setmaxfreedays(event,this.id);});
   },
   inittable: function(){
     staffcontract.initform();
@@ -58,6 +73,7 @@ var staffcontract = {
       {title: "fin", field: "enddate",headerSort: false,formatter:"datetime",formatterParams:{inputFormat:"YYYY-MM-DD",outputFormat:"DD.MM.YYYY",invalidPlaceholder:""}},
       {title: "h/semaine",field: "weekhours",align: "right",headerSort: false},
       {title: "j/semaine",field: "weekdays",align: "right", headerSort: false,formatter:"money",formatterParams:{decimal:",",thousand:".",symbol:" ",symbolAfter:"",precision:0}},
+      {title: "j/semaine libre",field: "defaultfreedays",headerSort: false},
       {title: "POT(modèle)",field: "workplan",headerSort: false}
     ]
 });
@@ -100,7 +116,7 @@ var staffcontract = {
   fillform: function(data){
     //console.log("Fill Form 1");
     if (data && data.sqldata){
-      //console.log("Fill Form 2");
+      console.log(data.sqldata[0]);
       fillformbydataclass2(staffcontract.name,staffcontract.choices,data.sqldata[0]);
     }
   },
@@ -130,6 +146,13 @@ var staffcontract = {
       }
       //console.log(f + " => " + flds[f]);
     }
+    if (parseInt(flds["staffcontract_weekdays"]) + flds["staffcontract_defaultfreedays"].length != 7){
+      document.getElementById("contractmsg").innerHTML= '<div class="w3-panel w3-red">jours de semaine libre incomplet!</div>';
+      return false;
+    }
+    console.log();
+   
+    //if ( + )
     if (bok == false){
       document.getElementById("contractmsg").innerHTML= '<div class="w3-panel w3-red">Tous les champs sauf "date fin" sans requis!</div>';
       return false;
@@ -164,4 +187,16 @@ var staffcontract = {
   fillwptemplates: function(data){
     fillselectlist(staffcontract.choices["id_workplan"],data.sqldata,'id','workplan');
   },
+  setmaxfreedays: function(ev,id){
+    
+    console.log(ev);
+    
+    var wmax = document.getElementById("weekdays").value;
+    staffcontract.maxfreedays = 7-wmax;
+    console.log("Maxfree " + staffcontract.maxfreedays);
+    staffcontract.choices["defaultfreedays"].config.maxItemCount = staffcontract.maxfreedays;
+    console.log(staffcontract.choices["defaultfreedays"])
+    staffcontract.choices["defaultfreedays"].removeActiveItems();
+    return false;
+  }
 }
\ No newline at end of file
index 8031e5c..4f33bdb 100644 (file)
@@ -3,11 +3,11 @@
 <div class="w3-display-container">
   <div class="w3-top w3-theme-light w3-border-bottom">
     <div class="w3-bar">
-      <button class="w3-bar-item w3-button w3-border  w3-blue-grey w3-hover-text-white" onclick="module.viewpanel('tbl_users');">Utilisateurs</button>
+      <button class="w3-bar-item w3-button w3-border  w3-hover-text-white" onclick="module.viewpanel('tbl_users');"><img src="[% abspath%]img/icons/table.svg" style="height: 24px;"/>&nbsp;Utilisateurs</button>
       <div class="toolbar" id="tbar_tbl_users" style="display: none;">
-  <button class="w3-bar-item w3-button w3-border  w3-right w3-red" onclick="users.remove();"><img src="[% abspath%]img/icons/remove_white.svg" style="height: 24px;"/></button>
-  <button class="w3-bar-item w3-button w3-border  w3-right w3-blue-grey" onclick="users.edit();"><img src="[% abspath%]img/icons/edit_white.svg" style="height: 24px;"/></button>
-  <button class="w3-bar-item w3-button w3-border  w3-right w3-blue-grey" onclick="users.add();"><img src="[% abspath%]img/icons/plus_white.svg" style="height: 24px;"/></button> 
+  <button class="w3-bar-item w3-button w3-border  w3-right" onclick="users.remove();"><img src="[% abspath%]img/icons/remove.svg" style="height: 24px;"/></button>
+  <button class="w3-bar-item w3-button w3-border  w3-right" onclick="users.edit();"><img src="[% abspath%]img/icons/edit.svg" style="height: 24px;"/></button>
+  <button class="w3-bar-item w3-button w3-border  w3-right" onclick="users.add();"><img src="[% abspath%]img/icons/plus.svg" style="height: 24px;"/></button> 
 </div>
 
     </div>
@@ -52,7 +52,7 @@
     <footer class="w3-container w3-right-align w3-padding-16">
         <button class="w3-button w3-orange w3-border" id="btnnewpasswd" onclick="users.sendnewpassword(); return false;">Envoyer mot de passe</button>
         <button class="w3-button w3-theme-light w3-border" onclick="document.getElementById('dlg_users').style.display='none'; return false;">annuler</button>
-        <button class="w3-button w3-blue-grey w3-margin w3-right-align" onclick="users.validateform();">sauvegarder</button>
+        <button class="w3-button w3-margin w3-right-align" onclick="users.validateform();">sauvegarder</button>
     </footer>
   </div>
 </div>
index e5913f7..de9e7fc 100644 (file)
@@ -6,11 +6,12 @@
 <div class="w3-display-container">
   <div class="w3-top w3-theme-light w3-border-bottom">
     <div class="w3-bar">
-      <button class="w3-bar-item w3-button w3-border  w3-blue-grey w3-hover-text-white" onclick="module.viewpanel('tbl_workplans');">Plans de travail</button>
+      <button class="w3-bar-item w3-button w3-border w3-hover-text-white" onclick="module.viewpanel('tbl_workplans');"><img src="[% abspath%]img/icons/table.svg" style="height: 24px;"/>&nbsp;Plans de travail</button>
       <div class="toolbar" id="tbar_tbl_workplans">
-    <button class="w3-bar-item w3-button w3-border  w3-right w3-red" onclick="worplans.remove();"><img src="[% abspath%]img/icons/remove_white.svg" style="height: 24px;"/></button>
-    <button class="w3-bar-item w3-button w3-border  w3-right w3-blue-grey" onclick="workplans.edit();"><img src="[% abspath%]img/icons/edit_white.svg" style="height: 24px;"/></button>
-    <button class="w3-bar-item w3-button w3-border  w3-right w3-blue-grey" onclick="workplans.add();"><img src="[% abspath%]img/icons/plus_white.svg" style="height: 24px;"/></button> 
+    <button class="w3-bar-item w3-button w3-border w3-right" onclick="workplans.remove();"><img src="[% abspath%]img/icons/remove.svg" style="height: 24px;"/></button>
+    <button class="w3-bar-item w3-button w3-border w3-right" onclick="workplans.edit();"><img src="[% abspath%]img/icons/edit.svg" style="height: 24px;"/></button>
+    <button class="w3-bar-item w3-button w3-border w3-right" onclick="workplans.add();"><img src="[% abspath%]img/icons/plus.svg" style="height: 24px;"/></button> 
+    <button class="w3-bar-item w3-button w3-border w3-right" onclick="workplans.rename();"><img src="[% abspath%]img/icons/rename.svg" style="height: 24px;"/></button> 
     </div>
     <div class="toolbar" id="tbar_frm_workplans" style="display: none;">
 
   <div class="w3-display-container panel" id="pnl_tbl_workplans" style="margin-top: 45px;">
     <div id="tbl_workplans"></div>
   </div>
-  <div class="w3-display-container w3-padding-24 panel" id="pnl_frm_workplans" style="display: none;" >
-    <div class="w3-container  w3-padding-24 w3-card  w3-margin w3-margin-bottom">
-      <form id="frm_workplans">
-        <h3>Plan de travail<small>(modèle)</small></h3>
-        <div class="w3-row-padding"> 
-          <div class="w3-container">
-            
-            [% fieldhidden('id','workplans','ident') %]
-            <div class="w3-container">
-              [% fieldeditbox('workplan','workplans','Nom','w3-third','','','') %]
+<!-- DLG BEGIN workplanday -->
+    <div id="dlg_workplanday" class="w3-modal">
+      <div class="w3-modal-content w3-animate-top w3-card-4">
+        <header class="w3-container">
+          <span onclick="document.getElementById('dlg_workplanday').style.display='none'; return false;" class="w3-button w3-display-topright">&times;</span>
+          <h2 id="dlg_workplanday_title">Editer Jour</h2>
+        </header>
+        <div class="w3-container">
+        <div id="workplanday_infomsg"></div>
+        <form id="frm_workplanday">
+          <div class="w3-container w3-padding">
+            <h4 id="display_date">weekday</h4>
+            <div class="w3-row">
+              <div class="w3-container w3-half">
+                <h5>Heures de travail</h5>
+                <div class="w3-container">
+                  [% fieldhidden("id",'workplandays','ident') %] 
+                  [% #fieldhidden("daydate",'workplanday','') %] 
+                  [% fieldtimebox("start1",'workplandays','début 1','w3-fifth','','') %] 
+                  [% fieldtimebox("end1",'workplandays','fin 1','w3-fifth','','') %] 
+                </div>
+                <div class="w3-container">
+                  [% fieldtimebox("start2",'workplandays','début 2','w3-fifth','','') %] 
+                  [% fieldtimebox("end2",'workplandays','fin 2','w3-fifth','','') %] 
+                  [% fieldtimebox("pause",'workplandays','pause','w3-fifth','','')  %]
+                </div>
+                <div class="w3-container">
+                  [% fieldtimebox("dayhours",'workplandays',"Total",'w3-fifth','readonly','') %]
+                  [% fieldtimebox("interruptionhours",'workplandays','coupure','','readonly','') %]
+                </div>
+              </div>
+              
             </div>
-            [% FOREACH tt IN wd %]
-            [% wday = tt.wd %]
-            [% headday = tt.day %]
-            <div class="w3-container">
-              <h3>[% headday %]</h3>
-              [% fieldtimebox("${wday}_timestart1",'workplans','début 1','w3-fifth','','') %]
-              [% fieldtimebox("${wday}_timeend1",'workplans','fin 1','w3-fifth','','') %]
-              [% fieldtimebox("${wday}_timestart2",'workplans','début 2','w3-fifth','','') %]
-              [% fieldtimebox("${wday}_timeend2",'workplans','fin 2','w3-fifth','','') %]
-              [% fieldtimebox("${wday}_timepause",'workplans','pause','w3-fifth','','') %]
-              [% fieldtimebox("${wday}_interruption",'workplans','coupure','w3-fifth','readonly','') %]
-              [% fieldtimebox("${wday}_total",'workplans','total','w3-fifth','readonly','') %]
+          </div>
+        </form>
+      </div>
+      <footer class="w3-container w3-right-align w3-padding-16">
+        <button class="w3-button w3-theme-light w3-margin-right w3-border" onclick="document.getElementById('dlg_workplanday').style.display='none'; return false;">Annuler</button>
+        <button class="w3-button w3-blue-grey w3-margin-right w3-border" id="btn_saveday" onclick="worplans.save();return false;">Sauvegarder</button>
+      </footer>
+    </div>
+  </div>
+  <!-- DLG END workplanday -->
+  <!-- DLG BEGIN workplan -->
+    <div id="dlg_workplan" class="w3-modal">
+      <div class="w3-modal-content w3-animate-top w3-card-4">
+        <header class="w3-container">
+          <span onclick="document.getElementById('dlg_workplan').style.display='none'; return false;" class="w3-button w3-display-topright">&times;</span>
+          <h2 id="dlg_workplan_title">Modèle</h2>
+        </header>
+        <div class="w3-container">
+        <div id="workplan_infomsg"></div>
+        <form id="frm_workplan">
+          <div class="w3-container w3-padding">
+            <div class="w3-row">
+              <div class="w3-container w3-half">
+                <div class="w3-container">
+                  [% fieldhidden("id",'workplans','ident') %] 
+                  [% #fieldhidden("daydate",'workplan','') %] 
+                  [% fieldeditbox("workplan",'workplans','Nom','','','') %] 
+                </div>
+              </div>
+              
             </div>
-            [% END %]
-        </div>
-        
-            <div class="w3-container w3-right-align">
-                        <button class="w3-button w3-blue-grey w3-margin" id="btnsave_fworkplan" onclick="workplans.save();return false;">sauvegarder</button>
-                    </div>
+          </div>
         </form>
+      </div>
+      <footer class="w3-container w3-right-align w3-padding-16">
+        <button class="w3-button w3-theme-light w3-margin-right w3-border" onclick="document.getElementById('dlg_workplan').style.display='none'; return false;">Annuler</button>
+        <button class="w3-button w3-blue-grey w3-margin-right w3-border" id="btn_saveworkplan" onclick="workplans.saveworkplan();return false;">Sauvegarder</button>
+      </footer>
     </div>
-    
   </div>
-  
+  <!-- DLG END workplan -->
 </div>
 [% INCLUDE block/dlgdeleterow.tt %]
 <script src="workplans.js"></script>
index 78ea434..ae25bcb 100644 (file)
@@ -1,3 +1,4 @@
+var weekdays= ["","lundi","mardi","mercredi","jeudi","vendredi","samedi","dimanche"];
 var workplans ={
   name:"workplans",
   choices:{},
@@ -20,26 +21,35 @@ var workplans ={
   inittable: function(){
     workplans.tbl = new Tabulator("#tbl_" + workplans.name, {
       headerFilterPlaceholder: "filter...",
-      height: "94vh",
+      height: "93vh",
       layout: "fitDataFill",
       selectable: 1,
       rowContext:function(e, row){e.preventDefault(); },
-      columns: [{title: "Nom", field: "workplan",headerFilter: "input"}, 
-      { title: "Total<br/>Semaine",field: "weektotal",formatter: "html" },
-      { title: "Lundi",field: "dspmontimes",formatter: "html" },
-      { title: "Mardi",field: "dsptuetimes",formatter: "html" },
-      { title: "Mercredi",field: "dspwedtimes",formatter: "html" },
-      { title: "Jeudi",field: "dspthutimes",formatter: "html" },
-      { title: "Vendredi",field: "dspfritimes",formatter: "html" },
-      { title: "Samedi",field: "dspsattimes",formatter: "html" }, 
-      { title: "Dimanche",field: "dspsuntimes",formatter: "html" }   
+      groupBy:["workplan"],
+      groupStartOpen:[true],
+      groupClosedShowCalcs:true,
+      groupHeader:[
+        function(value, count, data){ //generate header
+          //console.log(data); 
+          return value;
+        },
+      ],
+      columns: [//{title: "Nom", field: "workplan",headerFilter: "input"}, 
+      //{ title: "Total / heures",field: "weekhours" },
+      { title: "Jour",field: "weekday",formatter:wdayFormatter,headerSort: false  },
+      { title: "début 1",field: "start1",headerSort: false },
+      { title: "fin 1",field: "end1",headerSort: false },
+      { title: "début 2",field: "start2",headerSort: false },
+      { title: "fin 2",field: "end2",headerSort: false },
+      { title: "pause",field: "pause",headerSort: false }, 
+      { title: "total",field: "dayhours",headerSort: false,bottomCalc:workplans.weekhourssum },     
       ]
   });
    workplans.gettbldata();
    workplans.initform();
   },
   gettbldata: function(){
-    req.reqdata("POST", "db.cgi", {"get": workplans.name ,"schemata":schemata}, workplans.loadtbldata);
+    req.reqdata("POST", "db.cgi", {"get": "workplandayslist" ,"schemata":schemata}, workplans.loadtbldata);
   },
   loadtbldata: function(data){
     if (data && data.sqldata) {
@@ -47,45 +57,79 @@ var workplans ={
     }
   },
   edit: function() {
-    cleanform(workplans.name);
+    cleanform("workplanday");
     var udata = workplans.tbl.getSelectedData();
     if (udata[0]) {
         var uid = udata[0].id;
+        document.getElementById("display_date").innerHTML=weekdays[udata[0].weekday]; 
         req.reqdata("POST", "db.cgi", {
-          "get": workplans.name +"data","filter":"id=" + uid,"schemata":schemata
-      }, workplans.fillform);
-        module.viewpanel("frm_" +  workplans.name);
+          "get": "workplandaysdata","filter":"id=" + uid,"schemata":schemata
+      }, workplans.fillformworkplanday);
+        module.viewdialog("workplanday");
+    }
+  
+  },
+  rename: function() {
+    cleanform("workplan");
+    var udata = workplans.tbl.getSelectedData();
+    if (udata[0]) {
+        var uid = udata[0].id;
+        req.reqdata("POST", "db.cgi", {
+          "get": "workplansdata","filter":"id=" + uid,"schemata":schemata
+      }, workplans.fillformworkplan);
+        module.viewdialog("workplan");
     }
   
   },
   add: function() {
-    cleanform('workplans');
-    module.viewpanel('frm_' + workplans.name);
+    cleanform('workplan');
+    module.viewdialog('workplan');
   },
   remove: function() {
     var udata = workplans.tbl.getSelectedData();
     if (udata[0]) {
-      showdeletedlg(workplans.name,udata[0].id,null,gettbldata_workplan,schemata);
+      showdeletedlg("workplan",udata[0].id,null,workplans.gettbldata,schemata);
     }
   },
-  fillform: function(data){
+  weekhourssum: function(values, data, calcParams){
+    var mts = 0;
+    //console.log(values);
+    for (var m in values){
+      mts += timecalc.IntervalToMinutes(values[m]);
+    } 
+    return timecalc.MinutesToInterval(mts);
+  },
+  fillformworkplanday: function(data){
     if (data && data.sqldata) {
       console.log("fill Data");
       console.log(data.sqldata[0]);
-      fillformbydataclass2(workplans.name,{},data.sqldata[0]);
+      fillformbydataclass2("workplanday",{},data.sqldata[0]);
+    }
+  },
+  fillformworkplan: function(data){
+    if (data && data.sqldata) {
+      console.log("fill Data");
+      console.log(data.sqldata[0]);
+      fillformbydataclass2("workplan",{},data.sqldata[0]);
     }
   },
   save: function(){
-    var wpdata = getformcontent(workplans.name);
+    var wpdata = getformcontent("workplanday");
     var wpdatanew = {};
     for (var w in wpdata){
-      if ((!w.endsWith("total")) && (!w.endsWith("interruption"))){
+      if ((!w.endsWith("dayhours")) && (!w.endsWith("interruption"))){
         wpdatanew[w] = wpdata[w];
       }
     }
     saveformdata(wpdatanew,null,schemata);
     return false;
   },
+  saveworkplan: function(){
+    var wpdata = getformcontent("workplan");
+    var wpdatanew = {};
+    saveformdata(wpdatanew,null,schemata);
+    return false;
+  },
   checktime: function(id){
     
     var pp = id.split("_");
@@ -127,4 +171,8 @@ var workplans ={
     
   },
   
-}
\ No newline at end of file
+}
+var wdayFormatter = function(cell, formatterParams){
+  //cell.getElement().style.backgroundColor="grey";
+  return weekdays[cell.getValue()];
+};
\ No newline at end of file