v20200920
authorkilian@dks-pc1 <ksaffran@dks.lu>
Sun, 20 Sep 2020 07:44:23 +0000 (09:44 +0200)
committerkilian@dks-pc1 <ksaffran@dks.lu>
Sun, 20 Sep 2020 07:44:23 +0000 (09:44 +0200)
26 files changed:
app/.htaccess
app/data/schemata/defaultcompany.schema.sql
app/db.cgi
app/lib/POT/Period.pm
app/lib/dksdb.pm
app/static/js/app.js
app/static/vendors/flatpickr/plugins/confirmDate/confirmDate.js
app/static/vendors/flatpickr/plugins/monthSelect/index.js
app/tmpl/block/dlgperiodvalidation.tt
app/tmpl/file.tt
app/tmpl/index.tt
app/tmpl/module/periods/periodvalidation.js
app/tmpl/module/periods/reportperiod.js
app/tmpl/module/periods/staffperiodweeks.js
app/tmpl/module/profile.tt
app/tmpl/module/profile/profile.js
app/tmpl/module/staff/staffperiods.js
robots.txt [new file with mode: 0644]
website/api/tmp/.htaccess [new file with mode: 0644]
website/api/tools/.htaccess [new file with mode: 0644]
website/css/theme.css
website/img/macos_badge.png [deleted file]
website/img/potsharelogo.jpg [new file with mode: 0644]
website/img/windows_badge.png [deleted file]
website/index.html
website/js/site.js

index 2d11d59..915e981 100644 (file)
@@ -1,8 +1,8 @@
-RewriteEngine on
-DirectoryIndex index.cgi index.html 
-AddHandler cgi-script .cgi
-RewriteCond %{REQUEST_FILENAME} !-f
-RewriteCond %{REQUEST_FILENAME} !-d
-# RewriteRule "db.cgi" "db.cgi"  [NC,L,QSA]
-# RewriteRule "report.cgi" "report.cgi"  [NC,L,QSA]
+RewriteEngine on\r
+DirectoryIndex index.cgi index.html \r
+AddHandler cgi-script .cgi\r
+RewriteCond %{REQUEST_FILENAME} !-f\r
+RewriteCond %{REQUEST_FILENAME} !-d\r
+# RewriteRule "db.cgi" "db.cgi"  [NC,L,QSA]\r
+# RewriteRule "report.cgi" "report.cgi"  [NC,L,QSA]\r
 RewriteRule "^(.*)$" "index.cgi"  [NC,L,QSA]
\ No newline at end of file
index 0e1cba6..30d9ff4 100644 (file)
@@ -3,11 +3,11 @@ CREATE SCHEMA %%NEWSCHEMA%%;
 
 CREATE FUNCTION %%NEWSCHEMA%%.trg_before_upd_schematable() RETURNS trigger
     LANGUAGE plpgsql
-    AS $$
-    begin
-           new.modified = now();
-        RETURN NEW;
-    END;
+    AS $$\r
+    begin\r
+           new.modified = now();\r
+        RETURN NEW;\r
+    END;\r
 $$;
 
 CREATE TABLE %%NEWSCHEMA%%.reportperiod (
index 8a2c489..543801b 100644 (file)
@@ -257,7 +257,7 @@ if (($cgi->request_method() eq "GET") || ($cgi->request_method() eq "POST")){
       } elsif ($p->{fn} = "setstaffcontractdays"){
         $html->{result} = $st->setStaffContractDays($schema,$db->securetext($p->{id_staff}));
       }
-    } elsif ($p->{fn} =~ /clone_staffperiodweekdayhours$|clean_staffperiodday$|replace_staffperiodweekdayhours$|update_staff_in_period$|getworktimelimits$|refresh_periods$|add_reportperiod$|validate_period$/) {
+    } elsif ($p->{fn} =~ /clone_staffperiodweekdayhours$|clean_staffperiodday$|replace_staffperiodweekdayhours$|update_staff_in_period$|getworktimelimits$|refresh_periods$|add_reportperiod$|validate_period$|save_payedhours$/) {
       my $pd= POT::Period->new({db => $db});
       
       if ($p->{fn} eq "clone_staffperiodweekdayhours"){
@@ -274,8 +274,10 @@ if (($cgi->request_method() eq "GET") || ($cgi->request_method() eq "POST")){
         $html->{result} = $pd->refreshPeriods($schema);
       } elsif ($p->{fn} eq "add_reportperiod"){
         $html->{result} = $pd->addPeriod($schema);
-      } elsif ($p->{fn} eq "validate_period"){
-        $html->{result} = $pd->validatePeriod($schema,$db->securetext($p->{id_period}),$db->securetext($p->{id_staff}),$db->securetext($p->{hourstotransfer}),$db->securetext($p->{hourstotransfercalc}),$db->securetext($p->{payedhours40}),$db->securetext($p->{payedhours40calc}),$db->securetext($p->{payedhours}));
+      } elsif ($p->{fn} eq "save_payedhours"){
+        $html->{result} = $pd->savePayedHours($schema,$db->securetext($p->{id_period}),$db->securetext($p->{id_staff}),$db->securetext($p->{hourstotransfer}),$db->securetext($p->{hourstotransfercalc}),$db->securetext($p->{payedhours40}),$db->securetext($p->{payedhours40calc}),$db->securetext($p->{payedhours0}));
+      }elsif ($p->{fn} eq "validate_period"){
+        $html->{result} = $pd->validatePeriod($schema,$db->securetext($p->{id_period}),$db->securetext($p->{id_staff}),$db->securetext($p->{hourstotransfer}),$db->securetext($p->{hourstotransfercalc}),$db->securetext($p->{payedhours40}),$db->securetext($p->{payedhours40calc}),$db->securetext($p->{payedhours0}));
       } 
     } elsif ($p->{fn} =~ /add_workplan$|del_workplan$|duplicate_workplan$|workplan_replaceday$/) {
       my $wp = POT::Workplan->new({db => $db});
index 39eaad3..9ab31d5 100644 (file)
@@ -78,14 +78,16 @@ sub getStaffPeriods(){
     srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
     COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
     st.id_staffgroup, sgr.groupname,
-    to_char(srp.payedhours, 'HH24:MI'::text) AS payedhours,
-    case when position('-' in to_char(srp.transferedhourscalc, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhourscalc, 'HH24:MI'),'-','') else to_char(srp.transferedhourscalc, 'HH24:MI') end  as transferedhourscalc,
     case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end  as transferedhours,
     case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork  else  null end as suppvacancysunwork,
     case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours  else null end as suppvacancy44hours
     ,itmcontracthours,maxdays,srp.isvalidated,
+    case when to_char(coalesce(srp.payedhours0,'00:00:00'::interval)+coalesce(srp.payedhours40calc,'00:00:00'::interval), 'HH24:MI'::text)= '00:00' then null else to_char(coalesce(srp.payedhours0,'00:00:00'::interval)+coalesce(srp.payedhours40calc,'00:00:00'::interval), 'HH24:MI'::text) end  AS payedhours,
+    to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
     to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
     to_char(payedhours40calc, 'HH24:MI'::text)  as payedhours40calc,
+    to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+    to_char(hourstotransfercalc, 'HH24:MI'::text)  as hourstotransfercalc,
     to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
    FROM ".$schema.".staffreportperiod srp
      LEFT JOIN ".$schema.".staff st ON srp.id_staff = st.id
@@ -366,7 +368,10 @@ and id_staff='".$id_staff."' order by daydate
 ) xsunday) sunresult;";
 
   my $statussuncount = $self->{db}->query($sqlsun);
+  # if reached 6 times +1 day vacancy for not paused 44h then do not add 1 day for the rest of the year! we check all the periods with the same years startdate!
 
+  my $sql44limit = "select sum(suppvacancy44hours) as curvac44h from ".$schema.".staffreportperiod where id_staff='".$id_staff."' and id_reportperiod in (select id from ".$schema.".reportperiod where date_part('year',startdate)::int4=date_part('year',date('".$prd->{startdate}."')));" ;
+  my $supp44max = $self->{db}->query($sql44limit);
   #every 8 times not 44hours between workstart/workstop => +1 vacancy day => calculated by period; statuscount => start/stop value by period to count
   my $sql44 = "select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
 select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
@@ -385,23 +390,12 @@ select weekstart,".((exists($prevprddata->{status44hcount}) && $prevprddata->{st
                                   ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
                                  ) aa group by aa.weekstart order by weekstart
                                  ) bb)cc;";
-  print STDERR "SQL44:\n".$sql44."\n====\n";
+  #print STDERR "SQL44:\n".$sql44."\n====\n";
 
   my $status44count = $self->{db}->query($sql44);
-#   my $sqlavghours = "select id_staff,avg(avgtotalhours) as avgtotalhours from (  
-#      select ws.weekstart, ws.id_staff,
-#   AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
-#   from (
-#   SELECT weekstart, id_staff,
-# sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
-#                    FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
-#                     date(date_trunc('week', daydate) + interval '6 days') AS weekend,
-#                     date_part('week', daydate) AS calweek,
-#                     date_part('isoyear', daydate) AS calyear from ".$schema.".staffreportperioddays
-#                     where id_staff= '".$id_staff."' and daydate between date(date_trunc('week',date('".$prd->{startdate}."'))) and date(date_trunc('week',date('".$prd->{enddate}."')) + interval '6 days')
-#                     --where id_staff= '".$id_staff."' and daydate between date('".$prd->{startdate}."') and date('".$prd->{enddate}."')
-#                     ) srpd GROUP BY srpd.weekstart,srpd.id_staff
-#                   ORDER BY weekstart) ws) wsavg group by id_staff;";
+  if ($supp44max->{curvac44h} ge "6"){
+    $status44count->{plusdays} = "0";
+  }
   my $sqlavghours = "select weekstart,id_staff,avgtotalhours from (  
      select ws.weekstart, ws.id_staff,
   AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
@@ -438,7 +432,7 @@ sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours
   $sql .= "avgtotalweekhours='".$whavg->{avgtotalhours}."'::interval,";
   $sql .= "hoursdiff=csp.diffhours
   FROM (
-  select contracthours,workhours,vacancyhours,totalhours,recuperationhours, totalhours-contracthours-payedhours+transferedhourscalc as diffhours,id,vacancyill,vacancynormal from (
+  select contracthours,workhours,vacancyhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours-payedhours0-payedhours40 as diffhours,id,vacancyill,vacancynormal from (
   select dp.id,
   sum(pd.workhours) as workhours,
   sum(pd.dayhours) as totalhours,
@@ -447,8 +441,9 @@ sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours
   sum(case when pd.id_vacancytype != 'ill' and pd.vacancyhours > '00:00:00'::time then coalesce(pd.vacancyhours,'00:00:00'::time) else '00:00:00'::time end) as vacancynormal,
   sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours, 
   coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
-  coalesce(dp.payedhours,'00:00:00'::interval) as payedhours,
-  coalesce(dp.transferedhourscalc,'00:00:00'::interval) as transferedhourscalc
+  coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+  coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+  coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
   from ".$schema.".staffreportperioddays pd 
   join ".$schema.".staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '".$id_period."')
   where pd.id_staff='".$id_staff."' and  pd.daydate between date('".$prd->{startdate}."') and date('".$prd->{enddate}."')
@@ -636,6 +631,22 @@ sub replaceDayWorkplan(){
   return 1;    
 }
 
+sub savePayedHours(){
+  my $self = shift;
+  my $schema = shift;
+  my $id_period = shift;
+  my $id_staff = shift;
+  my $hourstotransfer = shift;
+  my $hourstotransfercalc = shift; #=> hourstotransfer
+  my $payedhours40 = shift;
+  my $payedhours40calc = shift;
+  my $payedhours = shift;
+  my $sql = "UPDATE ".$schema.".staffreportperiods set hourstotransfer='".$hourstotransfer."',hourstotransfercalc='".$hourstotransfercalc."',payhours40='".$payedhours40."',payedhours40calc='".$payedhours40calc."',payedhours0='".$payedhours."' where id_reportperiod='".$id_period."' and id_staff='".$id_staff."';";
+  $self->{db}->exec($sql);
+  return 1;
+  #$self->updateStaffPeriod($schema,$id_period,$id_staff);
+}
+
 sub validatePeriod(){
   my $self = shift;
   my $schema = shift;
@@ -646,7 +657,7 @@ sub validatePeriod(){
   my $payedhours40 = shift;
   my $payedhours40calc = shift;
   my $payedhours = shift;
-  my $sql = "UPDATE ".$schema.".staffreportperiods set isvalidated=true,hourstotransfer='".$hourstotransfer."',hourstotransfercalc='".$hourstotransfercalc."',payhours40='".$payedhours40."',payedhours40calc='".$payedhours40calc."',payedhours='".$payedhours."' where id_reportperiod='".$id_period."' and id_staff='".$id_staff."';";
+  my $sql = "UPDATE ".$schema.".staffreportperiods set isvalidated=true,hourstotransfer='".$hourstotransfer."',hourstotransfercalc='".$hourstotransfercalc."',payhours40='".$payedhours40."',payedhours40calc='".$payedhours40calc."',payedhours0='".$payedhours."' where id_reportperiod='".$id_period."' and id_staff='".$id_staff."';";
   $self->updateStaffPeriod($schema,$id_period,$id_staff);
   my $sqlnp = "select id,startdate,enddate from ".$schema.".reportperiod where startdate >= (select enddate from ".$schema.".reportperiod where id='".$id_period."') order by startdate,enddate limit 1;";
   my $nrp = $self->{db}->querysorted($sqlnp);
index 3f6ab96..12a2414 100644 (file)
@@ -20,7 +20,7 @@ sub new {
     my $class = shift;
     my $p = shift;
     my $self = bless {}, $class;
-    $self->{debug} = 0;
+    $self->{debug} = 1;
     $self->{dbh} = DBI->connect($p->{dsn},$p->{dbuser},$p->{dbpassword},{PrintError=>1,RaiseError=>1,AutoCommit=>1})  or return "query Connection Error!".$!;
     return $self;
 }
index fbbb48a..04b663d 100644 (file)
@@ -1,70 +1,70 @@
-let app = {
-    loadpage: function(modulepage, modulename) {
-      location.href=modulepage;
-    },
-    logout: function() {
-      postData(location.href, { "logout": "1" }).then (data => { location.href = 'login.html';});
-    },
-    reloadpage() { },
-    changedataset: function(){},
-    getCurrentSchemata: function(){
-      return schemata;
-    },
-    changedataset: function(){
-      let csel = document.getElementById("current_schemata").value;
-      schemata =  csel;
-      postData("db.cgi",{"fn":"setsessiondata","params":{"schemata":csel}}).then(data => {
-        document.getElementById("current_schemata").dataset.selected = csel;
-      });
-    },
-    setschemata(data){
-    },
-    reload_page: function() {
-      location.href = location.href;
-    },
-    viewpanel: function(pnlname){
-      let panels = document.getElementsByClassName("panel");
-      let toolbars = document.getElementsByClassName("paneltoolbar");
-      currentview = pnlname;
-      for (let p=0;p<panels.length;p++){
-        panels[p].style.display = 'none';
-      }
-      for (let p=0;p<toolbars.length;p++){
-         toolbars[p].style.display = 'none';
-      }
-      if (document.getElementById('pnl_' + pnlname)){
-        document.getElementById('pnl_' + pnlname).style.display = 'block';
-      }
-      if (document.getElementById('tlb_' +pnlname)){
-         document.getElementById('tlb_' +pnlname).style.display = 'block';
-      }
-      return false;
-    },
-    viewdialog: function(dlgname){
-      if (document.getElementById('dlg_' +dlgname)){
-        document.getElementById('dlg_' +dlgname).style.display = 'block';
-      } 
-    },
-    opendlg: function(dlgname,msgdata,callback){
-      for (var x in msgdata){
-        if (document.getElementById(dlgname + x)){
-          document.getElementById(dlgname + x).innerHTML = msgdata[x];
-        }
-      }
-      if (callback){
-        if (document.getElementById(dlgname + "_button")){
-          document.getElementById(dlgname + "_button").addEventListener("click",callback,true);
-        }
-        if (document.getElementById(dlgname + "_button")){
-          document.getElementById(dlgname + "_button").addEventListener("click",callback,true);
-        }
-      }
-    },
-    closedlg: function(dlgid){
-      document.getElementById(dlgid).style.display='none';
-    }
-}
-document.addEventListener("DOMContentLoaded", function() {
-  moment.locale('fr');
-  initpage();
-});
+let app = {\r
+    loadpage: function(modulepage, modulename) {\r
+      location.href=modulepage;\r
+    },\r
+    logout: function() {\r
+      postData(location.href, { "logout": "1" }).then (data => { location.href = 'login.html';});\r
+    },\r
+    reloadpage() { },\r
+    changedataset: function(){},\r
+    getCurrentSchemata: function(){\r
+      return schemata;\r
+    },\r
+    changedataset: function(){\r
+      let csel = document.getElementById("current_schemata").value;\r
+      schemata =  csel;\r
+      postData("db.cgi",{"fn":"setsessiondata","params":{"schemata":csel}}).then(data => {\r
+        document.getElementById("current_schemata").dataset.selected = csel;\r
+      });\r
+    },\r
+    setschemata(data){\r
+    },\r
+    reload_page: function() {\r
+      location.href = location.href;\r
+    },\r
+    viewpanel: function(pnlname){\r
+      let panels = document.getElementsByClassName("panel");\r
+      let toolbars = document.getElementsByClassName("paneltoolbar");\r
+      currentview = pnlname;\r
+      for (let p=0;p<panels.length;p++){\r
+        panels[p].style.display = 'none';\r
+      }\r
+      for (let p=0;p<toolbars.length;p++){\r
+         toolbars[p].style.display = 'none';\r
+      }\r
+      if (document.getElementById('pnl_' + pnlname)){\r
+        document.getElementById('pnl_' + pnlname).style.display = 'block';\r
+      }\r
+      if (document.getElementById('tlb_' +pnlname)){\r
+         document.getElementById('tlb_' +pnlname).style.display = 'block';\r
+      }\r
+      return false;\r
+    },\r
+    viewdialog: function(dlgname){\r
+      if (document.getElementById('dlg_' +dlgname)){\r
+        document.getElementById('dlg_' +dlgname).style.display = 'block';\r
+      } \r
+    },\r
+    opendlg: function(dlgname,msgdata,callback){\r
+      for (var x in msgdata){\r
+        if (document.getElementById(dlgname + x)){\r
+          document.getElementById(dlgname + x).innerHTML = msgdata[x];\r
+        }\r
+      }\r
+      if (callback){\r
+        if (document.getElementById(dlgname + "_button")){\r
+          document.getElementById(dlgname + "_button").addEventListener("click",callback,true);\r
+        }\r
+        if (document.getElementById(dlgname + "_button")){\r
+          document.getElementById(dlgname + "_button").addEventListener("click",callback,true);\r
+        }\r
+      }\r
+    },\r
+    closedlg: function(dlgid){\r
+      document.getElementById(dlgid).style.display='none';\r
+    }\r
+}\r
+document.addEventListener("DOMContentLoaded", function() {\r
+  moment.locale('fr');\r
+  initpage();\r
+});\r
index c1fc0ac..8d78e8a 100644 (file)
@@ -4,30 +4,30 @@
     (global = global || self, global.confirmDatePlugin = factory());
 }(this, function () { 'use strict';
 
-    /*! *****************************************************************************
-    Copyright (c) Microsoft Corporation. All rights reserved.
-    Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-    this file except in compliance with the License. You may obtain a copy of the
-    License at http://www.apache.org/licenses/LICENSE-2.0
-
-    THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
-    WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
-    MERCHANTABLITY OR NON-INFRINGEMENT.
-
-    See the Apache Version 2.0 License for specific language governing permissions
-    and limitations under the License.
-    ***************************************************************************** */
-
-    var __assign = function() {
-        __assign = Object.assign || function __assign(t) {
-            for (var s, i = 1, n = arguments.length; i < n; i++) {
-                s = arguments[i];
-                for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
-            }
-            return t;
-        };
-        return __assign.apply(this, arguments);
+    /*! *****************************************************************************\r
+    Copyright (c) Microsoft Corporation. All rights reserved.\r
+    Licensed under the Apache License, Version 2.0 (the "License"); you may not use\r
+    this file except in compliance with the License. You may obtain a copy of the\r
+    License at http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+    THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r
+    KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r
+    WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r
+    MERCHANTABLITY OR NON-INFRINGEMENT.\r
+\r
+    See the Apache Version 2.0 License for specific language governing permissions\r
+    and limitations under the License.\r
+    ***************************************************************************** */\r
+\r
+    var __assign = function() {\r
+        __assign = Object.assign || function __assign(t) {\r
+            for (var s, i = 1, n = arguments.length; i < n; i++) {\r
+                s = arguments[i];\r
+                for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r
+            }\r
+            return t;\r
+        };\r
+        return __assign.apply(this, arguments);\r
     };
 
     var defaultConfig = {
index 7fd66e7..a4bebcf 100644 (file)
@@ -4,30 +4,30 @@
     (global = global || self, global.monthSelectPlugin = factory());
 }(this, function () { 'use strict';
 
-    /*! *****************************************************************************
-    Copyright (c) Microsoft Corporation. All rights reserved.
-    Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-    this file except in compliance with the License. You may obtain a copy of the
-    License at http://www.apache.org/licenses/LICENSE-2.0
-
-    THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
-    WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
-    MERCHANTABLITY OR NON-INFRINGEMENT.
-
-    See the Apache Version 2.0 License for specific language governing permissions
-    and limitations under the License.
-    ***************************************************************************** */
-
-    var __assign = function() {
-        __assign = Object.assign || function __assign(t) {
-            for (var s, i = 1, n = arguments.length; i < n; i++) {
-                s = arguments[i];
-                for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
-            }
-            return t;
-        };
-        return __assign.apply(this, arguments);
+    /*! *****************************************************************************\r
+    Copyright (c) Microsoft Corporation. All rights reserved.\r
+    Licensed under the Apache License, Version 2.0 (the "License"); you may not use\r
+    this file except in compliance with the License. You may obtain a copy of the\r
+    License at http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+    THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r
+    KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r
+    WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r
+    MERCHANTABLITY OR NON-INFRINGEMENT.\r
+\r
+    See the Apache Version 2.0 License for specific language governing permissions\r
+    and limitations under the License.\r
+    ***************************************************************************** */\r
+\r
+    var __assign = function() {\r
+        __assign = Object.assign || function __assign(t) {\r
+            for (var s, i = 1, n = arguments.length; i < n; i++) {\r
+                s = arguments[i];\r
+                for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r
+            }\r
+            return t;\r
+        };\r
+        return __assign.apply(this, arguments);\r
     };
 
     var monthToStr = function (monthNumber, shorthand, locale) { return locale.months[shorthand ? "shorthand" : "longhand"][monthNumber]; };
index 4d18e75..6f41bc9 100644 (file)
             <div class="container cell">
               <div class="cell" style="width: 86px;">
                 <input class="data_staffreportperiod intervalfield readonly" id="diffhoursnet" name="staffreportperiod_diffhoursnet" placeholder="0:00" style="float: left;" type="text" value="">
-              </div><label class="label" for="staffreportperiod_diffhoursnet">heures</label>
+              </div><label class="label" for="staffreportperiod_diffhoursnet">heures suppl. </label>
+            </div>
+            <div class="container cell">
+              <div class="cell" style="width: 86px;">
+                <input class="data_staffreportperiod intervalfield readonly" id="transferedhours" name="staffreportperiod_transferedhours" placeholder="0:00" style="float: left;" type="text" value="">
+              </div><label class="label" for="staffreportperiod_transferedhours">décompte reporté</label>
             </div>
             </div>
             <div class="row" style="border-top: 1px solid #c6c6c6;margin-bottom: 3px;padding-top: 3px;">
             </div>
             <div class="container cell">
               <div class="cell" style="width: 86px;">
-                <input class="data_staffreportperiod intervalfield" id="transferedhours" name="staffreportperiod_transferedhours" onblur="timecalc.validateInterval(this);timecalc.copyInterval(this,'transferedhourscalc',1.5);return false;"  placeholder="0:00" style="float: left;" type="text" value=""> <a class="toolbarbtn text-red inlinebtn" href="javascript:dataform.cleanfield('transferedhours');dataform.cleanfield('transferedhourscalc');return false;"><span class="icon icon-remove" style="font-size: 10px;"></span></a>
-              </div><label class="label" for="staffreportperiod_transferedhours">heures</label>
+                <input class="data_staffreportperiod intervalfield" id="hourstotransfer" name="staffreportperiod_hourstotransfer" onblur="timecalc.validateInterval(this);timecalc.copyInterval(this,'hourstotransfercalc',1.5);return false;"  placeholder="0:00" style="float: left;" type="text" value=""> <a class="toolbarbtn text-red inlinebtn" href="javascript:dataform.cleanfield('hourstotransfer');dataform.cleanfield('hourstotransfercalc');return false;"><span class="icon icon-remove" style="font-size: 10px;"></span></a>
+              </div><label class="label" for="staffreportperiod_hourstotransfer">heures</label>
             </div>
             <div class="container cell">
               <div class="cell" style="width: 86px;">
-                <input class="data_staffreportperiod intervalfield readonly" id="transferedhourscalc" name="staffreportperiod_transferedhourscalc" placeholder="0:00" style="float: left;" type="text" value="">
-              </div><label class="label" for="staffreportperiod_transferedhourscalc">heures (x1,5)</label>
+                <input class="data_staffreportperiod intervalfield readonly" id="hourstotransfercalc" name="staffreportperiod_hourstotransfercalc" placeholder="0:00" style="float: left;" type="text" value="">
+              </div><label class="label" for="staffreportperiod_hourstotransfercalc">heures (x1,5)</label>
             </div>
             </div>
             <div class="row" style="border-top: 1px solid #c6c6c6;margin-bottom: 3px;padding-top: 3px;">
@@ -57,7 +62,7 @@
             <div class="container cell">
               <div class="cell" style="width: 86px;">
                 <input class="data_staffreportperiod intervalfield readonly" id="payedhours40calc" name="staffreportperiod_payedhours40calc" placeholder="0:00" style="float: left;" type="text" value="">
-              </div><label class="label" for="staffreportperiod_payedhours40calc">heures (x1,4)</label>
+              </div><label class="label" for="staffreportperiod_payedhours40calc">heures à rémunérer (x1,4)</label>
             </div>
             </div>
             <div class="row" style="border-top: 1px solid #c6c6c6;margin-bottom: 3px;padding-top: 3px;">
             </div>
             <div class="container cell">
               <div class="cell" style="width: 86px;">
-                <input class="data_staffreportperiod intervalfield" id="payedhours" name="staffreportperiod_payedhours" onblur="timecalc.validateInterval(this);timecalc.copyInterval(this,'payedhourscalc');return false;return false;"  placeholder="0:00" style="float: left;" type="text" value=""> <a class="toolbarbtn text-red inlinebtn" href="javascript:dataform.cleanfield('payedhours');dataform.cleanfield('payedhourscalc');"><span class="icon icon-remove" style="font-size: 10px;" ></span></a>
-              </div><label class="label" for="staffreportperiod_payedhours">heures</label>
+                <input class="data_staffreportperiod intervalfield" id="payedhours0" name="staffreportperiod_payedhours0" onblur="timecalc.validateInterval(this);timecalc.copyInterval(this,'payedhours0calc');return false;return false;"  placeholder="0:00" style="float: left;" type="text" value=""> <a class="toolbarbtn text-red inlinebtn" href="javascript:dataform.cleanfield('payedhours0');dataform.cleanfield('payedhours0calc');"><span class="icon icon-remove" style="font-size: 10px;" ></span></a>
+              </div><label class="label" for="staffreportperiod_payedhours0">heures</label>
             </div>
             <div class="container cell">
               <div class="cell" style="width: 86px;">
-                <input class="data_staffreportperiod intervalfield readonly" id="payedhourscalc" name="staffreportperiod_payedhourscalc" placeholder="0:00" style="float: left;" type="text" value="">
-              </div><label class="label" for="staffreportperiod_payedhourscalc">heures</label>
+                <input class="data_staffreportperiod intervalfield readonly" id="payedhours0calc" name="staffreportperiod_payedhours0calc" placeholder="0:00" style="float: left;" type="text" value="">
+              </div><label class="label" for="staffreportperiod_payedhours0calc">heures  à rémunérer</label>
             </div>
             </div>
             <div class="row" style="border-top: 2px solid #000;margin-bottom: 3px; padding-top: 3px;">
             <div class="container cell" style="width: 160px;">
-              <label class="label">Total à reporter</label>
+              <label class="label">Décompte fin POT validé</label>
             </div>
             <div class="container cell">
               <div class="cell" style="width: 86px;">
       </form>
     </div>
     <footer>
-      <button class="button theme-light margin-right border" onclick="document.getElementById('dlg_periodvalidation').style.display='none'; return false;"><span class="icon icon-remove"></span>Annuler</button> <button class=
-      "button actionbtn margin-right border" id="btn_validateperiod" onclick="reportperiod.savepayedhours();return false;"><span class="icon icon-Save"></span>Valider et Finaliser</button>
+      <button class="button theme-light margin-right border" onclick="document.getElementById('dlg_periodvalidation').style.display='none'; return false;"><span class="icon icon-remove"></span>Fermer</button> <button class=
+      "button actionbtn margin-right border" id="btn_validateperiod" onclick="periodvalidation.save();return false;"><span class="icon icon-Save"></span>Savegarder</button><button class=
+      "button actionbtn margin-right border" id="btn_validateperiod" onclick="periodvalidation.validate();return false;"><span class="icon icon-check"></span>Valider et Finaliser</button>
     </footer>
   </div>
 </div>
index 0bb7545..9aa2d40 100644 (file)
@@ -1 +1 @@
-[% INCLUDE $page %]
+[% INCLUDE $page %]\r
index b505043..3ea98c1 100644 (file)
@@ -46,7 +46,7 @@
   </script>
   <script type="text/javascript" src="[% abspath %][% staticpath %]vendors/tabulator/js/tabulator.min.js"></script>
   <script type="text/javascript" src="[% abspath %][% staticpath %]vendors/moment/moment-with-locales.min.js"></script>
-  <script type="text/javascript" src="[% abspath %][% staticpath %]vendors/tinymce/js/tinymce/tinymce.min.js"></script>
+  <!--<script type="text/javascript" src="[% abspath %][% staticpath %]vendors/tinymce/js/tinymce/tinymce.min.js"></script>-->
   <script type="text/javascript" src="[% abspath %][% staticpath %]vendors/slimselect/slimselect.js"></script>
   <script type="text/javascript" src="[% abspath %][% staticpath %]vendors/flatpickr/flatpickr.min.js"></script>
   <script type="text/javascript" src="[% abspath %][% staticpath %]vendors/flatpickr/l10n/fr.js"></script>
index 81ae2c4..1ad93df 100644 (file)
@@ -7,16 +7,43 @@ let periodvalidation = {
       document.getElementById("periodvalidation_prename").innerHTML = prd[0].prename;
        document.getElementById("title_periodvalidation").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;
+       document.getElementById("payedhours0").value=prd[0].payedhours0;
+       document.getElementById("payedhours0calc").value=prd[0].payedhours0;
        document.getElementById("payedhours40").value=prd[0].payedhours40;
        document.getElementById("payedhours40calc").value=prd[0].payedhours40calc;
        document.getElementById("avgtotalweekhours").value=prd[0].avgtotalweekhours;
-       document.getElementById("diffhoursnet").value=timecalc.MinutesToInterval(timecalc.IntervalToMinutes(prd[0].totalhours)-timecalc.IntervalToMinutes(prd[0].contracthours));;
+       document.getElementById("diffhoursnet").value=timecalc.MinutesToInterval(timecalc.IntervalToMinutes(prd[0].totalhours)-timecalc.IntervalToMinutes(prd[0].contracthours));
+       document.getElementById("transferedhours").value=prd[0].transferedhours;
        document.getElementById("hourstotransfer").value=prd[0].hourstotransfer;
        document.getElementById("hourstotransfercalc").value=prd[0].hourstotransfercalc;
        app.viewdialog('periodvalidation');
     return false;
   },
+  save: function(){
+    let prd = reportperiod.tbl.getSelectedData();
+    //let rpdata = dataform.getformcontent("periodvalidation");
+    let vdata = {
+      "fn":"save_payedhours",
+      "schema":schemata,
+      "id_period":prd[0].id_reportperiod,
+      "id_staff":prd[0].id_staff,
+      "hourstotransfer":document.getElementById("hourstotransfer").value,
+      "hourstotransfercalc":document.getElementById("hourstotransfercalc").value,
+      "payedhours40":document.getElementById("payedhours40").value,
+      "payedhours40calc":document.getElementById("payedhours40calc").value,
+      "payedhours0":document.getElementById("payedhours0").value
+    }
+    //document.getElementById('dlg_periodvalidation').style.display='none';
+      
+    postData("db.cgi",vdata).then( data => {
+      dataform.formsaved({});
+      reportperiod.gettbldata();
+    }).catch(e => {
+      reportperiod.gettbldata();
+    });
+
+    return false;
+  },
   validate: function(){
     let prd = reportperiod.tbl.getSelectedData();
     //let rpdata = dataform.getformcontent("periodvalidation");
@@ -29,7 +56,7 @@ let periodvalidation = {
       "hourstotransfercalc":document.getElementById("hourstotransfercalc").value,
       "payedhours40":document.getElementById("payedhours40").value,
       "payedhours40calc":document.getElementById("payedhours40calc").value,
-      "payedhours":document.getElementById("payedhours").value
+      "payedhours0":document.getElementById("payedhours0").value
     }
     document.getElementById('dlg_periodvalidation').style.display='none';
       showdataloaddlg('','<div class="xxlarge">Attendez s.v.p.!</div>');
@@ -42,4 +69,9 @@ let periodvalidation = {
 
     return false;
   },
+  calcresthours: function(){
+    let restberfore = timecalc.IntervalToMinutes(document.getElementById("diffhoursnet").value);
+    let payed40 = timecalc.IntervalToMinutes(document.getElementById("payedhours40calc").value);
+    let payed0 = timecalc.IntervalToMinutes(document.getElementById("payedhours0calc").value);
+  }
 }
\ No newline at end of file
index ebab3d5..1e7e727 100644 (file)
@@ -52,7 +52,7 @@ let reportperiod ={
         {title: "Récup", field:"recuperationhours",hozAlign:"right",headerSort: false},
         {title: "congé", field:"vacancyhours",hozAlign:"right",headerSort: false},
         {title: "Total", field:"totalhours",hozAlign:"right",headerSort: false},
-        {title: "décompte<br/>reporté", field:"transferedhourscalc",hozAlign:"right",headerSort: false},
+        {title: "décompte<br/>reporté", field:"transferedhours",hozAlign:"right",headerSort: false},
         {title: "payés", field:"payedhours",hozAlign:"right",headerSort: false} ,
         {title: "décompte<br/>fin POT", field:"hoursdiff",hozAlign:"right",headerSort: false},
         {title: "congé suppl.<br/>+44 h", field:"suppvacancy44hours",hozAlign:"right",headerSort: false},
index 630b612..36d4223 100644 (file)
@@ -631,7 +631,7 @@ let vacancyformatter = function(cell, formatterParams){
     //console.log("vac",cell._cell.row.data.id_vacancytype);
     //console.log("vac",staffperiodweeks.vacancytypes);
     if (staffperiodweeks.vacancytypes[cell._cell.row.data.id_vacancytype]){
-      cell.getElement().style.color=staffperiodweeks.vacancytypes[cell._cell.row.data.id_vacancytype].color;
+      cell.getElement().style.backgroundColor=staffperiodweeks.vacancytypes[cell._cell.row.data.id_vacancytype].color;
       return  cell.getValue() + "<br/>"+ staffperiodweeks.vacancytypes[cell._cell.row.data.id_vacancytype].vacancyname;
     }  
   }
@@ -641,7 +641,7 @@ let vacancyformatter = function(cell, formatterParams){
 let recupformatter = function(cell, formatterParams){
   if (cell.getValue() > "00:00") {
     if (staffperiodweeks.recuperationtypes[cell._cell.row.data.id_recuperationtype]){
-      cell.getElement().style.color=staffperiodweeks.recuperationtypes[cell._cell.row.data.id_recuperationtype].color;
+      cell.getElement().style.backgroundColor=staffperiodweeks.recuperationtypes[cell._cell.row.data.id_recuperationtype].color;
       return  cell.getValue() + "<br/>"+ staffperiodweeks.recuperationtypes[cell._cell.row.data.id_recuperationtype].vacancyname;
     }
   }
index 303bdeb..13e1f01 100644 (file)
@@ -1,54 +1,54 @@
-
-
-[% quserdata = dksdb.query("select * from users where id='${session.id}';") %]
-[% user = quserdata.get_all() %]
-<div class="display-container">
-    <div class="bar toolbar">
-     <a class="bar-item toolbarbtn" href="[% abspath %]index.html"><span class="icon icon-back" style="font-size: 16px;"></span>retour</a>
-      <div class="bar-item PageHeadTitle">Profile</div>
-  </div>
-</div>
-<div class="display-container margin center">
-<div class="cell-row ">
-  <div class="cell container padding-24 margin-bottom left-align" style="width: 400px;">
-    <form id="frm_account">
-        <fieldset>
-  <legend>données d'accès</legend>
-        
-        <div class="row-padding">
-            <div class="container">
-            
-            <div class="container" >
-        
-        <input type="text" class="input  data_users readonly " id="username" data-column="username"  data-table="users" data-id="" name="users_username" value="ksaffran@dks.lu"  readonly />
-        <label for="users_username" class="label">E-Mail (Login)</label>
-      </div>
-            <div class="bar-block">
-                <button class="bar-item button blue-grey" onclick="opendlgusername();return false;">Changer E-Mail (Login)</button>
-                <div class="bar-item right">&nbsp;</div>
-                <button class="bar-item button blue-grey" onclick="opendlgpassword();return false;">Changer mot de passe</button>
-                
-                
-              </div> 
-            </div>
-            <div class="container margin-top padding">
-              
-            
-          </div>
-        </div>
-        </fieldset>
-    </form>
-    </div>
-    
-</div>
-    
-      
-      
-  </div>    
-
-
-  [% INCLUDE module/profile/dlgpassword.tt %]
-  [% INCLUDE module/profile/dlgusername.tt %]
-  <script type="text/javascript" src="profile/profile.js?v=[% appversion %]"></script>
-  
-
+\r
+\r
+[% quserdata = dksdb.query("select * from users where id='${session.id}';") %]\r
+[% user = quserdata.get_all() %]\r
+<div class="display-container">\r
+    <div class="bar toolbar">\r
+     <a class="bar-item toolbarbtn" href="[% abspath %]index.html"><span class="icon icon-back" style="font-size: 16px;"></span>retour</a>\r
+      <div class="bar-item PageHeadTitle">Profile</div>\r
+  </div>\r
+</div>\r
+<div class="display-container margin center">\r
+<div class="cell-row ">\r
+  <div class="cell container padding-24 margin-bottom left-align" style="width: 400px;">\r
+    <form id="frm_account">\r
+        <fieldset>\r
+  <legend>données d'accès</legend>\r
+        \r
+        <div class="row-padding">\r
+            <div class="container">\r
+            \r
+            <div class="container" >\r
+        \r
+        <input type="text" class="input  data_users readonly " id="username" data-column="username"  data-table="users" data-id="" name="users_username" value="ksaffran@dks.lu"  readonly />\r
+        <label for="users_username" class="label">E-Mail (Login)</label>\r
+      </div>\r
+            <div class="bar-block">\r
+                <button class="bar-item button blue-grey" onclick="opendlgusername();return false;">Changer E-Mail (Login)</button>\r
+                <div class="bar-item right">&nbsp;</div>\r
+                <button class="bar-item button blue-grey" onclick="opendlgpassword();return false;">Changer mot de passe</button>\r
+                \r
+                \r
+              </div> \r
+            </div>\r
+            <div class="container margin-top padding">\r
+              \r
+            \r
+          </div>\r
+        </div>\r
+        </fieldset>\r
+    </form>\r
+    </div>\r
+    \r
+</div>\r
+    \r
+      \r
+      \r
+  </div>    \r
+\r
+\r
+  [% INCLUDE module/profile/dlgpassword.tt %]\r
+  [% INCLUDE module/profile/dlgusername.tt %]\r
+  <script type="text/javascript" src="profile/profile.js?v=[% appversion %]"></script>\r
+  \r
+\r
index 47e2238..cc9797c 100644 (file)
@@ -1,20 +1,20 @@
-var iduser="[% session.id %]";
-var schemata = "public";
-function initpage(){
-  loaduserdata(iduser);
-}
-
-function loaduserdata(id){
-  req.reqdata("db.cgi",{"vw":"usersdata","filter":"id="+id},fillformaccount);
-}
-
-function fillformaccount(data){
-  if (data && data.sqldata){
-    if (data && data.sqldata){
-      dataform.fillformbydataclass2("users",{},data.sqldata[0]);
-    }
-  }
-}
-
-
-
+var iduser="[% session.id %]";\r
+var schemata = "public";\r
+function initpage(){\r
+  loaduserdata(iduser);\r
+}\r
+\r
+function loaduserdata(id){\r
+  req.reqdata("db.cgi",{"vw":"usersdata","filter":"id="+id},fillformaccount);\r
+}\r
+\r
+function fillformaccount(data){\r
+  if (data && data.sqldata){\r
+    if (data && data.sqldata){\r
+      dataform.fillformbydataclass2("users",{},data.sqldata[0]);\r
+    }\r
+  }\r
+}\r
+\r
+\r
+\r
index ba7fefd..3ba5a5f 100644 (file)
@@ -20,7 +20,7 @@ let staffperiods = {
         {title: "Récup", field:"recuperationhours",hozAlign:"right",headerSort: false},
         {title: "congé", field:"vacancyhours",hozAlign:"right",headerSort: false},
         {title: "Total", field:"totalhours",hozAlign:"right",headerSort: false},
-        {title: "décompte<br/>reporté", field:"transferedhourscalc",hozAlign:"right",headerSort: false},
+        {title: "décompte<br/>reporté", field:"transferedhours",hozAlign:"right",headerSort: false},
         {title: "payés", field:"payedhours",hozAlign:"right",headerSort: false} ,
         {title: "décompte<br/>fin POT", field:"hoursdiff",headerSort: false,hozAlign:"right",bottomCalc:staffperiods.periodrestsum},
         {title: "congé suppl.<br/>+44 h", field:"suppvacancy44hours",hozAlign:"right",headerSort: false},
diff --git a/robots.txt b/robots.txt
new file mode 100644 (file)
index 0000000..4d72a56
--- /dev/null
@@ -0,0 +1,7 @@
+User-Agent: *
+Allow: /
+Disallow: /js/
+Disallow: /css/
+Disallow: /cgv/
+Disallow: /api/
+Disallow: /downloads/
\ No newline at end of file
diff --git a/website/api/tmp/.htaccess b/website/api/tmp/.htaccess
new file mode 100644 (file)
index 0000000..908fc52
--- /dev/null
@@ -0,0 +1,5 @@
+#RewriteEngine On
+#RewriteBase /
+#RewriteCond %{HTTP_COOKIE} !potlu= [NC]
+#RewriteRule .* "%{REQUEST_SCHEME}://%{HTTP_HOST}/backoffice/login.html" [L]
+Require all denied
\ No newline at end of file
diff --git a/website/api/tools/.htaccess b/website/api/tools/.htaccess
new file mode 100644 (file)
index 0000000..908fc52
--- /dev/null
@@ -0,0 +1,5 @@
+#RewriteEngine On
+#RewriteBase /
+#RewriteCond %{HTTP_COOKIE} !potlu= [NC]
+#RewriteRule .* "%{REQUEST_SCHEME}://%{HTTP_HOST}/backoffice/login.html" [L]
+Require all denied
\ No newline at end of file
index 7d36c92..c5d2078 100644 (file)
@@ -256,7 +256,7 @@ hr{border:0;border-top:1px solid #eee;margin:20px 0}
 .hover-theme:hover {color:#fff !important; background-color:#6a92d3 !important}
 .hover-text-theme:hover {color:#6a92d3 !important}
 .hover-border-theme:hover {border-color:#6a92d3 !important}
-
+.nax { display: none;}
 /* .label { color: #000; font-size: 8pt;} */
 /* #main {margin-left: 210px;} */
 /* @media (max-width:768px){
@@ -271,6 +271,13 @@ hr{border:0;border-top:1px solid #eee;margin:20px 0}
   background-color: #f89774;
 }
 
+.success-panel {
+  padding: 3px;
+  color: #000;
+  border: 1px solid #27a800;
+  background-color: #adfd99;
+}
+
 .error-panel {
        padding: 3px;
   color: #ff0000;
diff --git a/website/img/macos_badge.png b/website/img/macos_badge.png
deleted file mode 100644 (file)
index 609640d..0000000
Binary files a/website/img/macos_badge.png and /dev/null differ
diff --git a/website/img/potsharelogo.jpg b/website/img/potsharelogo.jpg
new file mode 100644 (file)
index 0000000..9999a18
Binary files /dev/null and b/website/img/potsharelogo.jpg differ
diff --git a/website/img/windows_badge.png b/website/img/windows_badge.png
deleted file mode 100644 (file)
index 6913d98..0000000
Binary files a/website/img/windows_badge.png and /dev/null differ
index 44116ac..1878d7c 100644 (file)
@@ -2,12 +2,30 @@
 <html dir="ltr" lang="fr">
   <head>
     <meta charset="utf-8">
-    <meta name="author" content="Kilian Saffran - DKS sarl">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
-    <meta http-equiv="Pragma" content="no-cache" />
-    <meta http-equiv="Expires" content="0" />
+    <meta name="language" content="fr">
+    <meta name="author" content="POT sarl">
+    <meta name="publisher" content="POT sarl">
+    <meta name="copyright" content="POT sarl">
+    <meta name="audience" content="all">
     <meta name="robots" content="index,follow">
+    <meta property="og:site_name" content="POT - Plan d'Organisation du Travail" />
+  <meta property="og:type" content="website" />
+  <meta property="og:url" content="https://www.plandutravail.lu/" />
+  <meta property="og:title" content="POT - Plan d'Organisation du Travail" />
+  <meta property="og:latitude" content="49.748340" />
+  <meta property="og:longitude" content="6.364520" />
+  <meta property="og:street_address" content="13, Beiwerwiss" />
+  <meta property="og:image" content="img/potsharelogo.jpg" />
+  <meta property="og:region" content="Grevenmacher" />
+  <meta property="og:postal_code" content="6230" />
+  <meta property="og:country_name" content="Luxembourg" />
+  <link rel="shortlink" href="https://www.plandutravail.lu">
+  <link rel="canonical" href="https://www.plandutravail.lu">
+
+    <!-- <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
+    <meta http-equiv="Pragma" content="no-cache" />
+    <meta http-equiv="Expires" content="0" /> -->
     <link rel="apple-touch-icon" sizes="57x57" href="img/favicon/apple-icon-57x57.png">
     <link rel="apple-touch-icon" sizes="60x60" href="img/favicon/apple-icon-60x60.png">
     <link rel="apple-touch-icon" sizes="72x72" href="img/favicon/apple-icon-72x72.png">
     <meta name="msapplication-TileColor" content="#ffffff">
     <meta name="msapplication-TileImage" content="img/favicon/ms-icon-144x144.png">
     <meta name="theme-color" content="#ffffff">
-    <link  rel="stylesheet" href="css/theme.css?v=2">
+    <link  rel="stylesheet" href="css/theme.css?v=3">
     <style>
       body:after{
       content:"";
-      position:fixed; /* stretch a fixed position to the whole screen */
+      position:fixed; 
       top:0;
-      height:100vh; /* fix for mobile browser address bar appearing disappearing */
+      height:100vh;
       left:0;
       right:0;
-      z-index:-1; /* needed to keep in the background */
+      z-index:-1;
       background:  url('img/potbg.jpg') center center;
       -webkit-background-size: cover;
       -moz-background-size: cover;
@@ -42,6 +60,7 @@
       background-size: cover;
 }
     </style>
+    <script type="text/javascript" src="js/site.js"></script>
   </head>
   <body>
     <div class="top hide-small hide-medium">
       <div class="row">
       <div class="quarter">&nbsp;</div>
       
-        <div class="row half white" style="padding: 10px;" id="contactfrom">
+        <div class="row half white" style="padding: 10px;" id="contactform">
           <div id="infomsg"></div>
           <form id="frmcontact">
-          <h2>Contactez nous:</h2>
+          <h3>Contact:</h3>
           <div class="row">
               <div class="half" style="padding-left: 10px;padding-right: 10px;">
                 <label for="company" class="label">Entreprise</label>
                 <label for="message" class="label" >Message</label>
                 <textarea id="message"  name="message" style="height: 200px; width: 100%;padding-left: 10px;padding-right: 10px;" required></textarea>
               </div>
+              <div class="nax">
+                <input type="checkbox" id="terms"  name="terms" value="1" required/><label for="message" class="label" >J'ai lu est j'accepte les conditions générales</label>
+              </div>
             </div>
             <div class="row container"><button type="button" class="button right actionbtn" onclick="sendmessage();">Envoyer</button></div>
           </form>
     </div>
   </div>
     </div>
-<!-- <div class="bgimg display-container animate-opacity text-white">
-  <div class="display-topleft padding-large xlarge"></div>
-  <div class="display-middle center">
-    <h1 class="jumbo animate-top">
-      <img alt="POT" src="img/pot_big.png">
-    </h1>
-    <hr class="border-grey" style="margin:auto;width:40%">
-    <p class="large center">
-      version 1.0.0<br>
-      <br>
-    </p>
-    <div class="row center">
-      <div class="col" style="width: 100%;">
-        <a class="button round" style="width: 200px;" href="downloads/POT_Setup_64bit.exe"><img src="img/windows_badge.png" style="width: 100%;" /></a><br/>
-        <a href="downloads/POT_Setup_64bit.exe">version pour Windows 64bit</a><br/>
-        <a href="downloads/POT_Setup_32bit.exe">version pour Windows 32bit</a>
-        
-      </div>
-      <<div class="col" style="width: 50%;">
-        <a class="button round" style="width: 100%;" href="downloads/POT_Setup_macos.dmg"><img src="img/macos_badge.png" /></a>
-      </div>
-    </div>
-    <p></p>
-  </div> -->
   <div class="center padding-large">
-    &copy; 2020 by POT S.à r.l. - <a href="impressum.html">Impressum</a> - <a href="app/cgv/cgv.pdf" target="_blank">Conditions générales</a>
+    &copy; 2020 by POT S.à r.l. - <a href="cgv/cgv.pdf" target="_blank">Conditions générales</a>
   </div>
 </div>
 
index 4d3ecb7..97919cc 100644 (file)
@@ -1,34 +1,35 @@
-function sendemessage(){
-  var frm = document.getElementById("frm_contact");
+function sendmessage(){
+  var frm = document.getElementById("frmcontact");
   var fld = {"fn":"sendemail"};
   var bsend = 1;
   for (var i = 0; i < frm.elements.length; i++) {
     var field = frm.elements[i];
     if (field.tagName == "INPUT" || field.tagName == "SELECT" || field.tagName == "TEXTAREA"){
       var fval = field.value.trim(); 
-      if (fval == ''){
-        bsend = 0;
-      }
-      flds[field.getAttribute("name")] = field.value;
+      if (field.id == "terms"){if (field.checked){bsend = 0;}}
+      else if (fval == ''){bsend = 0;}
+      else {fld[field.getAttribute("name")] = field.value;}
     }
   }
   if (bsend == 1){
-    postData("api/sendemail.cgi",fld) .then(data => {
+    console.log("Data To Send",fld);
+    document.getElementById("contactform").innerHTML = '<div class="panel success-panel">Merci,<br/><br/>votre message a été envoyé!</div>';
+    /*postData("api/sendemail.cgi",fld) .then(data => {
       if (data.result == 0){
-        document.getElementById("contactform").innerHTML = '<div class="panel xlarge">Merci,<br/><br/>votre message a été envoyé!</div>';
+        
       }
       
     }).catch(e => {
       document.getElementById("contactform").innerHTML = '<div class="panel xlarge text-red">Une erreur c\'est produite, essayer plus tard encore une fois!</div>';
-    });
+    });*/
   } else {
-    document.getElementById('<div class="panel"></div>');
+    document.getElementById("infomsg").innerHTML = '<div class="panel error-panel">Tous les champs sont requis!</div>';
   }
   
 }
 
 async function postData(url = '', data = {}) {
-  const response = await fetch(api + url, {
+  const response = await fetch('api/sendemail.cgi', {
     method: 'POST', 
     mode: 'same-origin', 
     cache: 'no-cache',