From: kilian@dks-pc1 Date: Sun, 20 Sep 2020 07:44:23 +0000 (+0200) Subject: v20200920 X-Git-Tag: 1.0.15~21 X-Git-Url: http://cloud.dks.lu/git/?a=commitdiff_plain;h=71cab5ba926abab178c748eed23e3533f68ab66f;p=pot_lu.git v20200920 --- diff --git a/app/.htaccess b/app/.htaccess index 2d11d59a..915e9816 100644 --- a/app/.htaccess +++ b/app/.htaccess @@ -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 +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] RewriteRule "^(.*)$" "index.cgi" [NC,L,QSA] \ No newline at end of file diff --git a/app/data/schemata/defaultcompany.schema.sql b/app/data/schemata/defaultcompany.schema.sql index 0e1cba6c..30d9ff43 100644 --- a/app/data/schemata/defaultcompany.schema.sql +++ b/app/data/schemata/defaultcompany.schema.sql @@ -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 $$ + begin + new.modified = now(); + RETURN NEW; + END; $$; CREATE TABLE %%NEWSCHEMA%%.reportperiod ( diff --git a/app/db.cgi b/app/db.cgi index 8a2c489e..543801b9 100644 --- a/app/db.cgi +++ b/app/db.cgi @@ -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}); diff --git a/app/lib/POT/Period.pm b/app/lib/POT/Period.pm index 39eaad34..9ab31d53 100644 --- a/app/lib/POT/Period.pm +++ b/app/lib/POT/Period.pm @@ -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); diff --git a/app/lib/dksdb.pm b/app/lib/dksdb.pm index 3f6ab961..12a2414c 100644 --- a/app/lib/dksdb.pm +++ b/app/lib/dksdb.pm @@ -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; } diff --git a/app/static/js/app.js b/app/static/js/app.js index fbbb48a9..04b663d2 100644 --- a/app/static/js/app.js +++ b/app/static/js/app.js @@ -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 { 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
-
+ + +
+
+ +
@@ -36,13 +41,13 @@
- -
+ +
- -
+ +
@@ -57,7 +62,7 @@
-
+
@@ -66,18 +71,18 @@
- -
+ +
- -
+ +
- +
@@ -95,8 +100,9 @@
- +
diff --git a/app/tmpl/file.tt b/app/tmpl/file.tt index 0bb75455..9aa2d407 100644 --- a/app/tmpl/file.tt +++ b/app/tmpl/file.tt @@ -1 +1 @@ -[% INCLUDE $page %] +[% INCLUDE $page %] diff --git a/app/tmpl/index.tt b/app/tmpl/index.tt index b505043b..3ea98c1a 100644 --- a/app/tmpl/index.tt +++ b/app/tmpl/index.tt @@ -46,7 +46,7 @@ - + diff --git a/app/tmpl/module/periods/periodvalidation.js b/app/tmpl/module/periods/periodvalidation.js index 81ae2c4e..1ad93df2 100644 --- a/app/tmpl/module/periods/periodvalidation.js +++ b/app/tmpl/module/periods/periodvalidation.js @@ -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('','
Attendez s.v.p.!
'); @@ -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 diff --git a/app/tmpl/module/periods/reportperiod.js b/app/tmpl/module/periods/reportperiod.js index ebab3d55..1e7e7273 100644 --- a/app/tmpl/module/periods/reportperiod.js +++ b/app/tmpl/module/periods/reportperiod.js @@ -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
reporté", field:"transferedhourscalc",hozAlign:"right",headerSort: false}, + {title: "décompte
reporté", field:"transferedhours",hozAlign:"right",headerSort: false}, {title: "payés", field:"payedhours",hozAlign:"right",headerSort: false} , {title: "décompte
fin POT", field:"hoursdiff",hozAlign:"right",headerSort: false}, {title: "congé suppl.
+44 h", field:"suppvacancy44hours",hozAlign:"right",headerSort: false}, diff --git a/app/tmpl/module/periods/staffperiodweeks.js b/app/tmpl/module/periods/staffperiodweeks.js index 630b612d..36d42230 100644 --- a/app/tmpl/module/periods/staffperiodweeks.js +++ b/app/tmpl/module/periods/staffperiodweeks.js @@ -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() + "
"+ 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() + "
"+ staffperiodweeks.recuperationtypes[cell._cell.row.data.id_recuperationtype].vacancyname; } } diff --git a/app/tmpl/module/profile.tt b/app/tmpl/module/profile.tt index 303bdeb9..13e1f015 100644 --- a/app/tmpl/module/profile.tt +++ b/app/tmpl/module/profile.tt @@ -1,54 +1,54 @@ - - -[% quserdata = dksdb.query("select * from users where id='${session.id}';") %] -[% user = quserdata.get_all() %] -
-
- retour -
Profile
-
-
-
-
-
-
-
- données d'accès - -
-
- -
- - - -
-
- -
 
- - - -
-
-
- - -
-
-
-
-
- -
- - - -
- - - [% INCLUDE module/profile/dlgpassword.tt %] - [% INCLUDE module/profile/dlgusername.tt %] - - - + + +[% quserdata = dksdb.query("select * from users where id='${session.id}';") %] +[% user = quserdata.get_all() %] +
+
+ retour +
Profile
+
+
+
+
+
+
+
+ données d'accès + +
+
+ +
+ + + +
+
+ +
 
+ + + +
+
+
+ + +
+
+
+
+
+ +
+ + + +
+ + + [% INCLUDE module/profile/dlgpassword.tt %] + [% INCLUDE module/profile/dlgusername.tt %] + + + diff --git a/app/tmpl/module/profile/profile.js b/app/tmpl/module/profile/profile.js index 47e22386..cc9797c5 100644 --- a/app/tmpl/module/profile/profile.js +++ b/app/tmpl/module/profile/profile.js @@ -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 %]"; +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]); + } + } +} + + + diff --git a/app/tmpl/module/staff/staffperiods.js b/app/tmpl/module/staff/staffperiods.js index ba7fefda..3ba5a5fd 100644 --- a/app/tmpl/module/staff/staffperiods.js +++ b/app/tmpl/module/staff/staffperiods.js @@ -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
reporté", field:"transferedhourscalc",hozAlign:"right",headerSort: false}, + {title: "décompte
reporté", field:"transferedhours",hozAlign:"right",headerSort: false}, {title: "payés", field:"payedhours",hozAlign:"right",headerSort: false} , {title: "décompte
fin POT", field:"hoursdiff",headerSort: false,hozAlign:"right",bottomCalc:staffperiods.periodrestsum}, {title: "congé suppl.
+44 h", field:"suppvacancy44hours",hozAlign:"right",headerSort: false}, diff --git a/robots.txt b/robots.txt new file mode 100644 index 00000000..4d72a568 --- /dev/null +++ b/robots.txt @@ -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 index 00000000..908fc527 --- /dev/null +++ b/website/api/tmp/.htaccess @@ -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 index 00000000..908fc527 --- /dev/null +++ b/website/api/tools/.htaccess @@ -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/css/theme.css b/website/css/theme.css index 7d36c923..c5d20784 100644 --- a/website/css/theme.css +++ b/website/css/theme.css @@ -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 index 609640dd..00000000 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 index 00000000..9999a183 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 index 6913d980..00000000 Binary files a/website/img/windows_badge.png and /dev/null differ diff --git a/website/index.html b/website/index.html index 44116acf..1878d7cb 100644 --- a/website/index.html +++ b/website/index.html @@ -2,12 +2,30 @@ - - - - + + + + + + + + + + + + + + + + + + + + @@ -25,16 +43,16 @@ - + +
@@ -71,10 +90,10 @@
 
-
+
-

Contactez nous:

+

Contact:

@@ -105,6 +124,9 @@
+
+ +
@@ -113,32 +135,8 @@
-
- © 2020 by POT S.à r.l. - Impressum - Conditions générales + © 2020 by POT S.à r.l. - Conditions générales
diff --git a/website/js/site.js b/website/js/site.js index 4d3ecb7c..97919cc1 100644 --- a/website/js/site.js +++ b/website/js/site.js @@ -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 = '
Merci,

votre message a été envoyé!
'; + /*postData("api/sendemail.cgi",fld) .then(data => { if (data.result == 0){ - document.getElementById("contactform").innerHTML = '
Merci,

votre message a été envoyé!
'; + } }).catch(e => { document.getElementById("contactform").innerHTML = '
Une erreur c\'est produite, essayer plus tard encore une fois!
'; - }); + });*/ } else { - document.getElementById('
'); + document.getElementById("infomsg").innerHTML = '
Tous les champs sont requis!
'; } } 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',