Compare commits
3 Commits
3d53772947
...
ed91a16b2b
Author | SHA1 | Date |
---|---|---|
afornerot | ed91a16b2b | |
afornerot | 2878f31113 | |
afornerot | 28dea4bb81 |
|
@ -137,6 +137,8 @@ class TallydayController extends AbstractController
|
||||||
$users = $em->getRepository("App:User")->findBy([],["firstname"=>"ASC","lastname"=>"ASC"]);
|
$users = $em->getRepository("App:User")->findBy([],["firstname"=>"ASC","lastname"=>"ASC"]);
|
||||||
foreach($users as $user) {
|
foreach($users as $user) {
|
||||||
if($user->hasRole("ROLE_USER")) {
|
if($user->hasRole("ROLE_USER")) {
|
||||||
|
|
||||||
|
|
||||||
$dates[$user->getId()] = [
|
$dates[$user->getId()] = [
|
||||||
"id"=>$user->getId(),
|
"id"=>$user->getId(),
|
||||||
"avatar"=>$user->getAvatar(),
|
"avatar"=>$user->getAvatar(),
|
||||||
|
|
|
@ -65,17 +65,20 @@ class TallydayRepository extends ServiceEntityRepository
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCapitaltimeinterval($user,$getnovalidate=false) {
|
public function getCapitaltimeinterval($user,$getnovalidate=false) {
|
||||||
$datenow=new \DateTime('00:00');
|
|
||||||
$datas = $this->_em->getRepository('App:Tallyday')->findBy(["user"=>$user],["datestart"=>"DESC"]);
|
$datas = $this->_em->getRepository('App:Tallyday')->findBy(["user"=>$user],["datestart"=>"DESC"]);
|
||||||
$tbdays=[];
|
$tbdays=[];
|
||||||
$ework = new \DateTime('00:00');
|
|
||||||
|
|
||||||
|
// Cumuler les temps de travail sans fuseau
|
||||||
|
$datenow=new \DateTime('00:00');
|
||||||
|
$ework = new \DateTime('00:00', new \DateTimeZone('UTC'));
|
||||||
|
$i=0;
|
||||||
foreach($datas as $data) {
|
foreach($datas as $data) {
|
||||||
if($data->getDateof()<$datenow) {
|
if($data->getDateof()<$datenow) {
|
||||||
$iddayweek=$data->getDateof()->format("w");
|
$iddayweek=$data->getDateof()->format("w");
|
||||||
if($iddayweek>=1&&$iddayweek<=5) {
|
if($iddayweek>=1&&$iddayweek<=5) {
|
||||||
if(!in_array($data->getDateof(),$tbdays)) array_push($tbdays,$data->getDateof());
|
if(!in_array($data->getDateof(),$tbdays)) array_push($tbdays,$data->getDateof());
|
||||||
}
|
}
|
||||||
|
|
||||||
$ework->add($data->getTimeday());
|
$ework->add($data->getTimeday());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,10 +87,11 @@ class TallydayRepository extends ServiceEntityRepository
|
||||||
if($iddayweek>=1&&$iddayweek<=5) {
|
if($iddayweek>=1&&$iddayweek<=5) {
|
||||||
if(!in_array($data->getDateof(),$tbdays)) array_push($tbdays,$data->getDateof());
|
if(!in_array($data->getDateof(),$tbdays)) array_push($tbdays,$data->getDateof());
|
||||||
}
|
}
|
||||||
|
|
||||||
$ework->add($data->getTimeday());
|
$ework->add($data->getTimeday());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enlever du temps travailler les heures sup payé
|
// Enlever du temps travailler les heures sup payé
|
||||||
$timeextra=$this->_em->getRepository("App:Timeextra")->getTimeextrauser($user, new \DateTime());
|
$timeextra=$this->_em->getRepository("App:Timeextra")->getTimeextrauser($user, new \DateTime());
|
||||||
if($timeextra[1]) {
|
if($timeextra[1]) {
|
||||||
|
@ -96,7 +100,8 @@ class TallydayRepository extends ServiceEntityRepository
|
||||||
|
|
||||||
// Nbday worked
|
// Nbday worked
|
||||||
$nbdaywork=count($tbdays);
|
$nbdaywork=count($tbdays);
|
||||||
$etowork = new \DateTime('00:00');
|
|
||||||
|
$etowork = new \DateTime('00:00', new \DateTimeZone('UTC'));
|
||||||
$etowork->add(new \DateInterval("PT".($nbdaywork*7)."H"));
|
$etowork->add(new \DateInterval("PT".($nbdaywork*7)."H"));
|
||||||
|
|
||||||
$interval = $etowork->diff($ework);
|
$interval = $etowork->diff($ework);
|
||||||
|
|
|
@ -115,13 +115,14 @@ td {
|
||||||
{{validate.dateof|date("W")}}
|
{{validate.dateof|date("W")}}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
{% if loop.first %}
|
|
||||||
{% for i in 2..(validate.dateof|date("N")) %}
|
|
||||||
<td></td>
|
|
||||||
{% endfor %}
|
|
||||||
{%endif %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if loop.first and validate.dateof|date("l")!="Monday"%}
|
||||||
|
{% for i in 2..(validate.dateof|date("N")) %}
|
||||||
|
<td></td>
|
||||||
|
{% endfor %}
|
||||||
|
{%endif %}
|
||||||
|
|
||||||
<td style="align:top">
|
<td style="align:top">
|
||||||
<div class="date">{{validate.dateof|date("d/m")}}</div>
|
<div class="date">{{validate.dateof|date("d/m")}}</div>
|
||||||
<div class="datedetail" style="min-height:28px">
|
<div class="datedetail" style="min-height:28px">
|
||||||
|
|
Loading…
Reference in New Issue