Compare commits

..

10 Commits

16 changed files with 97 additions and 80 deletions

1
debian/compat vendored Normal file
View File

@ -0,0 +1 @@
7

24
debian/control vendored Normal file
View File

@ -0,0 +1,24 @@
Source: eole-ninebadge
Section: web
Priority: optional
Maintainer: Cadoles <contact@cadoles.com>
Build-Depends: debhelper (>= 7.0.50)
Standards-Version: 3.8.4
Homepage: https://forge.cadoles.com/Cadoles/ninebadge
Vcs-Git: https://forge.cadoles.com/Cadoles/ninebadge
Vcs-Browser: https://forge.cadoles.com/Cadoles/ninebadge
Package: ninebadge-sso
Architecture: all
Depends: ${misc:Depends}, eole-sso
Description: Filtre SSO pour ninebadge "EOLE".
Package: eole-ninebadge
Architecture: all
Depends: ${misc:Depends}, eole-envole-dependances, ninebadge-sso
Description: Eolisation de l'application ninebadge.
Package: ninebadge-apps
Architecture: all
Depends: ${misc:Depends}, envole-dependances-apps
Description: Sources pour ninebadge "EOLE".

44
debian/copyright vendored Normal file
View File

@ -0,0 +1,44 @@
Format: http://dep.debian.net/deps/dep5
Upstream-Name: {PROJECT}
Source: {URL}
Files: *
Copyright: YEAR {UPSTREAM} {AUTHOR} <{MAIL}>
License: {UPSTREAM LICENSE}
Files: debian/*
Copyright: 2012 Équipe EOLE <eole@ac-dijon.fr>
License: CeCILL-2
License: {UPSTREAM LICENSE}
{TEXT OF THE LICENSE}
License: CeCILL-2
This software is governed by the CeCILL-2 license under French law and
abiding by the rules of distribution of free software. You can use,
modify and or redistribute the software under the terms of the CeCILL-2
license as circulated by CEA, CNRS and INRIA at the following URL
"http://www.cecill.info";.
.
As a counterpart to the access to the source code and rights to copy,
modify and redistribute granted by the license, users are provided only
with a limited warranty and the software's author, the holder of the
economic rights, and the successive licensors have only limited
liability.
.
In this respect, the user's attention is drawn to the risks associated
with loading, using, modifying and/or developing or reproducing the
software by the user in light of its specific status of free software,
that may mean that it is complicated to manipulate, and that also
therefore means that it is reserved for developers and experienced
professionals having in-depth computer knowledge. Users are therefore
encouraged to load and test the software's suitability as regards their
requirements in conditions enabling the security of their systems and/or
data to be ensured and, more generally, to use and operate it in the
same conditions as regards security.
.
The fact that you are presently reading this means that you have had
knowledge of the CeCILL-2 license and that you accept its terms.
.
On Eole systems, the complete text of the CeCILL-2 License can be found
in '/usr/share/common-licenses/CeCILL-2-en'.

1
debian/eole-ninebadge.install vendored Normal file
View File

@ -0,0 +1 @@
usr/share/eole

3
debian/gbp.conf vendored Normal file
View File

@ -0,0 +1,3 @@
# Set per distribution debian tag
[DEFAULT]
debian-tag = debian/envole/%(version)s

1
debian/ninebadge-apps.install vendored Normal file
View File

@ -0,0 +1 @@
var/www/html

1
debian/ninebadge-sso.install vendored Normal file
View File

@ -0,0 +1 @@
usr/share/sso

8
debian/rules vendored Executable file
View File

@ -0,0 +1,8 @@
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
%:
dh $@

1
debian/source/format vendored Normal file
View File

@ -0,0 +1 @@
3.0 (native)

View File

@ -68,10 +68,7 @@
"preferred-install": {
"*": "dist"
},
"sort-packages": true,
"allow-plugins": {
"symfony/flex": true
}
"sort-packages": true
},
"autoload": {
"psr-4": {
@ -92,9 +89,6 @@
"symfony/polyfill-php56": "*"
},
"scripts": {
"pre-install-cmd": [
"php scripts/checkcomposer.php"
],
"auto-scripts": {
"cache:clear": "symfony-cmd",
"cache:clear --env=prod": "symfony-cmd",

View File

@ -1,13 +0,0 @@
<?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
}

View File

@ -28,8 +28,6 @@ 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

View File

@ -83,36 +83,21 @@ class BreakdayCommand extends Command
foreach($users as $user) {
if(!$user->hasRole("ROLE_USER")) continue;
$this->writeln("");
$this->writeln($user->getUsername());
$start=new \Datetime('2022-03-07 00:00');
$mini=new \Datetime('2022-03-07 00:00');
$start=new \Datetime('00:00');
$start->modify("monday this week");
$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;
$havebreakdayAM=false;
$havebreakdayPM=false;
if($start->format("w")!=0&&$start->format("w")!=6&&$start>=$firstday) {
if($start->format("w")!=0&&$start->format("w")!=6) {
foreach($response->body->events as $event) {
if($event->eventallday) {
$manip=clone $start;
@ -224,7 +209,6 @@ class BreakdayCommand extends Command
}
$havebreakday=true;
$havebreakdayAM=true;
}
}
else {
@ -276,7 +260,6 @@ class BreakdayCommand extends Command
}
$havebreakday=true;
$havebreakdayPM=true;
}
}
}
@ -292,31 +275,6 @@ 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'));
}

View File

@ -37,7 +37,7 @@ class TimeextraType extends AbstractType
$builder->add('hour',
IntegerType::class, [
"label" => "Nombre de Minutes",
"label" => "Nombre d'Heure",
"required" => true,
]
);

View File

@ -92,14 +92,10 @@ class TallydayRepository extends ServiceEntityRepository
}
}
// Enlever du temps travailler les minutes sup payé
// Enlever du temps travailler les heures sup payé
$timeextra=$this->_em->getRepository("App:Timeextra")->getTimeextrauser($user, new \DateTime());
if($timeextra[1]>0) {
$ework->sub(new \DateInterval("PT".$timeextra[1]."M"));
}
// Ajouter du temps sur des heures supplémentaires majorées
else {
$ework->add(new \DateInterval("PT".($timeextra[1]*-1)."M"));
if($timeextra[1]) {
$ework->sub(new \DateInterval("PT".$timeextra[1]."H"));
}
// Nbday worked

View File

@ -28,7 +28,7 @@ GESTION DES HEURES SUPPLEMENTAIRES
<th width="70px" class="no-sort">Action</th>
<th>Utilisateur</th>
<th>Date</th>
<th>Nb Minutes</th>
<th>Nb Heure</th>
</tr>
</thead>
<tbody>