Compare commits

..

2 Commits

30 changed files with 189 additions and 251 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
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:8,
eventLimit:4,
eventDrop: function(info) {
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

@@ -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,8 +48,6 @@ writeligne("MIGRATION");
writeligne("");
writeligne("Purge des Tables Scheudle");
Purge("userproject");
Purge("timer");
Purge("event");
Purge("penalty");
Purge("task");
@@ -68,46 +66,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"]]);
}
@@ -115,16 +113,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"]) {
@@ -133,7 +131,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);
}
@@ -143,12 +141,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"] ]);
}
@@ -156,19 +154,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"];
@@ -177,78 +175,67 @@ 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, schedule_task WHERE event_task=task_id";
$q="SELECT * FROM schedule_event";
$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"],$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("== 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
. scripts/proxy.sh
. proxy.sh
# Mise en place du fichier d'environnement model
if [ ! -f /var/www/html/schedule/.env ]; then

View File

@@ -26,6 +26,7 @@ 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();
@@ -41,56 +42,38 @@ class EventController extends AbstractController
{
$em = $this->getDoctrine()->getManager();
$tbevents=[];
$start = $request->query->get('start');
$end = $request->query->get('end');
$iduser=$this->get("session")->get("iduser");
// 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
->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;
$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]);
}
// Filtre par project
if($this->get('session')->get('idproject')!="all") {
$idproject=$event->getTask()->getProject()->getId();
if($idproject!=$this->get('session')->get('idproject'))
continue;
}
}
foreach($events as $event) {
$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 {
@@ -98,9 +81,11 @@ 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
@@ -111,6 +96,7 @@ class EventController extends AbstractController
}
// Retour
return new Response(json_encode($tbevents));
}
@@ -512,6 +498,7 @@ 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,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()])){
$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" => [],
];
}
@@ -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()])){
$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,7 +36,9 @@ 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,6 +9,7 @@ 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
@@ -69,6 +70,16 @@ 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);
}
@@ -147,8 +158,14 @@ 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,6 +43,7 @@ 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,
@@ -96,6 +97,11 @@ 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);
@@ -104,12 +110,7 @@ class TimerController extends AbstractController
$timer->setEnd($end);
$timer->setDuration($duration);
$timer->setDescription($description);
$timer->setActivePenalty($activepenalty ? $activepenalty : false);
if ($start < $officeworkstart || $end > $officeworkend) {
$timer->setAdditionalHour(true);
}else{
$timer->setAdditionalHour($additionalhour ? $additionalhour : false);
}
$timer->setActivePenalty($activepenalty);
$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,11 +104,16 @@ 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()
{
@@ -117,6 +122,7 @@ class User implements UserInterface, \Serializable
$this->penaltys = new ArrayCollection();
$this->jobs = new ArrayCollection();
$this->userprojects = new ArrayCollection();
$this->fictive = false;
}
public function getUsername(): ?string
@@ -406,7 +412,19 @@ 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 somme')
->select('SUM(task.quantity) as somme1, SUM(task.validate) as somme2 ')
->from('App:Task','task')
->Where('project.id=:id')
->andWhere('task.project=project')
->setParameter('id',$id);
$result=$qb->getQuery()->getOneOrNullResult();
$estimate=($result["somme"]?$result["somme"]:0);
$estimate=($result["somme1"]?$result["somme1"]:0)+($result["somme2"]?$result["somme2"]:0);
return $estimate;
}
}

View File

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

View File

@@ -42,6 +42,10 @@
.eventEstimate {
margin: -3px 10px;
}
.fictive{
height:10px!important;
background-color:#cdcdcd;
}
{% endblock %}
{% block body %}
@@ -215,6 +219,7 @@
{% block localjavascript %}
$(document).ready(function() {
$("#modalsubmit #user").select2({
theme: 'bootstrap4',
@@ -243,34 +248,46 @@ $(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');
// 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');
// Ajout container
content.append("<span style='margin-top:-12px' class='eventInfo float-right'></span>");
var eventInfo=$(content).children('.eventInfo');
// 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>");
// Ajouter le verrou si event non editable
if(info.event.extendedProps.locked) {
eventInfo.append("<i class='fa fa-lock float-right'></i>");
}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
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;Nature;Utilisateur;Année;Semaine;Cumul;
Client;Projet;Tâche;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|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 %}

View File

@@ -99,10 +99,9 @@
<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.proposed - project.validate - project.planified) }}</b>
<b>RESTE = {{ (project.estimate - project.validate - project.planified) }}</b>
</div>
</div>

View File

@@ -14,11 +14,9 @@
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>
{% if user %}
<a class="btn btn-success" style="float:right" href={{ path('app_timer_submit') }}>Créer un Timer</a>
Lancer un Timer :
<select class="select2entity" id="timer-task" name="timer-task">
<option> Tâche </option>
@@ -30,12 +28,7 @@ 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,36 +277,27 @@
{% 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">
<option value="all" selected>Tout le monde</option>
<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>
{% for user in app.session.get('users') %}
{% set selected="" %}
{%if user.id==app.session.get('iduser') %}
{% set selected="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 %}
{% endif %}
<option value="{{user.id}}" {{selected}}>{{user.displayname}}</option>
{% endfor %}
@@ -330,7 +321,23 @@
{% 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>
@@ -513,10 +520,13 @@
$('#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,7 +35,4 @@ DATABASE_HOST=%%adresse_ip_mysql
# CAS = Redefine local
CAS_HOST=%%eolesso_adresse
CAS_PORT=%%eolesso_port
CAS_PATH=%%eolesso_cas_folder
OFFICE_HOUR_START=09:00
OFFICE_HOUR_END=17:30
CAS_PATH=%%eolesso_cas_folder