Compare commits

...

24 Commits

Author SHA1 Message Date
937ec6f4ca Merge branch 'master' into dist/eole/2.7.2/master 2020-09-29 08:58:50 +02:00
1de7abe9fd Tri alphabétique des taches 2020-09-28 10:10:47 +02:00
862c3651c0 Affcihage 8 events par défaut sur le calendrier 2020-09-28 10:10:17 +02:00
7e988ff7a9 Merge branch 'master' into dist/eole/2.7.0/master 2020-09-23 09:15:06 +02:00
51bf8c855f add TimeRepository 2020-09-23 08:28:31 +02:00
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 247 additions and 111 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

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

View File

@@ -48,6 +48,8 @@ writeligne("MIGRATION");
writeligne("");
writeligne("Purge des Tables Scheudle");
Purge("userproject");
Purge("timer");
Purge("event");
Purge("penalty");
Purge("task");
@@ -180,14 +182,25 @@ while($row=$queryold->fetch()) {
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();
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("");

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,32 +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");
if($iduser=="all")
// Evenements
if($iduser=="all") {
$events=$em->getRepository("App:Event")->findAll();
else {
$selectedusers = $this->get("session")->get("selectedusers");
if (isset($selectedusers) && sizeof($selectedusers)>1){
$users= [];
foreach($selectedusers as $user) {
array_push($users,$em->getRepository("App:User")->find($user));
$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();
}
$events=$em->getRepository("App:Event")->findBy(["user"=>$users]);
}else{
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 {
@@ -75,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
@@ -90,7 +111,6 @@ class EventController extends AbstractController
}
// Retour
return new Response(json_encode($tbevents));
}

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

@@ -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

@@ -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

@@ -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

@@ -0,0 +1,15 @@
<?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,8 +122,6 @@ class sessionListener {
}
$session->set('services',$tbservices);
$selectedusers=[];
$session->set('selectedusers',$selectedusers);
}
}
}

View File

@@ -83,7 +83,7 @@
</label>
<select class="select2entity" id="tasksubmit" name="tasksubmit">
<option></option>
{% for task in tasks %}
{% for task in tasks|sort((a, b) => a.displayname <=> b.displayname) %}
<option value="{{task.id}}">{{task.displayname}}</option>
{% endfor %}
</select>
@@ -169,7 +169,7 @@
</label>
<select class="select2entity" id="taskupdate" name="taskupdate">
<option></option>
{% for task in tasks %}
{% for task in tasks|sort((a, b) => a.displayname <=> b.displayname) %}
<option value="{{task.id}}">{{task.displayname}}</option>
{% endfor %}
</select>

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

@@ -16,7 +16,9 @@ SUIVI HORAIRE
<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 %}
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,28 +277,37 @@
{% 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 %}
{% endif %}
<option value="{{user.id}}" {{selected}}>{{user.displayname}}</option>
{% endfor %}
</select>
@@ -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

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