From: Kilian Saffran Date: Fri, 12 Mar 2021 17:09:47 +0000 (+0100) Subject: v20210312 X-Git-Url: http://cloud.dks.lu/git/?a=commitdiff_plain;h=e7dd94365e6e52f188ebf314cccb4a70b45e6120;p=pot_lu.git v20210312 --- diff --git a/app/css/theme.css b/app/css/theme.css index 2a532f8d..f513f20d 100644 --- a/app/css/theme.css +++ b/app/css/theme.css @@ -868,6 +868,11 @@ span[class^="icon"]::after { white-space: pre; } +span[class^="rowicon"]::after { + content: "\A"; + white-space: nowrap; +} + a.inlinebtn { diff --git a/app/lib/POT/Period.php b/app/lib/POT/Period.php index 8d66ebda..0cff3cc6 100644 --- a/app/lib/POT/Period.php +++ b/app/lib/POT/Period.php @@ -77,7 +77,7 @@ function getStaffPeriodSplitted($schema,$id_staff,$id_period,$id_groups){ to_char(sum(coalesce(pd.vacancyhours,'00:00:00'::time)), 'HH24:MI'::text) as vacancynormal, to_char(sum(coalesce(pd.vacillhours,'00:00:00'::time)), 'HH24:MI'::text) as vacancyill, to_char(sum(coalesce(pd.vacextrahours,'00:00:00'::time)), 'HH24:MI'::text) as vacancyextra, - to_char(sum(coalesce(pd.partunemplhours,'00:00:00'::time)), 'HH24:MI'::text) as partunemplhours, + to_char(sum(coalesce(pd.otherpaidhours,'00:00:00'::time)), 'HH24:MI'::text) as otherpaidhours, to_char(sum(coalesce(pd.recuperationhours,'00:00:00'::time)), 'HH24:MI'::text) as recuperationhours,sgr.groupname from ".$schema.".staffreportperioddays pd join ( @@ -115,7 +115,7 @@ function getStaffPeriods($schema,$id_staff,$id_period,$id_groups,$splitted){ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill, to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal, to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra, - to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours, + to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours, to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours, case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff, to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours, @@ -158,7 +158,7 @@ function getPeriodWeekSums($schema,$id_staff, $date_start,$date_end,$id_period){ ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal ,to_char(ws.vacillhours,'HH24:MI') as vacancyill ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra - ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours + ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours ,to_char(ws.totalhours,'HH24:MI') as totalhours ,cd.contractworkdays @@ -184,9 +184,9 @@ function getPeriodWeekSums($schema,$id_staff, $date_start,$date_end,$id_period){ sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours, sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours, sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours, - sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours, + sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours, sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours, - sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays, + sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays, sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours FROM (select *,date(date_trunc('week', daydate)) AS weekstart, date(date_trunc('week', daydate) + interval '6 days') AS weekend, @@ -227,7 +227,7 @@ function getPeriodWeekSums($schema,$id_staff, $date_start,$date_end,$id_period){ function getPeriodDays($schema,$id_staff,$date_start,$date_end){ $sql = "SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype, - vacancycomment,vacillcomment,vacextracomment,recupcomment,partunempcomment, + vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment, date(date_trunc('week',pd.daydate)) as weekstart, to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1, to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1, @@ -240,7 +240,7 @@ function getPeriodDays($schema,$id_staff,$date_start,$date_end){ to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours, to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours, to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours, - to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours, + to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours, to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours, to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours, @@ -362,19 +362,19 @@ function updatePeriodDaySums($schema,$dayids){ //case when payedpause is null then (preds.dt1+preds.dt2) else (preds.dt1+preds.dt2)-(preds.pdt1+preds.pdt2) end as worktime, $sql = "update ".$schema.".staffreportperioddays spds set workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end, - dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.partunemplhours::interval + ds.recup::interval )::interval, interruptionhours = ds.interruption , - contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.partunemplhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end + dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval )::interval, interruptionhours = ds.interruption , + contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end from ( select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup, case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours, case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours, case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours, - case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours, + case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours, preds.interruption, (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime, (preds.pdt1+preds.pdt2) as timepause, wdcontracthours - from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,partunemplhours,payedpause, + from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause, case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1, case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2, case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1, @@ -468,7 +468,7 @@ sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours vacancyill=csp.vacillhours, vacancynormal=csp.vacancynormal, vacancyextra=csp.vacextrahours, - partunemplhours=csp.partunemplhours, + otherpaidhours=csp.otherpaidhours, totalhours=csp.totalhours, recuperationhours=csp.recuperationhours,"; //if ((defined($statussuncount) && $staffprdprev["prevperiod"] != '')){ @@ -480,14 +480,14 @@ sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours $sql .= "avgtotalweekhours=".(($whavg["avgtotalhours"] == "")?'null':"'".$whavg["avgtotalhours"]."'::interval").","; $sql .= "hoursdiff=csp.diffhours FROM ( - select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,partunemplhours from ( + select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours from ( select dp.id, sum(pd.workhours) as workhours, sum(pd.dayhours) as totalhours, sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal, sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours, sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours, - sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours, + sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours, sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours, coalesce(dp.contracthours,'00:00:00'::interval) as contracthours, coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0, @@ -605,7 +605,7 @@ function clonePeriodDay($schema,$id_staff,$id_period,$copyid,$pasteids){ vacancyhours=".$this->dbh->value($copy["vacancyhours"]).", vacillhours=".$this->dbh->value($copy["vacillhours"]).", vacextrahours=".$this->dbh->value($copy["vacextrahours"]).", - partunemplhours=".$this->dbh->value($copy["partunemplhours"]).", + otherpaidhours=".$this->dbh->value($copy["otherpaidhours"]).", recuperationhours=".$this->dbh->value($copy["recuperationhours"])." where id in ('".join("','",$pasteids)."');"; $sql = preg_replace('/\s+/g',' ',$sql); @@ -633,7 +633,7 @@ function cleanPeriodDays($schema,$id_staff,$id_period,$ids){ vacancyhours = null, vacillhours = null, vacextrahours = null, - partunemplhours = null, + otherpaidhours = null, recuperationhours = null, workhours=null, dayhours=null @@ -654,15 +654,15 @@ function replaceDayWorkplan($schema,$id_staff,$id_reportperiod,$id_workplan,$kee $copy = $this->dbh->queryarray("select * from ".$schema.".workplandays where id_workplan='".$id_workplan."';"); //print Dumper($copy); foreach ($copy as $c){ - $this->dbh->exec("update ".$schema.".staffreportperioddays set timestart1=".$this->dbh->value($copy[$c]["start1"]).",timeend1=".$this->dbh->value($copy[$c]["end1"]).",timestart2=".$this->dbh->value($copy[$c]["start2"]).",timeend2=".$this->dbh->value($copy[$c]["end2"]).", timepause=".$this->dbh->value($copy[$c]["pause"]).", - pausestart1=".$this->dbh->value($copy[$c]["pausestart1"]).",pauseend1=".$this->dbh->value($copy[$c]["pauseend1"]).",pausestart2=".$this->dbh->value($copy[$c]["pausestart2"]).",pauseend2=".$this->dbh->value($copy[$c]["pauseend2"])." where id in ('".join("','",$replaceids)."') and date_part('isodow',daydate)::INT4='".$copy[$c]["weekday"]."';"); + $this->dbh->exec("update ".$schema.".staffreportperioddays set timestart1=".$this->dbh->value($c["start1"]).",timeend1=".$this->dbh->value($c["end1"]).",timestart2=".$this->dbh->value($c["start2"]).",timeend2=".$this->dbh->value($c["end2"]).", timepause=".$this->dbh->value($c["pause"]).", + pausestart1=".$this->dbh->value($c["pausestart1"]).",pauseend1=".$this->dbh->value($c["pauseend1"]).",pausestart2=".$this->dbh->value($c["pausestart2"]).",pauseend2=".$this->dbh->value($c["pauseend2"])." where id in ('".join("','",$replaceids)."') and date_part('isodow',daydate)::INT4='".$c["weekday"]."';"); if ($keepvac != "1"){ $this->dbh->exec("update ".$schema.".staffreportperioddays set vacancyhours=null,vacillhours=null,vacextrahours=null - where id in ('".join("','",$replaceids)."') and date_part('isodow',daydate)::INT4='".$copy[$c]["weekday"]."';"); + where id in ('".join("','",$replaceids)."') and date_part('isodow',daydate)::INT4='".$c["weekday"]."';"); } if ($keeprec != "1"){ $this->dbh->exec("update ".$schema.".staffreportperioddays set recuperationhours=null,id_recuperationtype=null - where id in ('".join("','",$replaceids)."') and date_part('isodow',daydate)::INT4='".$copy[$c]["weekday"]."';"); + where id in ('".join("','",$replaceids)."') and date_part('isodow',daydate)::INT4='".$c["weekday"]."';"); } } //$this->setStaffPeriodDays($schema,$id_reportperiod,$id_staff); diff --git a/app/lib/POT/Report.php b/app/lib/POT/Report.php index 4f07e09c..789a8cc4 100644 --- a/app/lib/POT/Report.php +++ b/app/lib/POT/Report.php @@ -55,7 +55,7 @@ join ".$schema.".staff st on (st.id=srp.id_staff)"; - #dircopy($self->{tmplpath}.'/'.$template,$this->cfg["tmppath"].'/'.$template); + //dircopy($self->{tmplpath}.'/'.$template,$this->cfg["tmppath"].'/'.$template); if (file_exists($this->cfg["tmppath"].$tmpfile.'.html')){ $cmd = '"'.$this->cfg["toolspath"]."/bin/wkhtmltopdf".'"'; if ($this->report[$template]["bottom"]){ $cmd .= " -B ".$this->report[$template]["bottom"]; } @@ -74,7 +74,7 @@ join ".$schema.".staff st on (st.id=srp.id_staff)"; $cmd .= ' "'.$this->cfg["tmppath"].'/'.$tmpfile.'.html"'; $cmd .= ' "'.$pdfname.'"'; error_log($cmd); - #print STDERR $cmd."\n"; + //print STDERR $cmd."\n"; $r = system($cmd); } if (file_exists($pdfname)){ @@ -93,7 +93,7 @@ join ".$schema.".staff st on (st.id=srp.id_staff)"; // $self->printContent($schema,$this->cfg["tmppath"].'/'.$template.$$.".html",$inputdata); // $self->printHeader($schema,$this->cfg["tmppath"].'/'.$template.$$.".header.html"); // $self->printFooter($schema,$this->cfg["tmppath"].'/'.$template.$$.".footer.html"); -// #dircopy($self->{tmplpath}.'/'.$template,$this->cfg["tmppath"].'/'.$template); +// //dircopy($self->{tmplpath}.'/'.$template,$this->cfg["tmppath"].'/'.$template); // if ((-e $this->cfg["tmppath"].'/'.$template.$$.'.html')){ // $cmd = '"'.$self->{pdf}->{app}.'"'; // if ($pdfreports->{$template}->{bottom}){ $cmd .= " -B ".$pdfreports->{$template}->{bottom}; } @@ -111,11 +111,11 @@ join ".$schema.".staff st on (st.id=srp.id_staff)"; // } // $cmd .= ' "'.$this->cfg["tmppath"].'/'.$template.$$.'.html"'; // $cmd .= ' "'.$output.'"'; -// #print STDERR $cmd."\n"; +// //print STDERR $cmd."\n"; // $r = system($cmd); // } // if (-e $output){ -// #unlink($this->cfg["tmppath"].'/'.$template.$$.'.html'); +// //unlink($this->cfg["tmppath"].'/'.$template.$$.'.html'); // unlink($this->cfg["tmppath"].'/'.$template.$$.'.header.html'); // unlink($this->cfg["tmppath"].'/'.$template.$$.'.footer.html'); // return ($r,$output); @@ -229,7 +229,7 @@ join ".$schema.".staff st on (st.id=srp.id_staff)"; td { text-align: center;vertical-align: top; border: 1px solid black; } .right{ text-align: right; } table.tbinline { border-collapse: collapse; } - /*table.tbinline td { border: 0.5px solid #969696; }*/ + /*table.tbinline td { border: 0.5px solid //969696; }*/ table.tbinline tr:first-child td { border-top: 0; } table.tbinline tr td:first-child { border-left: 0; } table.tbinline tr:last-child td { border-bottom: 0; } @@ -267,7 +267,7 @@ join ".$schema.".staff st on (st.id=srp.id_staff)"; $rpdata =$this->dbh->queryarray($sql); $rpmax = count($rpdata)-1; foreach ($rpdata as $rd){ - $outdata .= $self->ReportPage($schema,$rpdata[$rd]); + $outdata .= $this->ReportPage($schema,$rpdata[$rd]); if ($rd != $rpmax){ $outdata .= "
"; } @@ -285,28 +285,28 @@ join ".$schema.".staff st on (st.id=srp.id_staff)"; ".$data["dspstartdate"]." - ".$data["dspenddate"]."".(($data["staffnumber"] != "")?"".$data["staffnumber"]."":"")." ".$data["surname"]." ".$data["prename"]." ".(($data["matricule"] != "")?"(".$data["matricule"].")":"")." - - Lundi - Mardi - Mecredi - Jeudi - Vendredi - Samedi - Dimanche - + + Lundi + Mardi + Mecredi + Jeudi + Vendredi + Samedi + Dimanche + "; $txtpage = $tblheader; - #$pdays = $self->getPeriodDays($schema,$data["startdate"],$data["enddate"]); + //$pdays = $this->getPeriodDays($schema,$data["startdate"],$data["enddate"]); $wdk = 0; $lastpw = -1; $numweeks = count($weeksums); $cntr = 0; foreach ($perioddata as $pw){ - $wd = explode(',',','.$perioddata[$pw]["weekdates"]); - #print STDERR "CWEEKDAY:".$perioddata[$pw]["daydate"]."=>".$wd[$wdk]."\n"; + $wd = explode(',',','.$pw["weekdates"]); + //print STDERR "CWEEKDAY:".$pw["daydate"]."=>".$wd[$wdk]."\n"; if ($wdk == 0 ){ if ($cntr > 6){ $txtpage .= "
"; @@ -314,89 +314,89 @@ join ".$schema.".staff st on (st.id=srp.id_staff)"; $cntr = 0; } $cntr++; - $dspwd = explode(',',$perioddata[$pw]["dspweekdates"]); + $dspwd = explode(',',$pw["dspweekdates"]); $txtpage .=" - - ".$dspwd[0]." - ".$dspwd[1]." - ".$dspwd[2]." - ".$dspwd[3]." - ".$dspwd[4]." - ".$dspwd[5]." - ".$dspwd[6]." - + + ".$dspwd[0]." + ".$dspwd[1]." + ".$dspwd[2]." + ".$dspwd[3]." + ".$dspwd[4]." + ".$dspwd[5]." + ".$dspwd[6]." + "; $wdk = 1; } - #print STDERR "CWEEKDAY:".$perioddata[$pw]["daydate"]."=>".$wd[$wdk]."\n"; - while (($perioddata[$pw]["daydate"] != $wd[$wdk]) && $wdk <= "7"){ + //print STDERR "CWEEKDAY:".$pw["daydate"]."=>".$wd[$wdk]."\n"; + while (($pw["daydate"] != $wd[$wdk]) && $wdk <= "7"){ if ($wdk == 0){$wdk++; next; } - if (($perioddata[$pw]["daydate"] >= $data["startdate"]) || ($perioddata[$pw]["daydate"] <= $data["enddate"])){ - $txtpage .=" "; + if (($pw["daydate"] >= $data["startdate"]) || ($pw["daydate"] <= $data["enddate"])){ + $txtpage .=" "; } $wdk++; } - #print STDERR "CWEEKDAY2:".$perioddata[$pw]["daydate"]."=>".$wd[$wdk]."\n"; + //print STDERR "CWEEKDAY2:".$pw["daydate"]."=>".$wd[$wdk]."\n"; if ($wdk <= "7"){ - if ($perioddata[$pw]["dayhours"] != ""){ + if ($pw["dayhours"] != ""){ $txtpage .= "
- - + + - - +
".$perioddata[$pw]["dspworkdata"]."
".$pw["dspworkdata"]."
-
".(($perioddata[$pw]["dsppausedata"])?$perioddata[$pw]["dsppausedata"]:" ")."
+
+
".(($pw["dsppausedata"])?$pw["dsppausedata"]:" ")."
- -
- ".(($perioddata[$pw]["dayhours"])?"
".$perioddata[$pw]["dayhours"]."
":" ")." +
+ ".(($pw["dayhours"])?"
".$pw["dayhours"]."
":" ")."
- ".(($perioddata[$pw]["vacancyhours"])?"
".$perioddata[$pw]["vacancyhours"]." ".$self->{legend}->{vacancy}->{$perioddata[$pw]["id_vacancytype"]}->{legend}.")
":" ")." +
+ ".(($pw["vacancyhours"])?"
".$pw["vacancyhours"]." ".$this["legend"]["vacancy"][$pw["id_vacancytype"]][legend].")
":" ")."
- ".(($perioddata[$pw]["recuperationhours"])?"
".$perioddata[$pw]["recuperationhours"]." ".$self->{legend}->{recup}->{$perioddata[$pw]["id_recuperationtype"]}->{legend}.")
":" ")." + ".(($pw["recuperationhours"])?"
".$pw["recuperationhours"]." ".$this["legend"]["vacancy"][$pw["id_recuperationtype"]][legend].")
":" ")."
"; } else { - #print STDERR "ELSE:".$perioddata[$pw]["dayhours"]."\n"; + //print STDERR "ELSE:".$pw["dayhours"]."\n"; $txtpage .= "jour de repos"; } } $wdk++; $lastpw = $pw; - #print STDERR "Weekday:".$wdk."<=".$perioddata[$pw]["daydate"]."\n"; + //print STDERR "Weekday:".$wdk."<=".$pw["daydate"]."\n"; if ($wdk >= "7"){ $txtpage .= "
"; - $ws = $perioddata[$pw]["weekstart"]; + $ws = $pw["weekstart"]; if (isset($weeksums[$ws])){ $txtpage .= "
-
".$weeksums[$ws]["totalhours"]."
+
".$weeksums[$ws]["totalhours"]."
"; - #
".(($weeksums->{$ws}->{diffhours} =="00:00")?"":$weeksums->{$ws}->{diffhours})."
+ //
".(($weeksums->{$ws}->{diffhours} =="00:00")?"":$weeksums->{$ws}->{diffhours})."
} $txtpage .= "
@@ -404,10 +404,10 @@ join ".$schema.".staff st on (st.id=srp.id_staff)"; $wdk=0; } } - #print STDERR "WDK: ".$wdk."\n"; + //print STDERR "WDK: ".$wdk."\n"; if ($wdk >= "0"){ while ($wdk <= "7"){ - $txtpage .=" "; + $txtpage .=" "; $wdk++; } if ($wdk >= "7"){ @@ -419,22 +419,22 @@ join ".$schema.".staff st on (st.id=srp.id_staff)";
-
".$weeksums[$ws]["totalhours"]."
+
".$weeksums[$ws]["totalhours"]."
"; - # - # - #
".(($weeksums->{$ws}->{recperationhours} =="00:00")?"":$weeksums->{$ws}->{recperationhours})."
- # - # - # - # - #
".(($weeksums->{$ws}->{vacancyhours} =="00:00")?"":$weeksums->{$ws}->{vacancyhours})."
- # - # - #
".(($weeksums->{$ws}->{diffhours} =="00:00")?"":$weeksums->{$ws}->{diffhours})."
+ // + // + //
".(($weeksums->{$ws}->{recperationhours} =="00:00")?"":$weeksums->{$ws}->{recperationhours})."
+ // + // + // + // + //
".(($weeksums->{$ws}->{vacancyhours} =="00:00")?"":$weeksums->{$ws}->{vacancyhours})."
+ // + // + //
".(($weeksums->{$ws}->{diffhours} =="00:00")?"":$weeksums->{$ws}->{diffhours})."
} $txtpage .= " @@ -445,26 +445,26 @@ join ".$schema.".staff st on (st.id=srp.id_staff)"; $txtpage .= " "; - # $spt = $data["sums"]; + // $spt = $data["sums"]; $txtpage .= " - + - + - + - + - + - + - + - + @@ -488,7 +488,7 @@ join ".$schema.".staff st on (st.id=srp.id_staff)"; JOIN ".$schema.".staff st ON pd.id_staff = st.id and st.id='".$id_staff."' and st.isdeleted is null WHERE pd.daydate between date('".$date_start."') and date('".$date_end."') ORDER BY pd.id_staff, pd.daydate;"; - #print STDERR $sql."\n"; + //print STDERR $sql."\n"; return $this->dbh->queryarray($sql); } diff --git a/app/lib/POT/Staff.php b/app/lib/POT/Staff.php index 01e17081..99c074c4 100644 --- a/app/lib/POT/Staff.php +++ b/app/lib/POT/Staff.php @@ -97,7 +97,7 @@ where sc.id_staff='".$id_staff."' } $chsql = "select sum(maxdays) as maxdays,sum(contracthours - ('00:00:'|| extract(second from contracthours))::interval ) as itmcontracthours from ( select sum(maxdays) as maxdays,sum(maxdays) * (round(cast(((extract(epoch from (current_date + weekhours::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0) /weekdays as numeric) ,2)+0.00) * '01:00:00'::interval as contracthours from ( -select case when count(daydate) > weekdays then weekdays else count(daydate)-count(sundays) end as maxdays, calweek,count(daydate) as cntdays,count(sundays) as sundays,weekdays,weekhours from ( +select case when count(daydate) >= weekdays then weekdays else weekdays-count(daydate)-count(sundays) end as maxdays, calweek,count(daydate) as cntdays,count(sundays) as sundays,weekdays,weekhours from ( select id_staff,date(date_trunc('week',daydate)) as calweek,daydate,case when date_part('isodow',daydate)::int4=7 then 1 else null end as sundays from ".$schema.".staffreportperioddays diff --git a/app/lib/POT/TimeTrackSync.php b/app/lib/POT/TimeTrackSync.php index 4a10a5e4..f9bc673a 100644 --- a/app/lib/POT/TimeTrackSync.php +++ b/app/lib/POT/TimeTrackSync.php @@ -43,8 +43,8 @@ function GetStaff($schema ){ # function SyncAll(){ # # $schema -# $sync->{staff} = $self->getStaff(); -# $sync->{worktimes} = $self->getWorktimes(); +# $sync->{staff} = $this->getStaff(); +# $sync->{worktimes} = $this->getWorktimes(); # $time = strftime("%Y%m%d%H%M%S"); # open(TT,dirname($0).'/data/timetracker/'.$schema.'/'.); # print diff --git a/app/lib/POT/Workplan.php b/app/lib/POT/Workplan.php index c01d3ca1..8acdd557 100644 --- a/app/lib/POT/Workplan.php +++ b/app/lib/POT/Workplan.php @@ -134,14 +134,12 @@ class Workplan{ $sql = "UPDATE ".$schema.".workplandays SET start1=".$this->dbh->value($data["start1"]).", end1=".$this->dbh->value($data["end1"]).", start2=".$this->dbh->value($data["start2"]).", end2=".$this->dbh->value($data["end2"]).", pause=".$this->dbh->value($data["pause"]).", pausestart1=".$this->dbh->value($data["pausestart1"]).", pauseend1=".$this->dbh->value($data["pauseend1"]).", pausestart2=".$this->dbh->value($data["pausestart2"]).", pauseend2=".$this->dbh->value($data["pauseend2"])." WHERE id='".$id."';"; $this->dbh->exec($sql); $wid = $this->dbh->query("select id_workplan from ".$schema.".workplandays WHERE id='".$id."'"); - $self->updateWorplanData($schema,$wid["id_workplan"]); + $this->updateWorkplanData($schema,$wid["id_workplan"]); return 1; } - function updateWorplanData($schema,$workplan_id){ - $self = shift; - $schema = shift; - $workplan_id = shift; + function updateWorkplanData($schema,$workplan_id){ + $ispayedpause = $this->dbh->query("select payedpauses from public.companies where schemata='".$schema."'"); $payedpauses = ""; if ($ispayedpause["payedpauses"] != "1"){ diff --git a/app/lib/config.php b/app/lib/config.php index c28b81da..e0aaafcd 100644 --- a/app/lib/config.php +++ b/app/lib/config.php @@ -1,6 +1,6 @@ '1.3.7', + "appversion" => '1.3.9', "basepath" => substr(dirname($_SERVER["SCRIPT_FILENAME"]),strlen($_SERVER["DOCUMENT_ROOT"])).'/', "cookie" => "potlu", "templatepath" => "tmpl/", diff --git a/app/lib/database.php b/app/lib/database.php index 5d1f756e..49d9f977 100644 --- a/app/lib/database.php +++ b/app/lib/database.php @@ -2,7 +2,7 @@ class database { private $conn; private $dbconf; - private $debug=0; + private $debug=1; public function __construct($pdbconf){ $this->dbconf = $pdbconf; try { diff --git a/app/lib/lang/de.php b/app/lib/lang/de.php index 3524f868..05424b18 100644 --- a/app/lib/lang/de.php +++ b/app/lib/lang/de.php @@ -204,8 +204,6 @@ "vacancyill" => "Krankschreibung", "vacancyextra" => "Sonderurlaub", "vacancyextra2" => "Sonder-
urlaub", - "partunempl" => "Kurzarbeit", - "partunempl2" => "Kurzarbeit", "ttentry" => "Kommen", "ttexit" => "Gehen", "tttotal" => "Total", @@ -234,5 +232,7 @@ "datasaved" => "Die Daten wurden gespeichert!", "timeperiod" => "Zeitraum", "viewonlyweeks" => "Tage ausblenden", - "viewdays" => "Tage einblenden" + "viewdays" => "Tage einblenden", + "otherhours" => "Sonstige", + "otherpaidhours" => "andere bezahlte Stunden" ); ?> \ No newline at end of file diff --git a/app/lib/lang/fr.php b/app/lib/lang/fr.php index 7a102d05..923b66c3 100644 --- a/app/lib/lang/fr.php +++ b/app/lib/lang/fr.php @@ -204,8 +204,7 @@ "vacancyill" => "maladie", "vacancyextra" => "extraordinaire", "vacancyextra2" => "c. except.", - "partunempl" => "chômage part.", - "partunempl2" => "chômage
partielle", + "ttentry" => "entrée", "ttexit" => "sortie", "tttotal" => "Total", @@ -222,7 +221,7 @@ "strictworktime" => "heures de travail stricte", "totalwork" => "Total travail", "filter" => "filtrer...", - "statementtransfered3" => "trans.", + "statementtransfered3" => "trans.", "supphourspayed2" => "payé", "finalstatementpot2" => "Décompte", "supp44h3" => "+44h", @@ -234,5 +233,7 @@ "datasaved" => "Les données ont été sauvegardées!", "timeperiod" => "période", "viewonlyweeks" => "masquer jours", - "viewdays" => "afficher jours" + "viewdays" => "afficher jours", + "otherhours" => "Autres", + "otherpaidhours" => "autres heures payés" ); ?> \ No newline at end of file diff --git a/app/lib/session.php b/app/lib/session.php index d2b01ed6..4b34a2ba 100644 --- a/app/lib/session.php +++ b/app/lib/session.php @@ -42,7 +42,7 @@ class session { } public function getCompanyConfig($schema){ - $sql = "select timetrackertype,sector,viewpartunempl from public.companies where schemata='".$schema."';"; + $sql = "select timetrackertype,sector from public.companies where schemata='".$schema."';"; return $this->dbh->query($sql); } diff --git a/app/tmpl/block/dlgstaffperioddays.html b/app/tmpl/block/dlgstaffperioddays.html index 2fd6981e..36dd5746 100644 --- a/app/tmpl/block/dlgstaffperioddays.html +++ b/app/tmpl/block/dlgstaffperioddays.html @@ -188,13 +188,13 @@ - + diff --git a/app/tmpl/module/periods/reportperiod.js b/app/tmpl/module/periods/reportperiod.js index 32fd5def..2801b43d 100644 --- a/app/tmpl/module/periods/reportperiod.js +++ b/app/tmpl/module/periods/reportperiod.js @@ -35,11 +35,12 @@ let reportperiod ={ }); //let maincolumns = ; reportperiod.tbl = new Tabulator("#tbl_reportperiod", { - virtualDomHoz:true, + //virtualDomHoz:true, headerFilterPlaceholder:"{{ lbl.filter }}", height: "calc(100vh - 56px)", layout: "fitDataFill", - selectable: 1, + selectable: true, + selectableRangeMode:"click", // rowSelected:function(row){ // console.log("rowselected",row); // if (document.getElementById("pnl_staffperiodweeks").style.cssFloat.display == "block"){ @@ -61,19 +62,26 @@ let reportperiod ={ return value; }, ], + rowContextMenu:[ + {label:" {{ lbl.add }}", action:function(e, row){reportperiod.add();return false;}}, + {label:"{{ lbl.edit }}", action:function(e, row){reportperiod.editplan();return false;}}, + {label:"{{ lbl.pdf }}", action:function(e, row){reportperiod.generatereport();return false;}}, + /*{% if session.usergroup == 'admin' %}*/ + {label:"{{ lbl.finalstatement }}", action:function(e, row){periodvalidation.showdlg();return false;}} + /*{% endif %}*/ + + ], columns: [ {title: "{{ lbl.department }}",field:"groupname" , visible: false}, {title: '{{ lbl.prename }}',headerFilter:"input",width: 170, field:"prename",headerSort: false}, {title: '{{ lbl.name }}',headerFilter:"input",width: 170, field:"surname",headerSort: false}, {title: '{{ lbl.contract }}',width: 70, field:"contracthours",hozAlign:"right",headerSort: false}, - {title: '{{ lbl.work }}',width: 65, field:"workhours",hozAlig:"right",headerSort: false}, + {title: '{{ lbl.work }}',width: 65, field:"workhours",hozAlign:"right",headerSort: false}, {title: '{{ lbl.recuperation_short }}',width: 65, field:"recuperationhours",hozAlign:"right",headerSort: false,formatter:periodRecupFormatter}, {title: '{{ lbl.vacancy }}',width: 65, field:"vacancynormal",hozAlign:"right",headerSort: false}, {title: '{{ lbl.vacancyill2 }}',width:65, field:"vacancyill",hozAlign:"right",headerSort: false}, {title: '{{ lbl.vacancyextra2 }}',width:65, field:"vacancyextra",hozAlign:"right",headerSort: false}, - //{% if (cmpcfg.viewpartunempl == '1') %} - {title: '{{ lbl.partunempl2 }}',width: 65, field:"partunemplhours",hozAlign:"right",headerSort: false}, - //{% endif %} + {title: '{{ lbl.otherhours }}',width: 65, field:"otherpaidhours",hozAlign:"right",headerSort: false}, {title: '{{ lbl.total }}',width: 65, field:"totalhours",hozAlign:"right",headerSort: false,formatter:periodTotalFormatter}, {title: '{{ lbl.statementtransfered2 }}',width: 70, field:"transferedhours",hozAlign:"right",headerSort: false}, {title: '{{ lbl.supphourspayed2 }}',width: 65, field:"payedhours",hozAlign:"right",headerSort: false,headerVertical:true} , @@ -81,7 +89,8 @@ let reportperiod ={ {title: '{{ lbl.supp44h2 }}',width: 50, field:"suppvacancy44hours",hozAlign:"right",headerSort: false,headerVertical:true}, {title: '{{ lbl.suppsunwork }}',width: 50, field:"suppvacancysunwork",hozAlign:"right",headerSort: false,headerVertical:true}, {title: '{{ lbl.avgweek_short }}',width: 60, field:"avgtotalweekhours",hozAlign:"right",headerSort: false,formatter:periodAVGFormatter}, - {title: '{{ lbl.validated }}',width: 40, field:"isvalidated",hozAlign:"center",headerSort: false,formatter:"tickCross", formatterParams:{allowEmpty:true,allowTruthy: false},headerVertical:true} + {title: '{{ lbl.validated }}',width: 40, field:"isvalidated",hozAlign:"center",headerSort: false,formatter:"tickCross", formatterParams:{allowEmpty:true,allowTruthy: false},headerVertical:true}, + // {title: '{{ lbl.maxdays }}',width: 60, field:"maxdays",hozAlign:"center",headerSort: false} ] }); diff --git a/app/tmpl/module/periods/staffperiodweeks.js b/app/tmpl/module/periods/staffperiodweeks.js index 85adc890..5e471519 100644 --- a/app/tmpl/module/periods/staffperiodweeks.js +++ b/app/tmpl/module/periods/staffperiodweeks.js @@ -48,6 +48,15 @@ let staffperiodweeks = { staffperiodweeks.edit(); }, rowContext:function(e, row){e.preventDefault();}, + rowContextMenu:[ + {label:'{{ lbl.edit }}', action:function(e, row){}}, + {label:'{{ lbl.copy }}', action:function(e, row){}}, + {label:'{{ lbl.paste }}', action:function(e, row){}}, + {label:'{{ lbl.clean }}', action:function(e, row){}}, + {label:'{{ lbl.changetemplate }}', action:function(e, row){}}, + {label:'{{ lbl.viewonlyweeks }}', action:function(e, row){}}, + {label:'{{ lbl.viewdays }}', action:function(e, row){}}, + ], groupBy:["weekstart"], groupStartOpen:[true], groupClosedShowCalcs:true, @@ -69,9 +78,7 @@ let staffperiodweeks = { { title: "Coup.",field: "interruptionhours",headerSort:false,hozAlign:"center",formatter:interruptFormatter}, { title: "{{ lbl.vacancy }}",field: "dspvacancyhours",headerSort: false,hozAlign:"center",formatter:vacancyformatter,bottomCalc:staffperiodweeks.setweekvacancyhours}, { title: "{{ lbl.recuperation_short }}",field: "recuperationhours",hozAlign:"center",headerSort: false,formatter:recupformatter,bottomCalc:staffperiodweeks.setweekrecuperationhours}, - //{% if (cmpcfg.viewpartunempl == '1') %} - { title: "{{ lbl.partunempl2 }}",field:"partunemplhours",hozAlign:"center",headerSort: false}, - //{% endif %} + { title: "{{ lbl.otherhours }}",field:"otherpaidhours",hozAlign:"center",headerSort: false}, { title: "{{ lbl.total|raw }}",field: "dayhours",hozAlign:"center",headerSort: false,formatter:totalFormatter,bottomCalc:staffperiodweeks.setweektotalhours,bottomCalcFormatter:"html"}, { title: "{{ lbl.diffcontract|raw }}",field:"diffhours",hozAlign:"center",formatter:nullFormatter,headerSort:false,bottomCalc:staffperiodweeks.setweekdiffhours}, { title: "{{ lbl.avgweek_short }}",field: "avgweekhours",hozAlign:"center",headerSort: false,formatter:nullFormatter,bottomCalc:staffperiodweeks.setavgweekhours}, @@ -221,19 +228,19 @@ let staffperiodweeks = { } return ""; }, - setweekunemplhours: function(values, data, calcParams){ - if (staffperiodweeks.weekdata && staffperiodweeks.weekdata[data[0].weekstart]) { - //var maxcolor =""; - // if (staffperiodweeks.weekdata[data[0].weekstart].totalhours > staffperiodweeks.weekdata[data[0].weekstart].defaultweekhours){ - // maxcolor = "color: orange;"; - // } - // if (staffperiodweeks.weekdata[data[0].weekstart].totalhours > staffperiodweeks.weekdata[data[0].weekstart].maxweekhours){ - // maxcolor = "color: red;"; - // } - return '' + staffperiodweeks.weekdata[data[0].weekstart].partunemplhours + ''; - } - return ""; - }, + // setweekunemplhours: function(values, data, calcParams){ + // if (staffperiodweeks.weekdata && staffperiodweeks.weekdata[data[0].weekstart]) { + // //var maxcolor =""; + // // if (staffperiodweeks.weekdata[data[0].weekstart].totalhours > staffperiodweeks.weekdata[data[0].weekstart].defaultweekhours){ + // // maxcolor = "color: orange;"; + // // } + // // if (staffperiodweeks.weekdata[data[0].weekstart].totalhours > staffperiodweeks.weekdata[data[0].weekstart].maxweekhours){ + // // maxcolor = "color: red;"; + // // } + // return '' + staffperiodweeks.weekdata[data[0].weekstart].otherpaidhours + ''; + // } + // return ""; + // }, settotaltrackhours: function(values, data, calcParams){ let mts = 0; for (let m in values){ @@ -272,7 +279,7 @@ let staffperiodweeks = { // document.getElementById("vacextracomment").value=''; // document.getElementById("recupcomment").value=''; // document.getElementById("partunempcomment").value=''; - + console.log("CDAY",staffperiodweeks.currentday); dataform.fillformbydataclass2("staffreportperioddays",staffperiodweeks.choices,staffperiodweeks.currentday); document.getElementById("display_date").innerHTML=moment(staffperiodweeks.currentday.daydate).format("dddd , DD.MM.YYYY"); //document.getElementById("display_staffname").innerHTML=selrp[0].staffname; @@ -497,7 +504,7 @@ let staffperiodweeks = { let ovach = document.getElementById("vacancyhours"); let ovill = document.getElementById("vacillhours"); let ovextra = document.getElementById("vacextrahours"); - let opartunempl = document.getElementById("partunemplhours"); + let ootherhours = document.getElementById("otherpaidhours"); let orech = document.getElementById("recuperationhours"); let odyh =document.getElementById("dayhours"); let oirupt = document.getElementById("interruptionhours"); @@ -505,7 +512,7 @@ let staffperiodweeks = { if (ovach.value){ vactime = timecalc.TimeToMinutes(ovach.value);} if (ovill.value){villtime = timecalc.TimeToMinutes(ovill.value);} if (ovextra.value){vextratime = timecalc.TimeToMinutes(ovextra.value);} - if (opartunempl.value){unempltime = timecalc.TimeToMinutes(opartunempl.value);} + if (ootherhours.value){unempltime = timecalc.TimeToMinutes(ootherhours.value);} if (orech.value){reptime = timecalc.TimeToMinutes(orech.value);} let fulldaytime = wktime+vactime+reptime+villtime+vextratime+unempltime; odyh.value= timecalc.MinutesToTime(fulldaytime); @@ -722,7 +729,7 @@ let worktimeFormatter = function(cell, formatterParams){ cell.getElement().style.fontSize="10pt";return cell.getValue(); } else if (cell._cell.row.data.dayhours == null){ - return "jour de repos"; + return "{{lbl.freeday}}"; } return cell.getValue(); }; diff --git a/app/tmpl/module/staff/staffperiods.js b/app/tmpl/module/staff/staffperiods.js index 31439e71..835db6bc 100644 --- a/app/tmpl/module/staff/staffperiods.js +++ b/app/tmpl/module/staff/staffperiods.js @@ -28,9 +28,7 @@ let staffperiods = { {title: '{{ lbl.vacancy }}', field:"vacancynormal",hozAlign:"right",headerSort: false}, {title: '{{ lbl.vacancyill2 }}', field:"vacancyill",hozAlign:"right",headerSort: false}, {title: '{{ lbl.vacancyextra2 }}',width:65, field:"vacancyextra",hozAlign:"right",headerSort: false}, - //{% if (cmpcfg.viewpartunempl == '1') %} - {title: '{{ lbl.partunempl2 }}',width: 65, field:"partunemplhours",hozAlign:"right",headerSort: false}, - //{% endif %} + {title: '{{ lbl.otherhours }}',width: 65, field:"otherpaidhours",hozAlign:"right",headerSort: false}, {title: '{{ lbl.total }}', field:"totalhours",hozAlign:"right",headerSort: false,formatter:periodTotalFormatter}, {title: '{{ lbl.statementtransfered2 }}', field:"transferedhours",hozAlign:"right",headerSort: false}, {title: '{{ lbl.supphourspayed2 }}', field:"payedhours",hozAlign:"right",headerSort: false,headerVertical:true} ,
Résumée période de référence: ".$data["dspstartdate"]." - ".$data["dspenddate"]."
heures contractuelles:
heures travaillées:
heures contractuelles:
heures travaillées:
".$data["contracthours"]."
".$data["workhours"]."
congé maladie:
congé:
congé except.:
congé maladie:
congé:
congé except.:
".(($data["vacancyill"] != '')?$data["vacancyill"] :"00:00")."
".(($data["vacancynormal"] != '')?$data["vacancynormal"] :"00:00")."
".(($data["vacancyextra"] != '')?$data["vacancyextra"] :"00:00")."
heures
récupérées:
heures
récupérées:
".$data["recuperationhours"]."
 
durée travail
réel prestée:
durée travail
réel prestée:
".$data["totalhours"]."moyenne durée
travail réel:
moyenne durée
travail réel:
".$data["avgtotalweekhours"]."décompte reporté:
heures payées:
décompte reporté:
heures payées:
".(($data["transferedhourscalc"] != '')?$data["transferedhourscalc"]:"00:00")."
".(($data["payedhours"] != '')?$data["payedhours"]:"00:00")."
décompte
fin POT:
décompte
fin POT:
".$data["hoursdiff"]."congé suppl. +44h:
congé suppl. dimache travaillé:
congé suppl. +44h:
congé suppl. dimache travaillé:
".(($data["suppvacancy44hours"] != '')?$data["suppvacancy44hours"]:" ")."
".(($data["suppvacancysunwork"] != '')?$data["suppvacancysunwork"]:" ")."
{{ lbl.partunempl }}{{ lbl.otherpaidhours }} - + - - + +