Compare commits

..

19 Commits

Author SHA1 Message Date
c66962097d Merge branch 'master' into dist/eole/2.7.0/master 2020-09-22 14:32:26 +02:00
root
6a9ae5323b mise à plat depot 2020-09-22 14:20:47 +02:00
66fa43497e Add atsk nature on export 2020-09-22 10:49:43 +02:00
9836498b1c Corrections sur Timers 2020-09-01 16:25:05 +02:00
ecacf68ad3 correction timer 2020-09-01 16:04:59 +02:00
d9fe49cce5 Affichage 7 evenement par jour 2020-09-01 14:46:37 +02:00
761f4c929d opyimisation de la requetes des événements 2020-09-01 14:34:32 +02:00
root
04ed1645fa Merge branch 'timetracking' of https://forge.cadoles.com/afornerot/schedule into timetracking 2020-09-01 11:59:43 +02:00
root
e37ced1f4d resolution pb proxy.sh sur reconf 2020-09-01 11:59:20 +02:00
b86601b709 Merge branch 'timetracking' of https://forge.cadoles.com/afornerot/schedule into timetracking 2020-09-01 11:55:06 +02:00
c0d1759bed distinguer les vacations sur le flag validateholiday (fixes #29) 2020-09-01 11:54:55 +02:00
058d5177eb remove select multi user 2020-09-01 11:45:41 +02:00
254dec4372 ajout var office à la config 2020-09-01 10:43:05 +02:00
a524e353db cumul des durées d'événements dans les rapports si deux événements sur une meme date 2020-09-01 10:42:50 +02:00
4523aa41b1 filtre evenets par projet 2020-09-01 10:42:09 +02:00
root
6954153be9 correction script migration 2020-08-31 11:03:41 +02:00
db11d66ae0 Merge branch 'master' into dist/eole/2.7.0/master 2020-05-13 14:06:01 +02:00
2d42e3016d Merge branch 'master' into dist/eole/2.7.0/master 2020-05-12 11:35:36 +02:00
ba4acc1b89 ajout repertoire debian 2020-05-12 09:49:53 +02:00
30 changed files with 252 additions and 190 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
*~

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-schedule
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/schedule
Vcs-Git: https://forge.cadoles.com/Cadoles/schedule
Vcs-Browser: https://forge.cadoles.com/Cadoles/schedule
Package: schedule-sso
Architecture: all
Depends: ${misc:Depends}, eole-sso
Description: Filtre SSO pour schedule "EOLE".
Package: eole-schedule
Architecture: all
Depends: ${misc:Depends}, eole-envole-dependances, schedule-sso
Description: Eolisation de l'application schedule.
Package: schedule-apps
Architecture: all
Depends: ${misc:Depends}, envole-dependances-apps
Description: Sources pour schedule "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-schedule.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

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/schedule-apps.install vendored Normal file
View File

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

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

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

1
debian/source/format vendored Normal file
View File

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

View File

@@ -20,3 +20,4 @@
npm-debug.log
yarn-error.log
###< symfony/webpack-encore-bundle ###
*~

View File

@@ -17,7 +17,7 @@ document.addEventListener('DOMContentLoaded', function() {
weekNumbers: true,
selectable: true,
events: 'event/load',
eventLimit:4,
eventLimit:8,
eventDrop: function(info) {
info.revert();
},

View File

@@ -0,0 +1,4 @@
# See https://symfony.com/doc/current/email/dev_environment.html
swiftmailer:
# send all emails to a specific address
#delivery_addresses: ['me@example.com']

View File

@@ -15,7 +15,7 @@ function purge($table) {
writeligne("$table");
$q="DELETE FROM $table";
$query=$bddnew->prepare($q);
$query->execute();
$query->execute();
}
// Test de la connexion à la base
@@ -48,6 +48,8 @@ writeligne("MIGRATION");
writeligne("");
writeligne("Purge des Tables Scheudle");
Purge("userproject");
Purge("timer");
Purge("event");
Purge("penalty");
Purge("task");
@@ -66,46 +68,46 @@ writeligne("");
writeligne("== Récupération Customer");
$q="SELECT * FROM schedule_customer";
$queryold=$bddold->prepare($q);
$queryold->execute();
$queryold->execute();
while($row=$queryold->fetch()) {
writeligne($row["customer_name"]);
$q="INSERT IGNORE INTO customer (id, name, keypass) VALUES (?,?,?)";
$query=$bddnew->prepare($q);
$query->execute([$row["customer_id"],$row["customer_name"],$row["customer_key"]]);
$query->execute([$row["customer_id"],$row["customer_name"],$row["customer_key"]]);
}
writeligne("");
writeligne("== Récupération Nature");
$q="SELECT * FROM schedule_nature";
$queryold=$bddold->prepare($q);
$queryold->execute();
$queryold->execute();
while($row=$queryold->fetch()) {
writeligne($row["nature_name"]);
$q="INSERT IGNORE INTO nature (id, name, isvacation) VALUES (?,?,?)";
$query=$bddnew->prepare($q);
$query->execute([$row["nature_id"],$row["nature_name"],false]);
$query->execute([$row["nature_id"],$row["nature_name"],false]);
}
writeligne("Congés");
$q="INSERT IGNORE INTO nature (id, name, isvacation) VALUES (?,?,?)";
$query=$bddnew->prepare($q);
$query->execute([-200,"Congés",true]);
$query->execute([-200,"Congés",true]);
writeligne("Temps Partiel");
$q="INSERT IGNORE INTO nature (id, name, isvacation) VALUES (?,?,?)";
$query=$bddnew->prepare($q);
$query->execute([-190,"Temps Partiel",true]);
$query->execute([-190,"Temps Partiel",true]);
writeligne("");
writeligne("== Récupération Service");
$q="SELECT * FROM schedule_service";
$queryold=$bddold->prepare($q);
$queryold->execute();
$queryold->execute();
while($row=$queryold->fetch()) {
writeligne($row["service_name"]);
$q="INSERT IGNORE INTO service (id, name) VALUES (?,?)";
$query=$bddnew->prepare($q);
$query->execute([$row["service_id"],$row["service_name"]]);
$query->execute([$row["service_id"],$row["service_name"]]);
}
@@ -113,16 +115,16 @@ writeligne("");
writeligne("== Récupération User");
$q="SELECT * FROM schedule_user WHERE user_login!='system'";
$queryold=$bddold->prepare($q);
$queryold->execute();
$queryold->execute();
while($row=$queryold->fetch()) {
writeligne($row["user_login"]);
$q="INSERT IGNORE INTO user (id, username, firstname, lastname, email, service_id, apikey, password) VALUES (?,?,?,?,?,?,?,?)";
$query=$bddnew->prepare($q);
$query->execute([$row["user_id"],$row["user_login"],$row["user_firstname"],$row["user_lastname"],$row["user_email"],$row["user_service"],$row["user_login"],"nopassword" ]);
$query->execute([$row["user_id"],$row["user_login"],$row["user_firstname"],$row["user_lastname"],$row["user_email"],$row["user_service"],$row["user_login"],"nopassword" ]);
$output = shell_exec('/var/www/html/schedule/bin/console app:setPassword '.$row["user_login"].' '.$row["user_login"]);
if($row["user_login"]=="afornerot") $roles='ROLE_ADMIN,ROLE_USER';
else {
switch($row["user_profil"]) {
@@ -131,7 +133,7 @@ while($row=$queryold->fetch()) {
case 50: $roles='ROLE_USER'; break;
case 99: $roles='ROLE_VISITOR'; break;
default: $roles='ROLE_VISITOR'; break;
}
}
}
$output = shell_exec('/var/www/html/schedule/bin/console app:setRoles '.$row["user_login"].' '.$roles);
}
@@ -141,12 +143,12 @@ writeligne("");
writeligne("== Récupération Project");
$q="SELECT * FROM schedule_project";
$queryold=$bddold->prepare($q);
$queryold->execute();
$queryold->execute();
while($row=$queryold->fetch()) {
writeligne($row["project_name"]);
$q="INSERT IGNORE INTO project (id, name, active, service_id, customer_id ) VALUES (?,?,?,?,?)";
$query=$bddnew->prepare($q);
$query->execute([$row["project_id"],$row["project_name"],$row["project_actif"],$row["project_service"],$row["project_customer"] ]);
$query->execute([$row["project_id"],$row["project_name"],$row["project_actif"],$row["project_service"],$row["project_customer"] ]);
}
@@ -154,19 +156,19 @@ writeligne("");
writeligne("== Récupération Offer");
$q="SELECT * FROM schedule_order";
$queryold=$bddold->prepare($q);
$queryold->execute();
$queryold->execute();
while($row=$queryold->fetch()) {
writeligne($row["order_name"]);
$q="INSERT IGNORE INTO offer (id, name, ref, quantity, pu, validate, active, project_id ) VALUES (?,?,?,?,?,?,?,?)";
$query=$bddnew->prepare($q);
$query->execute([$row["order_id"],$row["order_name"],$row["order_ref"],$row["order_quantity"],$row["order_pu"],$row["order_validate"],$row["order_actif"],$row["order_project"] ]);
$query->execute([$row["order_id"],$row["order_name"],$row["order_ref"],$row["order_quantity"],$row["order_pu"],$row["order_validate"],$row["order_actif"],$row["order_project"] ]);
}
writeligne("");
writeligne("== Récupération Task");
$q="SELECT * FROM schedule_task";
$queryold=$bddold->prepare($q);
$queryold->execute();
$queryold->execute();
while($row=$queryold->fetch()) {
writeligne($row["task_name"]);
$nature=$row["task_nature"];
@@ -175,67 +177,78 @@ while($row=$queryold->fetch()) {
$q="INSERT IGNORE INTO task (id, name, color, quantity, validate, project_id, nature_id ) VALUES (?,?,?,?,?,?,?)";
$quantity=($row["task_quantity"]==0?null:$row["task_quantity"]);
$query=$bddnew->prepare($q);
$query->execute([$row["task_id"],$row["task_name"],"#".$row["task_color"],$quantity,$row["task_validate"],$row["task_project"],$nature ]);
$query->execute([$row["task_id"],$row["task_name"],"#".$row["task_color"],$quantity,$row["task_validate"],$row["task_project"],$nature ]);
}
writeligne("");
writeligne("== Récupération Event");
$q="SELECT * FROM schedule_event";
$q="SELECT * FROM schedule_event, schedule_task WHERE event_task=task_id";
$queryold=$bddold->prepare($q);
$queryold->execute();
$queryold->execute();
while($row=$queryold->fetch()) {
// Event vacation ?
$isvacation=false;
if($row["task_id"]<=-70) $isvacation=true;
if($row["task_id"]==-85 || $row["task_id"]==-70) $isvacation=true;
// Validation
$validate=$row["event_validate"];
$validateholiday=false;
if($isvacation) $validateholiday=$row["event_validate"];
// Génération de l'event
writeligne($row["event_id"]);
$q="INSERT IGNORE INTO event (id, description, start, end, allday, duration, validate, validateholiday, task_id, user_id ) VALUES (?,?,?,?,?,?,?,?,?,?)";
$query=$bddnew->prepare($q);
$query->execute([$row["event_id"],$row["event_description"],$row["event_start"],$row["event_end"],$row["event_allday"],$row["event_duration"],$row["event_validate"],$row["event_validate"],$row["event_task"],$row["event_user"] ]);
$query->execute([$row["event_id"],$row["event_description"],$row["event_start"],$row["event_end"],$row["event_allday"],$row["event_duration"],$validate,$validateholiday,$row["event_task"],$row["event_user"] ]);
}
writeligne("");
writeligne("== Récupération Penalty");
$q="SELECT * FROM schedule_penalty";
$queryold=$bddold->prepare($q);
$queryold->execute();
$queryold->execute();
while($row=$queryold->fetch()) {
writeligne($row["penalty_id"]);
$q="INSERT IGNORE INTO penalty (id, description, start, end, allday, duration, validate, task_id, user_id ) VALUES (?,?,?,?,?,?,?,?,?)";
$query=$bddnew->prepare($q);
$query->execute([$row["penalty_id"],$row["penalty_description"],$row["penalty_start"],$row["penalty_end"],$row["penalty_allday"],$row["penalty_duration"],$row["penalty_validate"],$row["penalty_task"],$row["penalty_user"] ]);
$query->execute([$row["penalty_id"],$row["penalty_description"],$row["penalty_start"],$row["penalty_end"],$row["penalty_allday"],$row["penalty_duration"],$row["penalty_validate"],$row["penalty_task"],$row["penalty_user"] ]);
}
writeligne("");
writeligne("== Récupération Breakday");
$q="SELECT * FROM schedule_breakday";
$queryold=$bddold->prepare($q);
$queryold->execute();
$queryold->execute();
while($row=$queryold->fetch()) {
writeligne($row["breakday_id"]);
$q="INSERT IGNORE INTO breakday (id, start, end ) VALUES (?,?,?)";
$query=$bddnew->prepare($q);
$query->execute([$row["breakday_id"],$row["breakday_start"],$row["breakday_end"] ]);
$query->execute([$row["breakday_id"],$row["breakday_start"],$row["breakday_end"] ]);
}
writeligne("");
writeligne("== Récupération Job");
$q="SELECT * FROM schedule_job";
$queryold=$bddold->prepare($q);
$queryold->execute();
$queryold->execute();
while($row=$queryold->fetch()) {
writeligne($row["job_id"]);
$q="INSERT IGNORE INTO job (id, name, type ) VALUES (?,?,?)";
$query=$bddnew->prepare($q);
$query->execute([$row["job_id"],$row["job_name"],$row["type"] ]);
$query->execute([$row["job_id"],$row["job_name"],$row["type"] ]);
}
writeligne("");
writeligne("== Récupération UserJob");
$q="SELECT * FROM schedule_user_jobs WHERE project_id=-100";
$queryold=$bddold->prepare($q);
$queryold->execute();
$queryold->execute();
while($row=$queryold->fetch()) {
writeligne($row["user_job_id"]);
$q="INSERT IGNORE INTO userjob (user, job ) VALUES (?,?)";
$query=$bddnew->prepare($q);
$query->execute([$row["user_id"],$row["job_id"] ]);
$query->execute([$row["user_id"],$row["job_id"] ]);
}
echo "\n\n";

View File

@@ -3,7 +3,7 @@
cd /var/www/html/schedule
# Déclaration d'un proxy
. proxy.sh
. scripts/proxy.sh
# Mise en place du fichier d'environnement model
if [ ! -f /var/www/html/schedule/.env ]; then

View File

@@ -26,7 +26,6 @@ class EventController extends AbstractController
public function list(Request $request)
{
$em = $this->getDoctrine()->getManager();
$users = $em->getRepository("App:User")->findAll();
$tasks = $em->getRepository("App:Task")->findAll();
@@ -42,38 +41,56 @@ class EventController extends AbstractController
{
$em = $this->getDoctrine()->getManager();
$tbevents=[];
// Evenements
$start = $request->query->get('start');
$end = $request->query->get('end');
$iduser=$this->get("session")->get("iduser");
$user=$em->getRepository("App:User")->find($iduser);
if($iduser=="all")
// Evenements
if($iduser=="all") {
$events=$em->getRepository("App:Event")->findAll();
else {
$users= [];
$fictivuser = $em->getRepository("App:User")->findOneBy([
'service' => $user->getService(),
'fictive' => true,
]);
array_push($users,$fictivuser);
$selectedusers = $this->get("session")->get("selectedusers");
if (isset($selectedusers) && sizeof($selectedusers)>1){
foreach($selectedusers as $user) {
array_push($users,$em->getRepository("App:User")->find($user));
}
$events=$em->getRepository("App:Event")->findBy(["user"=>$users]);
}else{
array_push($users,$em->getRepository("App:User")->find($iduser));
$events=$em->getRepository("App:Event")->findBy(["user"=>$users]);
}
$events = $em
->createQueryBuilder('event')
->select('event')
->from('App:Event','event')
->Where('event.start>=:start AND event.end <:end')
->setParameter('start',$start)
->setParameter('end',$end)
->getQuery()->getResult();
}
else {
$user=$em->getRepository("App:User")->find($iduser);
$events=$em->getRepository("App:Event")->findBy(["user"=>$user]);
$events = $em
->createQueryBuilder('event')
->select('event')
->from('App:Event','event')
->Where('event.user=:user AND event.start>=:start AND event.end <:end')
->setParameter('user',$user->getId())
->setParameter('start',$start)
->setParameter('end',$end)
->getQuery()->getResult();
}
foreach($events as $event) {
//Filtre par service
if($this->get('session')->get('idservice')!="all") {
$idservice=$event->getUser()->getService()->getId();
if ($idservice!=$this->get('session')->get('idservice')){
continue;
}
}
// Filtre par project
if($this->get('session')->get('idproject')!="all") {
$idproject=$event->getTask()->getProject()->getId();
if($idproject!=$this->get('session')->get('idproject'))
continue;
}
$tmp=$this->formatEvent($event);
array_push($tbevents,$tmp);
}
// Astreintes
$iduser=$this->get("session")->get("iduser");
if($iduser=="all")
$penaltys=$em->getRepository("App:Penalty")->findAll();
else {
@@ -81,11 +98,9 @@ class EventController extends AbstractController
$user=$em->getRepository("App:User")->find($iduser);
$penaltys=$em->getRepository("App:Penalty")->findBy(["user"=>$user]);
}
foreach($penaltys as $penalty) {
$tmp=$this->formatEvent($penalty);
array_push($tbevents,$tmp);
}
// Breakday
@@ -96,7 +111,6 @@ class EventController extends AbstractController
}
// Retour
return new Response(json_encode($tbevents));
}
@@ -498,7 +512,6 @@ class EventController extends AbstractController
"holiday" => $event->getTask()->getNature()->getIsvacation(),
"externaltrip" => ($event instanceof Penalty?false:$event->getExternalTrip()),
"editable" => $editable,
"fictivuser" => $event->getUser()->getFictive(),
"durationEditable" => false,
"extendedProps" => [
"fulldescription" => ($event instanceof Penalty?"ASTREINTE\n":"").strtoupper($event->getTask()->getDisplayname())."\n\n".$event->getDescription(),

View File

@@ -327,6 +327,7 @@ class ExportController extends AbstractController
if(!isset($tbproject["weeks_by_task_by_user"][$event->getStart()->format("Y")][$event->getStart()->format("W")]["tasks"][$event->getTask()->getId()])){
$tbproject["weeks_by_task_by_user"][$event->getStart()->format("Y")][$event->getStart()->format("W")]["tasks"][$event->getTask()->getId()] = [
"taskname" => $event->getTask()->getName(),
"nature" => $event->getTask()->getNature()->getName(),
"users" => [],
];
}
@@ -405,6 +406,7 @@ class ExportController extends AbstractController
if(!isset($tbproject["weeks_by_task_by_user"][$penalty->getStart()->format("Y")][$penalty->getStart()->format("W")]["tasks"][$penalty->getTask()->getId()])){
$tbproject["weeks_by_task_by_user"][$penalty->getStart()->format("Y")][$penalty->getStart()->format("W")]["tasks"][$penalty->getTask()->getId()] = [
"taskname" => $penalty->getTask()->getName(),
"nature" => $event->getTask()->getNature()->getName(),
"users" => [],
];
}

View File

@@ -36,9 +36,7 @@ class HomeController extends AbstractController
public function selectuser(Request $request)
{
$iduser = $request->request->get('iduser');
$selectedusers = $request->request->get('selectedusers');
$this->get('session')->set('iduser',$iduser);
$this->get('session')->set('selectedusers',$selectedusers);
$output=["return"=>"OK"];
return new Response(json_encode($output));
}

View File

@@ -352,7 +352,7 @@ class ReportController extends AbstractController
$end=new \Datetime('first day of this month');
$end->add(new \DateInterval('P'.$nbmonth.'M'));
$end->sub(new \DateInterval('P1D'));
foreach($users as $user) {
$tbevents = $this->getEventuser($user,$start,$end,false);
@@ -955,7 +955,7 @@ class ReportController extends AbstractController
];
}
$tbevents[$idproject][$idday]["duration"]=($event->getAllday()?1:0.5);
$tbevents[$idproject][$idday]["duration"]+=($event->getAllday()?1:0.5);
$st->add(new \DateInterval('P1D'));

View File

@@ -9,7 +9,6 @@ use Symfony\Component\Form\FormError;
use Knp\Bundle\SnappyBundle\Snappy\Response\PdfResponse;
use App\Entity\Service as Entity;
use App\Entity\User as Fictiv;
use App\Form\ServiceType as Form;
class ServiceController extends AbstractController
@@ -70,16 +69,6 @@ class ServiceController extends AbstractController
$em->persist($data);
$em->flush();
$fictivuser = new Fictiv();
$fictivuser->setUsername($data->getName());
$fictivuser->setPassword(bin2hex(openssl_random_pseudo_bytes(4)));
$fictivuser->setLastname("Service");
$fictivuser->setFirstname($data->getName());
$fictivuser->setEmail($data->getName());
$fictivuser->setService($data->getId());
$fictivuser->setFictive(true);
$em->persist($fictivuser);
$em->flush();
// Retour à la liste
return $this->redirectToRoute($this->route);
}
@@ -158,14 +147,8 @@ class ServiceController extends AbstractController
return $this->redirectToRoute($this->route."_update",["id"=>$id]);
else {
try {
$fictivuser = $em->getRepository("App:User")->findOneBy([
'service' => $data->getService(),
'fictive' => true,
]);
$em->remove($fictivuser);
$em->remove($data);
$em->flush();
}
catch(\Doctrine\DBAL\DBALException $e) {
// Création du formulaire

View File

@@ -43,7 +43,6 @@ class TimerController extends AbstractController
$user = $em->getRepository("App:User")->find($iduser);
$tasks = $em->getRepository("App:Task")->findAll();
$timers = $em->getRepository("App:Timer")->findBy(["user"=>$iduser]);
return $this->render($this->render.'list.cal.html.twig',[
"useheader" => true,
"usesidebar" => true,
@@ -97,11 +96,6 @@ class TimerController extends AbstractController
$officeworkend = clone $officeworkstart;
$officeworkstart->SetTime(9,0,0);
$officeworkend->SetTime(17,30,0);
if ($start < $officeworkstart || $end > $officeworkend) {
$timer->setAdditionalHour(true);
}else{
$timer->setAdditionalHour($additionalhour);
}
$timer = new Entity();
$timer->setUser($user);
@@ -110,7 +104,12 @@ class TimerController extends AbstractController
$timer->setEnd($end);
$timer->setDuration($duration);
$timer->setDescription($description);
$timer->setActivePenalty($activepenalty);
$timer->setActivePenalty($activepenalty ? $activepenalty : false);
if ($start < $officeworkstart || $end > $officeworkend) {
$timer->setAdditionalHour(true);
}else{
$timer->setAdditionalHour($additionalhour ? $additionalhour : false);
}
$em->persist($timer);
$em->flush();

View File

@@ -11,7 +11,7 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* User
*
*
* @ORM\Entity(repositoryClass="App\Repository\UserRepository")
* @ORM\Table(name="user",indexes={@ORM\Index(name="username", columns={"username"})})
* @UniqueEntity("username", message="Ce nom d'utilisateur existe dèja")
@@ -84,7 +84,7 @@ class User implements UserInterface, \Serializable
* @ORM\ManyToOne(targetEntity="Service", inversedBy="users")
* @ORM\JoinColumn(nullable=true)
*/
private $service;
private $service;
/**
* @ORM\OneToMany(targetEntity="Event", mappedBy="user", cascade={"persist"}, orphanRemoval=false)
@@ -104,16 +104,11 @@ class User implements UserInterface, \Serializable
* )
*/
protected $jobs;
/**
* @ORM\OneToMany(targetEntity="Userproject", mappedBy="user", cascade={"persist"}, orphanRemoval=true)
*/
private $userprojects;
/**
* @ORM\Column(name="fictive", type="boolean")
*
*/
private $fictive;
public function __construct()
{
@@ -122,7 +117,6 @@ class User implements UserInterface, \Serializable
$this->penaltys = new ArrayCollection();
$this->jobs = new ArrayCollection();
$this->userprojects = new ArrayCollection();
$this->fictive = false;
}
public function getUsername(): ?string
@@ -412,19 +406,7 @@ class User implements UserInterface, \Serializable
}
return $this;
}
public function getFictive(): ?bool
{
return $this->fictive;
}
public function setFictive(bool $fictive): self
{
$this->fictive = $fictive;
return $this;
}
}
}

View File

@@ -81,14 +81,14 @@ class ProjectRepository extends ServiceEntityRepository
public function sumEstimate($id) {
$qb = $this->createQueryBuilder('project')
->select('SUM(task.quantity) as somme1, SUM(task.validate) as somme2 ')
->select('SUM(task.quantity) as somme')
->from('App:Task','task')
->Where('project.id=:id')
->andWhere('task.project=project')
->setParameter('id',$id);
$result=$qb->getQuery()->getOneOrNullResult();
$estimate=($result["somme1"]?$result["somme1"]:0)+($result["somme2"]?$result["somme2"]:0);
$estimate=($result["somme"]?$result["somme"]:0);
return $estimate;
}
}

View File

@@ -122,8 +122,6 @@ class sessionListener {
}
$session->set('services',$tbservices);
$selectedusers=[];
$session->set('selectedusers',$selectedusers);
}
}
}

View File

@@ -42,10 +42,6 @@
.eventEstimate {
margin: -3px 10px;
}
.fictive{
height:10px!important;
background-color:#cdcdcd;
}
{% endblock %}
{% block body %}
@@ -219,7 +215,6 @@
{% block localjavascript %}
$(document).ready(function() {
$("#modalsubmit #user").select2({
theme: 'bootstrap4',
@@ -248,46 +243,34 @@ $(document).ready(function() {
// Rendu d'un évenement
function eventRender(info) {
console.log(info.event.extendedProps);
// Récupération des divers élements du rendu event
var content=$(info.el).children('.fc-content');
var title=$(content).children('.fc-title');
if(!info.event.extendedProps.fictivuser){
// Ajouter l'avatar
content.prepend("<img src="+info.event.extendedProps.avatar+" class='eventAvatar'>");
content.append("<span class='eventUser float-left small'>"+info.event.extendedProps.username+"</span>");
var eventInfo=$(content).children('.eventUser');
// Ajout container
content.append("<span class='eventInfo float-right'></span>");
var eventInfo=$(content).children('.eventInfo');
// Ajouter l'avatar
content.prepend("<img src="+info.event.extendedProps.avatar+" class='eventAvatar'>");
content.append("<span class='eventUser float-left small'>"+info.event.extendedProps.username+"</span>");
var eventInfo=$(content).children('.eventUser');
// Ajouter le verrou si event non editable
if(info.event.extendedProps.locked) {
eventInfo.append("<i class='fa fa-lock float-right'></i>");
}
if(info.event.extendedProps.externaltrip) {
eventInfo.append("<i class='fas fa-bed float-right'></i>");
}
if(info.event.extendedProps.holiday) {
eventInfo.append("<i class='fas fa-umbrella-beach float-right'></i>");
}
// Ajout estimation
eventInfo.append("<span class='eventEstimate float-right small'>"+info.event.extendedProps.estimate+"</span>");
// Ajout container
content.append("<span style='margin-top:-12px' class='eventInfo float-right'></span>");
var eventInfo=$(content).children('.eventInfo');
}else{
$(content).addClass('fictive');
$(content).children('.fc-title').remove();
// Ajouter le verrou si event non editable
if(info.event.extendedProps.locked) {
eventInfo.append("<i class='fa fa-lock float-right'></i>");
}
if(info.event.extendedProps.externaltrip) {
eventInfo.append("<i class='fas fa-bed float-right'></i>");
}
if(info.event.extendedProps.holiday) {
eventInfo.append("<i class='fas fa-umbrella-beach float-right'></i>");
}
// Ajout estimation
eventInfo.append("<span class='eventEstimate float-right small'>"+info.event.extendedProps.estimate+"</span>");
// Description
content.attr("data-placement","top");
content.attr("data-html",true);
content.attr("data-toggle","tooltip");
content.attr("title",info.event.extendedProps.fulldescription);
content.tooltip()
}
// Formulaire Création d'un événement

View File

@@ -1,12 +1,12 @@
{% block body %}
Client;Projet;Tâche;Utilisateur;Année;Semaine;Cumul;
Client;Projet;Tâche;Nature;Utilisateur;Année;Semaine;Cumul;
{% for project in projects %}
{% if project.weeks_by_task_by_user is defined %}
{% for year,weeks in project.weeks_by_task_by_user %}
{% for week in weeks %}
{% for task in week.tasks%}
{% for user in task.users%}
{{project.customer}};{{project.name}};{{task.taskname}};{{user.displayname}};{{year}};S{{week.weeknumber}};{{user.cumul|replace({".": ","})}};
{{project.customer}};{{project.name}};{{task.taskname|replace({"&": "et"})}};{{task.nature}};{{user.displayname}};{{year}};S{{week.weeknumber}};{{user.cumul|replace({".": ","})}};
{% endfor %}
{% endfor %}
{% endfor %}

View File

@@ -99,9 +99,10 @@
<h2>{{ project.displayname }}</h2>
<div class="synthese">
Estimé = {{ project.estimate }}<br>
Commandé = {{ project.proposed }}<br>
Validé = {{ project.validate }}<br>
Planifié = {{ project.planified }}<br>
<b>RESTE = {{ (project.estimate - project.validate - project.planified) }}</b>
<b>RESTE = {{ ( project.proposed - project.validate - project.planified) }}</b>
</div>
</div>

View File

@@ -14,9 +14,11 @@
SUIVI HORAIRE
</h1>
<div id="timer" class="card">
<div class="card-header">
<a class="btn btn-success" style="float:right" href={{ path('app_timer_submit') }}>Créer un Timer</a>
<a class="btn btn-success" style="float:right" href={{ path('app_timer_submit') }}>Créer un Timer</a>
{% if user %}
Lancer un Timer :
<select class="select2entity" id="timer-task" name="timer-task">
<option> Tâche </option>
@@ -28,7 +30,12 @@ SUIVI HORAIRE
<a href='#' title='Add' id='addtimer'>
<i class='fas fa-plus-circle'></i>
</a>
{% else %}
Veuillez choisir un Intervenant pour lancer un Timer.
{% endif %}
</div>
</div>
<div>

View File

@@ -277,27 +277,36 @@
{% endfor %}
</select>
</div>
<a>
<label class="control-label">
Service
</label>
</a>
<div class="select-control">
<select class="form-control select2entity" id="sideservice" name="sideservice">
<option value="all" selected>Tout les services</option>
{% for service in app.session.get('services') %}
{% set selected="" %}
{%if service.id==app.session.get('idservice') %}
{% set selected="selected" %}
{% endif %}
<option value="{{service.id}}" {{selected}}>{{service.name}}</option>
{% endfor %}
</select>
</div>
<a>
<label class="control-label">
Intervenant
</label>
</a>
<div class="select-control">
<select class="form-control select2entity" id="sideuser" name="sideuser" multiple>
<option value="all" {%if app.session.get('iduser')=="all" %}selected{% endif %}>Tout le monde</option>
<select class="form-control select2entity" id="sideuser" name="sideuser">
<option value="all" selected>Tout le monde</option>
{% for user in app.session.get('users') %}
{% set selected="" %}
{% if app.session.get('selectedusers')|length > 1 %}
{% for suser in app.session.get('selectedusers') %}
{%if user.id == suser %}
{% set selected="selected" %}
{% endif %}
{% endfor %}
{% else %}
{%if user.id==app.session.get('iduser') %}
{% set selected="selected" %}
{% endif %}
{%if user.id==app.session.get('iduser') %}
{% set selected="selected" %}
{% endif %}
<option value="{{user.id}}" {{selected}}>{{user.displayname}}</option>
{% endfor %}
@@ -321,23 +330,7 @@
{% endfor %}
</select>
</div>
<a>
<label class="control-label">
Service
</label>
</a>
<div class="select-control">
<select class="form-control select2entity" id="sideservice" name="sideservice">
<option value="all" selected>Tout les services</option>
{% for service in app.session.get('services') %}
{% set selected="" %}
{%if service.id==app.session.get('idservice') %}
{% set selected="selected" %}
{% endif %}
<option value="{{service.id}}" {{selected}}>{{service.name}}</option>
{% endfor %}
</select>
</div>
</li>
<li class="last"></li>
@@ -520,13 +513,10 @@
$('#sideuser').on('select2:select', function (e) {
var data = e.params.data;
var selectedusers = $('#sideuser').val();
console.log(selectedusers)
$.ajax({
type: "POST",
data: {
iduser: data.id,
selectedusers: selectedusers,
},
url: "{{ path('app_home_selectuser') }}",
success: function (response) {

View File

@@ -35,4 +35,7 @@ DATABASE_HOST=%%adresse_ip_mysql
# CAS = Redefine local
CAS_HOST=%%eolesso_adresse
CAS_PORT=%%eolesso_port
CAS_PATH=%%eolesso_cas_folder
CAS_PATH=%%eolesso_cas_folder
OFFICE_HOUR_START=09:00
OFFICE_HOUR_END=17:30