Merge branch 'timetracking' of https://forge.cadoles.com/afornerot/schedule into timetracking
This commit is contained in:
@@ -182,14 +182,25 @@ while($row=$queryold->fetch()) {
|
|||||||
|
|
||||||
writeligne("");
|
writeligne("");
|
||||||
writeligne("== Récupération Event");
|
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=$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"],$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("");
|
||||||
|
@@ -48,20 +48,17 @@ class EventController extends AbstractController
|
|||||||
if($iduser=="all")
|
if($iduser=="all")
|
||||||
$events=$em->getRepository("App:Event")->findAll();
|
$events=$em->getRepository("App:Event")->findAll();
|
||||||
else {
|
else {
|
||||||
$selectedusers = $this->get("session")->get("selectedusers");
|
$user=$em->getRepository("App:User")->find($iduser);
|
||||||
if (isset($selectedusers) && sizeof($selectedusers)>1){
|
$events=$em->getRepository("App:Event")->findBy(["user"=>$user]);
|
||||||
$users= [];
|
|
||||||
foreach($selectedusers as $user) {
|
|
||||||
array_push($users,$em->getRepository("App:User")->find($user));
|
|
||||||
}
|
|
||||||
$events=$em->getRepository("App:Event")->findBy(["user"=>$users]);
|
|
||||||
}else{
|
|
||||||
$user=$em->getRepository("App:User")->find($iduser);
|
|
||||||
$events=$em->getRepository("App:Event")->findBy(["user"=>$user]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($events as $event) {
|
foreach($events as $event) {
|
||||||
|
$idproject=$event->getTask()->getProject()->getId();
|
||||||
|
|
||||||
|
// Filtre par project
|
||||||
|
if($this->get('session')->get('idproject')!="all") {
|
||||||
|
if($idproject!=$this->get('session')->get('idproject'))
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$tmp=$this->formatEvent($event);
|
$tmp=$this->formatEvent($event);
|
||||||
array_push($tbevents,$tmp);
|
array_push($tbevents,$tmp);
|
||||||
}
|
}
|
||||||
|
@@ -36,9 +36,7 @@ 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));
|
||||||
}
|
}
|
||||||
|
@@ -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'));
|
||||||
|
@@ -122,8 +122,6 @@ class sessionListener {
|
|||||||
}
|
}
|
||||||
$session->set('services',$tbservices);
|
$session->set('services',$tbservices);
|
||||||
|
|
||||||
$selectedusers=[];
|
|
||||||
$session->set('selectedusers',$selectedusers);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -99,9 +99,10 @@
|
|||||||
<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 }}
|
||||||
Validé = {{ project.validate }}<br>
|
Validé = {{ project.validate }}<br>
|
||||||
Planifié = {{ project.planified }}<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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@@ -284,20 +284,13 @@
|
|||||||
</label>
|
</label>
|
||||||
</a>
|
</a>
|
||||||
<div class="select-control">
|
<div class="select-control">
|
||||||
<select class="form-control select2entity" id="sideuser" name="sideuser" multiple>
|
<select class="form-control select2entity" id="sideuser" name="sideuser">
|
||||||
<option value="all" {%if app.session.get('iduser')=="all" %}selected{% endif %}>Tout le monde</option>
|
<option value="all" selected>Tout le monde</option>
|
||||||
|
|
||||||
{% for user in app.session.get('users') %}
|
{% for user in app.session.get('users') %}
|
||||||
{% set selected="" %}
|
{% set selected="" %}
|
||||||
{% if app.session.get('selectedusers')|length > 1 %}
|
{%if user.id==app.session.get('iduser') %}
|
||||||
{% for suser in app.session.get('selectedusers') %}
|
{% set selected="selected" %}
|
||||||
{%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 %}
|
||||||
@@ -520,13 +513,10 @@
|
|||||||
|
|
||||||
$('#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) {
|
||||||
|
@@ -36,3 +36,6 @@ 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
|
Reference in New Issue
Block a user