Compare commits
No commits in common. "ed91a16b2b597dbcc28bb983160c6eca975ce973" and "3d53772947c4a7909ac2027fed01f997cf1f3fdf" have entirely different histories.
ed91a16b2b
...
3d53772947
|
@ -137,8 +137,6 @@ class TallydayController extends AbstractController
|
|||
$users = $em->getRepository("App:User")->findBy([],["firstname"=>"ASC","lastname"=>"ASC"]);
|
||||
foreach($users as $user) {
|
||||
if($user->hasRole("ROLE_USER")) {
|
||||
|
||||
|
||||
$dates[$user->getId()] = [
|
||||
"id"=>$user->getId(),
|
||||
"avatar"=>$user->getAvatar(),
|
||||
|
|
|
@ -65,20 +65,17 @@ class TallydayRepository extends ServiceEntityRepository
|
|||
}
|
||||
|
||||
public function getCapitaltimeinterval($user,$getnovalidate=false) {
|
||||
$datenow=new \DateTime('00:00');
|
||||
$datas = $this->_em->getRepository('App:Tallyday')->findBy(["user"=>$user],["datestart"=>"DESC"]);
|
||||
$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) {
|
||||
if($data->getDateof()<$datenow) {
|
||||
$iddayweek=$data->getDateof()->format("w");
|
||||
if($iddayweek>=1&&$iddayweek<=5) {
|
||||
if(!in_array($data->getDateof(),$tbdays)) array_push($tbdays,$data->getDateof());
|
||||
}
|
||||
|
||||
$ework->add($data->getTimeday());
|
||||
}
|
||||
|
||||
|
@ -87,7 +84,6 @@ class TallydayRepository extends ServiceEntityRepository
|
|||
if($iddayweek>=1&&$iddayweek<=5) {
|
||||
if(!in_array($data->getDateof(),$tbdays)) array_push($tbdays,$data->getDateof());
|
||||
}
|
||||
|
||||
$ework->add($data->getTimeday());
|
||||
}
|
||||
}
|
||||
|
@ -100,8 +96,7 @@ class TallydayRepository extends ServiceEntityRepository
|
|||
|
||||
// Nbday worked
|
||||
$nbdaywork=count($tbdays);
|
||||
|
||||
$etowork = new \DateTime('00:00', new \DateTimeZone('UTC'));
|
||||
$etowork = new \DateTime('00:00');
|
||||
$etowork->add(new \DateInterval("PT".($nbdaywork*7)."H"));
|
||||
|
||||
$interval = $etowork->diff($ework);
|
||||
|
|
|
@ -115,14 +115,13 @@ td {
|
|||
{{validate.dateof|date("W")}}
|
||||
</td>
|
||||
|
||||
{% if loop.first %}
|
||||
{% for i in 2..(validate.dateof|date("N")) %}
|
||||
<td></td>
|
||||
{% endfor %}
|
||||
{%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">
|
||||
<div class="date">{{validate.dateof|date("d/m")}}</div>
|
||||
<div class="datedetail" style="min-height:28px">
|
||||
|
|
Loading…
Reference in New Issue