Compare commits

..

2 Commits

32 changed files with 192 additions and 269 deletions

1
.gitignore vendored
View File

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

1
debian/compat vendored
View File

@@ -1 +0,0 @@
7

24
debian/control vendored
View File

@@ -1,24 +0,0 @@
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
View File

@@ -1,44 +0,0 @@
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'.

View File

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

3
debian/gbp.conf vendored
View File

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

8
debian/rules vendored
View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,4 +0,0 @@
# 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

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

View File

@@ -48,8 +48,6 @@ writeligne("MIGRATION");
writeligne(""); writeligne("");
writeligne("Purge des Tables Scheudle"); writeligne("Purge des Tables Scheudle");
Purge("userproject");
Purge("timer");
Purge("event"); Purge("event");
Purge("penalty"); Purge("penalty");
Purge("task"); Purge("task");
@@ -182,25 +180,14 @@ while($row=$queryold->fetch()) {
writeligne(""); writeligne("");
writeligne("== Récupération Event"); writeligne("== Récupération Event");
$q="SELECT * FROM schedule_event, schedule_task WHERE event_task=task_id"; $q="SELECT * FROM schedule_event";
$queryold=$bddold->prepare($q); $queryold=$bddold->prepare($q);
$queryold->execute(); $queryold->execute();
while($row=$queryold->fetch()) { 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"]); writeligne($row["event_id"]);
$q="INSERT IGNORE INTO event (id, description, start, end, allday, duration, validate, validateholiday, task_id, user_id ) VALUES (?,?,?,?,?,?,?,?,?,?)"; $q="INSERT IGNORE INTO event (id, description, start, end, allday, duration, validate, validateholiday, task_id, user_id ) VALUES (?,?,?,?,?,?,?,?,?,?)";
$query=$bddnew->prepare($q); $query=$bddnew->prepare($q);
$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"] ]); $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"] ]);
} }
writeligne(""); writeligne("");

View File

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

View File

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

View File

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

View File

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

View File

@@ -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')); $st->add(new \DateInterval('P1D'));

View File

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

View File

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

View File

@@ -109,6 +109,11 @@ class User implements UserInterface, \Serializable
* @ORM\OneToMany(targetEntity="Userproject", mappedBy="user", cascade={"persist"}, orphanRemoval=true) * @ORM\OneToMany(targetEntity="Userproject", mappedBy="user", cascade={"persist"}, orphanRemoval=true)
*/ */
private $userprojects; private $userprojects;
/**
* @ORM\Column(name="fictive", type="boolean")
*
*/
private $fictive;
public function __construct() public function __construct()
{ {
@@ -117,6 +122,7 @@ class User implements UserInterface, \Serializable
$this->penaltys = new ArrayCollection(); $this->penaltys = new ArrayCollection();
$this->jobs = new ArrayCollection(); $this->jobs = new ArrayCollection();
$this->userprojects = new ArrayCollection(); $this->userprojects = new ArrayCollection();
$this->fictive = false;
} }
public function getUsername(): ?string public function getUsername(): ?string
@@ -408,5 +414,17 @@ class User implements UserInterface, \Serializable
return $this; 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) { public function sumEstimate($id) {
$qb = $this->createQueryBuilder('project') $qb = $this->createQueryBuilder('project')
->select('SUM(task.quantity) as somme') ->select('SUM(task.quantity) as somme1, SUM(task.validate) as somme2 ')
->from('App:Task','task') ->from('App:Task','task')
->Where('project.id=:id') ->Where('project.id=:id')
->andWhere('task.project=project') ->andWhere('task.project=project')
->setParameter('id',$id); ->setParameter('id',$id);
$result=$qb->getQuery()->getOneOrNullResult(); $result=$qb->getQuery()->getOneOrNullResult();
$estimate=($result["somme"]?$result["somme"]:0); $estimate=($result["somme1"]?$result["somme1"]:0)+($result["somme2"]?$result["somme2"]:0);
return $estimate; return $estimate;
} }
} }

View File

@@ -1,15 +0,0 @@
<?php
namespace App\Repository;
use App\Entity\Timer;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Common\Persistence\ManagerRegistry;
class TimerRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Timer::class);
}
}

View File

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

View File

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

View File

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

View File

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

View File

@@ -16,9 +16,7 @@ SUIVI HORAIRE
<div id="timer" class="card"> <div id="timer" class="card">
<div class="card-header"> <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 : Lancer un Timer :
<select class="select2entity" id="timer-task" name="timer-task"> <select class="select2entity" id="timer-task" name="timer-task">
<option> Tâche </option> <option> Tâche </option>
@@ -30,12 +28,7 @@ SUIVI HORAIRE
<a href='#' title='Add' id='addtimer'> <a href='#' title='Add' id='addtimer'>
<i class='fas fa-plus-circle'></i> <i class='fas fa-plus-circle'></i>
</a> </a>
{% else %}
Veuillez choisir un Intervenant pour lancer un Timer.
{% endif %}
</div> </div>
</div> </div>
<div> <div>

View File

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

View File

@@ -36,6 +36,3 @@ DATABASE_HOST=%%adresse_ip_mysql
CAS_HOST=%%eolesso_adresse CAS_HOST=%%eolesso_adresse
CAS_PORT=%%eolesso_port CAS_PORT=%%eolesso_port
CAS_PATH=%%eolesso_cas_folder CAS_PATH=%%eolesso_cas_folder
OFFICE_HOUR_START=09:00
OFFICE_HOUR_END=17:30