Compare commits
11 Commits
pkg/stable
...
master
Author | SHA1 | Date |
---|---|---|
afornerot | 0390c3b474 | |
afornerot | 50188f1851 | |
afornerot | eabb7067a7 | |
afornerot | 58b4d24098 | |
afornerot | 3ee638a857 | |
afornerot | ed91a16b2b | |
afornerot | 2878f31113 | |
afornerot | 28dea4bb81 | |
afornerot | 3d53772947 | |
afornerot | dfc348e650 | |
afornerot | 5fad26f3b6 |
|
@ -68,7 +68,10 @@
|
|||
"preferred-install": {
|
||||
"*": "dist"
|
||||
},
|
||||
"sort-packages": true
|
||||
"sort-packages": true,
|
||||
"allow-plugins": {
|
||||
"symfony/flex": true
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
@ -89,6 +92,9 @@
|
|||
"symfony/polyfill-php56": "*"
|
||||
},
|
||||
"scripts": {
|
||||
"pre-install-cmd": [
|
||||
"php scripts/checkcomposer.php"
|
||||
],
|
||||
"auto-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"cache:clear --env=prod": "symfony-cmd",
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
$requiredVersion = 'version 1'; // La version interdite
|
||||
|
||||
$composerVersion = trim(shell_exec('COMPOSER_ALLOW_SUPERUSER=1 composer --version --no-ansi'));
|
||||
echo $composerVersion."\n";
|
||||
|
||||
if (stripos($composerVersion,$requiredVersion)===false ) {
|
||||
echo "La version de Composer $requiredVersion n'est pas autorisée" . PHP_EOL;
|
||||
echo "Veuillez mettre à jour Composer avec 'composer self-update --1'." . PHP_EOL;
|
||||
echo "Ou executez le scripts/reconfigure.sh" . PHP_EOL;
|
||||
exit(1); // Quitte avec un code d'erreur
|
||||
}
|
|
@ -28,6 +28,8 @@ fi
|
|||
|
||||
# Installation des dépendances composer
|
||||
echo COMPOSER = Install
|
||||
export COMPOSER_ALLOW_SUPERUSER=1
|
||||
composer self-update --1 --quiet
|
||||
composer install --quiet
|
||||
|
||||
php bin/console app:AppInit --env=prod
|
||||
|
|
|
@ -83,21 +83,36 @@ class BreakdayCommand extends Command
|
|||
foreach($users as $user) {
|
||||
if(!$user->hasRole("ROLE_USER")) continue;
|
||||
|
||||
$mini=new \Datetime('2022-03-07 00:00');
|
||||
$start=new \Datetime('00:00');
|
||||
$start->modify("monday this week");
|
||||
$this->writeln("");
|
||||
$this->writeln($user->getUsername());
|
||||
|
||||
$start=new \Datetime('2022-03-07 00:00');
|
||||
$end=new \Datetime('00:00');
|
||||
$end->modify("last day of this month");
|
||||
$end->modify("next sunday");
|
||||
$start->modify("previous month");
|
||||
if($start<$mini) $start=clone $mini;
|
||||
|
||||
// On récupère la première journée de pointage de l'utilisateur
|
||||
$qb = $this->em->createQueryBuilder()
|
||||
->select('tallyday')
|
||||
->from('App:Tallyday','tallyday')
|
||||
->Where('tallyday.user=:user')
|
||||
->setParameter('user',$user)
|
||||
->orderBy('tallyday.dateof', 'ASC')
|
||||
->setMaxResults(1);
|
||||
|
||||
$datas = $qb->getQuery()->getResult();
|
||||
if(empty($datas)) continue;
|
||||
$firstday=$datas[0]->getDateof();
|
||||
$this->writeln("FIRST DAY = ".$firstday->format("d/m/Y"));
|
||||
|
||||
$response=$this->api("POST",$url."/getBreakdays",json_encode(["key"=>$key,"username"=>$user->getUsername()]));
|
||||
|
||||
if($response&&$response->code=="200") {
|
||||
while($start<=$end) {
|
||||
$havebreakday=false;
|
||||
if($start->format("w")!=0&&$start->format("w")!=6) {
|
||||
$havebreakdayAM=false;
|
||||
$havebreakdayPM=false;
|
||||
|
||||
if($start->format("w")!=0&&$start->format("w")!=6&&$start>=$firstday) {
|
||||
foreach($response->body->events as $event) {
|
||||
if($event->eventallday) {
|
||||
$manip=clone $start;
|
||||
|
@ -146,7 +161,10 @@ class BreakdayCommand extends Command
|
|||
$data->setIsbreakday(true);
|
||||
$data->setName($event->taskname);
|
||||
$data->setDatestart(clone $manip);
|
||||
|
||||
$data->setIstelework(false);
|
||||
$data->setIspenaltypassive(false);
|
||||
$data->setIspenaltyactive(false);
|
||||
|
||||
$manip->add(new \DateInterval("PT7H"));
|
||||
$data->setDateend(clone $manip);
|
||||
$this->em->persist($data);
|
||||
|
@ -194,6 +212,9 @@ class BreakdayCommand extends Command
|
|||
$data->setIsbreakday(true);
|
||||
$data->setName("AM = ".$event->taskname);
|
||||
$data->setDatestart(clone $manip);
|
||||
$data->setIstelework(false);
|
||||
$data->setIspenaltypassive(false);
|
||||
$data->setIspenaltyactive(false);
|
||||
|
||||
$manip->add(new \DateInterval("PT3H"));
|
||||
$manip->add(new \DateInterval("PT30M"));
|
||||
|
@ -203,6 +224,7 @@ class BreakdayCommand extends Command
|
|||
}
|
||||
|
||||
$havebreakday=true;
|
||||
$havebreakdayAM=true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -241,8 +263,11 @@ class BreakdayCommand extends Command
|
|||
$data->setValidatemaster(false);
|
||||
$data->setIsbreakday(true);
|
||||
$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("PT30M"));
|
||||
$data->setDateend(clone $manip);
|
||||
|
@ -251,6 +276,7 @@ class BreakdayCommand extends Command
|
|||
}
|
||||
|
||||
$havebreakday=true;
|
||||
$havebreakdayPM=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -266,6 +292,31 @@ class BreakdayCommand extends Command
|
|||
$this->em->flush();
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Si congés matin mais par l'après midi on supprime un congés potentiel de l'aprés midi
|
||||
if($havebreakdayAM && !$havebreakdayPM) {
|
||||
$manip=clone $start;
|
||||
$manip->setTime(13,30);
|
||||
$tallydays=$this->em->getRepository("App:Tallyday")->findBy(["user"=>$user,"dateof"=>$start,"datestart"=>$manip,"validatemaster"=>false,"isbreakday"=>true]);
|
||||
foreach($tallydays as $tallyday) {
|
||||
$this->em->remove($tallyday);
|
||||
$this->em->flush();
|
||||
}
|
||||
}
|
||||
|
||||
// Si congés aprèsmidi mais pas le matin on supprime un congés potentiel du matin
|
||||
if(!$havebreakdayAM && $havebreakdayPM) {
|
||||
$manip=clone $start;
|
||||
$manip->setTime(8,30);
|
||||
$tallydays=$this->em->getRepository("App:Tallyday")->findBy(["user"=>$user,"dateof"=>$start,"datestart"=>$manip,"validatemaster"=>false,"isbreakday"=>true]);
|
||||
foreach($tallydays as $tallyday) {
|
||||
|
||||
$this->em->remove($tallyday);
|
||||
$this->em->flush();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$start->add(new \DateInterval('P1D'));
|
||||
}
|
||||
|
|
|
@ -137,6 +137,8 @@ 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(),
|
||||
|
|
|
@ -37,7 +37,7 @@ class TimeextraType extends AbstractType
|
|||
|
||||
$builder->add('hour',
|
||||
IntegerType::class, [
|
||||
"label" => "Nombre d'Heure",
|
||||
"label" => "Nombre de Minutes",
|
||||
"required" => true,
|
||||
]
|
||||
);
|
||||
|
|
|
@ -65,17 +65,20 @@ 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());
|
||||
}
|
||||
|
||||
|
@ -84,19 +87,21 @@ class TallydayRepository extends ServiceEntityRepository
|
|||
if($iddayweek>=1&&$iddayweek<=5) {
|
||||
if(!in_array($data->getDateof(),$tbdays)) array_push($tbdays,$data->getDateof());
|
||||
}
|
||||
|
||||
$ework->add($data->getTimeday());
|
||||
}
|
||||
}
|
||||
|
||||
// Enlever du temps travailler les heures sup payé
|
||||
|
||||
// Enlever du temps travailler les minutes sup payé
|
||||
$timeextra=$this->_em->getRepository("App:Timeextra")->getTimeextrauser($user, new \DateTime());
|
||||
if($timeextra[1]) {
|
||||
$ework->sub(new \DateInterval("PT".$timeextra[1]."H"));
|
||||
$ework->sub(new \DateInterval("PT".$timeextra[1]."M"));
|
||||
}
|
||||
|
||||
// Nbday worked
|
||||
$nbdaywork=count($tbdays);
|
||||
$etowork = new \DateTime('00:00');
|
||||
|
||||
$etowork = new \DateTime('00:00', new \DateTimeZone('UTC'));
|
||||
$etowork->add(new \DateInterval("PT".($nbdaywork*7)."H"));
|
||||
|
||||
$interval = $etowork->diff($ework);
|
||||
|
|
|
@ -19,13 +19,21 @@ td {
|
|||
{% 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, .card-header {border: none;}
|
||||
.breakpage {
|
||||
page-break-after: always;
|
||||
}
|
||||
{% endif %}
|
||||
.nobreakpage{
|
||||
page-break-after: unset;
|
||||
}
|
||||
.card-body {padding:0px;}
|
||||
.fulltable{width:100%;}
|
||||
}
|
||||
|
||||
.date {
|
||||
color: #ffffff;
|
||||
|
@ -43,23 +51,26 @@ td {
|
|||
RAPPORT MENSUEL = {{ monthof|date("m/Y") }}
|
||||
</h1>
|
||||
|
||||
<div class="noprint">
|
||||
{% 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_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:monthof|date("Ym"),type:"pdf"}) }}>Export PDF</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: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 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 mr-2" href={{ path('app_tallyday_masterlist') }}>Gestion des Pointages</a>
|
||||
<a class="btn btn-secondary float-right mr-2" href={{ path('app_timeextra') }}>Gestion Heures Sup</a>
|
||||
{% if message is defined and not message is empty %}
|
||||
<div class='alert alert-danger' style='margin: 5px 0px'>
|
||||
<strong>Erreur</strong><br>
|
||||
{{ message|raw }}<br>
|
||||
</div>
|
||||
<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_timeextra') }}>Gestion Heures Sup</a>
|
||||
{% if message is defined and not message is empty %}
|
||||
<div class='alert alert-danger' style='margin: 5px 0px'>
|
||||
<strong>Erreur</strong><br>
|
||||
{{ message|raw }}<br>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="mt-3" style="margin:auto; max-width:1810px;">
|
||||
{% set nbusers=0 %}
|
||||
|
@ -67,16 +78,16 @@ td {
|
|||
{% if date.validates %}
|
||||
{% 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">
|
||||
<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">
|
||||
{{date.timemonth}} / {{ timetowork }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<table>
|
||||
<table class="fulltable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:50px !important">s</th>
|
||||
|
@ -104,13 +115,14 @@ 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">
|
||||
|
@ -201,6 +213,11 @@ td {
|
|||
maxheight=$(this).height();
|
||||
});
|
||||
$( ".card" ).height(maxheight);
|
||||
|
||||
$("#btnprint").click(function(){
|
||||
window.print();
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
{% endblock %}
|
|
@ -139,7 +139,7 @@
|
|||
</div>
|
||||
|
||||
{% 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%">
|
||||
<input type="checkbox" class="custom-control-input" id="istelework" {%if istelework%}checked{%endif%}>
|
||||
<label class="custom-control-label" for="istelework">Télétravail</label>
|
||||
|
@ -156,20 +156,20 @@
|
|||
</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>
|
||||
{% 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 %}
|
||||
<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 %}
|
||||
|
||||
{% if is_granted('ROLE_MASTER') %}
|
||||
<hr class="mt-5" style="width: 300px; background-color:var(--colorbgbodylight);">
|
||||
<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 %}
|
||||
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ GESTION DES HEURES SUPPLEMENTAIRES
|
|||
<th width="70px" class="no-sort">Action</th>
|
||||
<th>Utilisateur</th>
|
||||
<th>Date</th>
|
||||
<th>Nb Heure</th>
|
||||
<th>Nb Minutes</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
|
Loading…
Reference in New Issue