10 Commits

5 changed files with 69 additions and 36 deletions

View File

@ -146,6 +146,9 @@ class BreakdayCommand extends Command
$data->setIsbreakday(true); $data->setIsbreakday(true);
$data->setName($event->taskname); $data->setName($event->taskname);
$data->setDatestart(clone $manip); $data->setDatestart(clone $manip);
$data->setIstelework(false);
$data->setIspenaltypassive(false);
$data->setIspenaltyactive(false);
$manip->add(new \DateInterval("PT7H")); $manip->add(new \DateInterval("PT7H"));
$data->setDateend(clone $manip); $data->setDateend(clone $manip);
@ -194,6 +197,9 @@ class BreakdayCommand extends Command
$data->setIsbreakday(true); $data->setIsbreakday(true);
$data->setName("AM = ".$event->taskname); $data->setName("AM = ".$event->taskname);
$data->setDatestart(clone $manip); $data->setDatestart(clone $manip);
$data->setIstelework(false);
$data->setIspenaltypassive(false);
$data->setIspenaltyactive(false);
$manip->add(new \DateInterval("PT3H")); $manip->add(new \DateInterval("PT3H"));
$manip->add(new \DateInterval("PT30M")); $manip->add(new \DateInterval("PT30M"));
@ -242,6 +248,9 @@ class BreakdayCommand extends Command
$data->setIsbreakday(true); $data->setIsbreakday(true);
$data->setName("PM = ".$event->taskname); $data->setName("PM = ".$event->taskname);
$data->setDatestart(clone $manip); $data->setDatestart(clone $manip);
$data->setIstelework(false);
$data->setIspenaltypassive(false);
$data->setIspenaltyactive(false);
$manip->add(new \DateInterval("PT3H")); $manip->add(new \DateInterval("PT3H"));
$manip->add(new \DateInterval("PT30M")); $manip->add(new \DateInterval("PT30M"));

View File

@ -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(),

View File

@ -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,6 +87,7 @@ 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());
} }
} }
@ -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);

View File

@ -19,13 +19,21 @@ td {
{% if fgprint %}color:#000000 !important;{%endif%} {% if fgprint %}color:#000000 !important;{%endif%}
} }
{% if fgprint %} @media print {
.noprint { display:none; }
body,h1,.card-header {font-family: 'arial' !important}
.card {float: none !important; } .card {float: none !important; }
.card, .card-header {border: none;} .card, .card-header {border: none;}
.breakpage { .breakpage {
page-break-after: always; page-break-after: always;
} }
{% endif %} .nobreakpage{
page-break-after: unset;
}
.card-body {padding:0px;}
.fulltable{width:100%;}
}
.date { .date {
color: #ffffff; color: #ffffff;
@ -43,11 +51,14 @@ td {
RAPPORT MENSUEL = {{ monthof|date("m/Y") }} RAPPORT MENSUEL = {{ monthof|date("m/Y") }}
</h1> </h1>
<div class="noprint">
{% if not fgprint %} {% if not fgprint %}
<a class="btn btn-secondary mr-2" href={{ path('app_tallyday') }}>Retour</a> <a class="btn btn-secondary mr-2" href={{ path('app_tallyday') }}>Retour</a>
<a class="btn btn-secondary mr-2" href={{ path('app_tallyday_mastermonth',{monthof:prevmonth}) }}>Mois Précédent</a> <a class="btn btn-secondary mr-2" href={{ path('app_tallyday_mastermonth',{monthof:prevmonth}) }}>Mois Précédent</a>
<a class="btn btn-secondary mr-2" href={{ path('app_tallyday_mastermonth',{monthof:nextmonth}) }}>Mois Suivant</a> <a class="btn btn-secondary mr-2" href={{ path('app_tallyday_mastermonth',{monthof:nextmonth}) }}>Mois Suivant</a>
<a class="btn btn-secondary mr-2" href={{ path('app_tallyday_mastermonth',{monthof:monthof|date("Ym"),type:"pdf"}) }}>Export PDF</a> <!-- <a class="btn btn-secondary mr-2" href={{ path('app_tallyday_mastermonth',{monthof:monthof|date("Ym"),type:"pdf"}) }}>Export PDF</a> -->
<a id="btnprint" class="btn btn-secondary mr-2" href="#">Imprimer</a>
<a class="btn btn-secondary float-right" href={{ path('app_tallyday_masterexport') }}>Export CSV</a> <a class="btn btn-secondary float-right" href={{ path('app_tallyday_masterexport') }}>Export CSV</a>
<a class="btn btn-secondary float-right mr-2" href={{ path('app_tallyday_masterlist') }}>Gestion des Pointages</a> <a class="btn btn-secondary float-right mr-2" href={{ path('app_tallyday_masterlist') }}>Gestion des Pointages</a>
@ -59,7 +70,7 @@ td {
</div> </div>
{% endif %} {% endif %}
{% endif %} {% endif %}
</div>
<div class="mt-3" style="margin:auto; max-width:1810px;"> <div class="mt-3" style="margin:auto; max-width:1810px;">
{% set nbusers=0 %} {% set nbusers=0 %}
@ -67,16 +78,16 @@ td {
{% if date.validates %} {% if date.validates %}
{% set nbusers=nbusers+1 %} {% set nbusers=nbusers+1 %}
<div class="card mr-1 mb-1 float-left {% if nbusers==2 %}breakpage{% endif %} "> <div class="card mr-1 mb-1 float-left {% if nbusers==2 %}breakpage{%else%}nobreakpage{% endif %} ">
<div class="card-header"> <div class="card-header">
<img src="{{date.avatar|urlavatar}}" class="avatar"> {{ date.displayname }} {% if not fgprint %} <img src="{{date.avatar|urlavatar}}" class="avatar noprint">{%endif%} {{ date.displayname }}
<div class="float-right text-right"> <div class="float-right text-right">
{{date.timemonth}} / {{ timetowork }} {{date.timemonth}} / {{ timetowork }}
</div> </div>
</div> </div>
<div class="card-body"> <div class="card-body">
<table> <table class="fulltable">
<thead> <thead>
<tr> <tr>
<th style="width:50px !important">s</th> <th style="width:50px !important">s</th>
@ -104,12 +115,13 @@ td {
{{validate.dateof|date("W")}} {{validate.dateof|date("W")}}
</td> </td>
{% if loop.first %} {% endif %}
{% if loop.first and validate.dateof|date("l")!="Monday"%}
{% for i in 2..(validate.dateof|date("N")) %} {% for i in 2..(validate.dateof|date("N")) %}
<td></td> <td></td>
{% endfor %} {% endfor %}
{%endif %} {%endif %}
{% 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>
@ -201,6 +213,11 @@ td {
maxheight=$(this).height(); maxheight=$(this).height();
}); });
$( ".card" ).height(maxheight); $( ".card" ).height(maxheight);
$("#btnprint").click(function(){
window.print();
return false;
});
}); });
{% endblock %} {% endblock %}

View File

@ -139,7 +139,7 @@
</div> </div>
{% if not isvalideuser and not isvalidemaster %} {% if not isvalideuser and not isvalidemaster %}
<div style="width:380px; text-align:left"> <div style="width:300px; text-align:left">
<div class="custom-control custom-switch" style="zoom:130%"> <div class="custom-control custom-switch" style="zoom:130%">
<input type="checkbox" class="custom-control-input" id="istelework" {%if istelework%}checked{%endif%}> <input type="checkbox" class="custom-control-input" id="istelework" {%if istelework%}checked{%endif%}>
<label class="custom-control-label" for="istelework">Télétravail</label> <label class="custom-control-label" for="istelework">Télétravail</label>
@ -156,20 +156,20 @@
</div> </div>
</div> </div>
<a href="{{path("app_tallyday_uservalidate",{dateof:"now"|date("Y-m-d")})}}" class="btn btn-danger mt-3" style="width:380px" data-method="confirm" data-confirm="Êtes-vous sûr de vouloir valider votre journée ?">Valider ma journée</a> <a href="{{path("app_tallyday_uservalidate",{dateof:"now"|date("Y-m-d")})}}" class="btn btn-danger mt-3" style="width:300px" data-method="confirm" data-confirm="Êtes-vous sûr de vouloir valider votre journée ?">Valider ma journée</a>
<br> <br>
{% endif %} {% endif %}
<a href="{{path("app_tallyday_userlist")}}" class="btn btn-secondary mt-3" style="width:380px">Gérer mes Pointages</a> <a href="{{path("app_tallyday_userlist")}}" class="btn btn-secondary mt-3" style="width:300px">Gérer mes Pointages</a>
{% if isvalideuser and not isvalidemaster %} {% if isvalideuser and not isvalidemaster %}
<br><a href="{{path("app_tallyday_userdevalidate",{dateof:"now"|date("Y-m-d")})}}" class="btn btn-warning mt-3" style="width:380px">Dévalider ma journée</a> <br><a href="{{path("app_tallyday_userdevalidate",{dateof:"now"|date("Y-m-d")})}}" class="btn btn-warning mt-3" style="width:300px">Dévalider ma journée</a>
{% endif %} {% endif %}
{% if is_granted('ROLE_MASTER') %} {% if is_granted('ROLE_MASTER') %}
<hr class="mt-5" style="width: 300px; background-color:var(--colorbgbodylight);"> <hr class="mt-5" style="width: 300px; background-color:var(--colorbgbodylight);">
<h3>GESTION</h3> <h3>GESTION</h3>
<a href="{{path("app_tallyday_masterlist")}}" class="btn btn-success mt-3 mb-3" style="width:380px">Gestion des Pointages</a> <a href="{{path("app_tallyday_masterlist")}}" class="btn btn-success mt-3 mb-3" style="width:300px">Gestion des Pointages</a>
{% endif %} {% endif %}