Skip to content

Commit

Permalink
0.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
baimard committed Jun 9, 2022
1 parent ebbbf35 commit a5b7880
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 11 deletions.
19 changes: 14 additions & 5 deletions js/main.app.js
Original file line number Diff line number Diff line change
Expand Up @@ -36629,8 +36629,8 @@ class listEvents{
var e = new Events(events);
if(e.inInterval(from)){
var filter = e.getSummary().replace('[loc]','');
res += filter.includes(",") ? filter.split(',')[0] + "<br/>" : filter + "<br/>" ;
title += filter.includes(",") ? filter.split(',')[1] + "-" : "";
res += filter.includes("-") ? filter.split('-')[0] + "<br/>" : filter + "<br/>" ;
title += filter.includes("-") ? filter.split('-')[1] + "," : "";
trouve = true;
}
});
Expand Down Expand Up @@ -36660,10 +36660,17 @@ class listEvents{
trouve = true;
}
});
if(!trouve){

myCase.innerText = res;

if(!trouve && (days[from.getDay()] === "sunday" || days[from.getDay()] === "saturday")){
myCase.setAttribute('style', 'text-align: center; background-color: var(--color-box-shadow);');
myCase.innerText = "";
}else if(!trouve){
myCase.setAttribute('style', 'text-align: center; color: white; background-color: green;');
myCase.innerText = "0";
}
myCase.innerText = res;

return myCase;
}
}
Expand Down Expand Up @@ -36762,7 +36769,9 @@ function getTotal(tbody){
tbody.getElementsByTagName('tr').forEach(element => {
totalByDay += parseInt(element.getElementsByTagName('td')[i].innerText);
});
line.appendChild(newCell('td',totalByDay, 'text-align:center;'));
line.appendChild(newCell( 'td',
isNaN(totalByDay) ? "" : totalByDay,
'text-align:center;'));
}
return line;
}
Expand Down
1 change: 1 addition & 0 deletions lib/Controller/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public function getEvents(String $classement, String $dtStart, String $dtEnd){
$e = new MyEvent($c, $this->myDb);
$cls = strtolower($e->{$classement});
$cls = trim(str_replace("[loc]", "", $cls));
$cls = explode("-",$cls)[0];

if(!array_key_exists($cls,$events)){
$events[$cls] = [];
Expand Down
15 changes: 11 additions & 4 deletions src/js/class/listEvents.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ export class listEvents{
var e = new Events(events);
if(e.inInterval(from)){
var filter = e.getSummary().replace('[loc]','');
res += filter.includes(",") ? filter.split(',')[0] + "<br/>" : filter + "<br/>" ;
title += filter.includes(",") ? filter.split(',')[1] + "-" : "";
res += filter.includes("-") ? filter.split('-')[0] + "<br/>" : filter + "<br/>" ;
title += filter.includes("-") ? filter.split('-')[1] + "," : "";
trouve = true;
}
});
Expand Down Expand Up @@ -50,10 +50,17 @@ export class listEvents{
trouve = true;
}
});
if(!trouve){

myCase.innerText = res;

if(!trouve && (days[from.getDay()] === "sunday" || days[from.getDay()] === "saturday")){
myCase.setAttribute('style', 'text-align: center; background-color: var(--color-box-shadow);');
myCase.innerText = "";
}else if(!trouve){
myCase.setAttribute('style', 'text-align: center; color: white; background-color: green;');
myCase.innerText = "0";
}
myCase.innerText = res;

return myCase;
}
}
4 changes: 3 additions & 1 deletion src/js/module/xhr.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ function getTotal(tbody){
tbody.getElementsByTagName('tr').forEach(element => {
totalByDay += parseInt(element.getElementsByTagName('td')[i].innerText);
});
line.appendChild(newCell('td',totalByDay, 'text-align:center;'));
line.appendChild(newCell( 'td',
isNaN(totalByDay) ? "" : totalByDay,
'text-align:center;'));
}
return line;
}
Expand Down
2 changes: 1 addition & 1 deletion templates/content/modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<hr/>
<p><b><?php p($l->t('This application summarizes the workplaces of employees/persons from the calendar.')); ?></b></p>
<br/>
<p><?php p($l->t('Just put in the calendar a day event with [loc] at the beginning followed by your workplaces. You can add a comment to your workplaces with "-". Example [loc] PARIS, meet customer !')); ?></p>
<p><?php p($l->t('Just put in the calendar a day event with [loc] at the beginning followed by your workplaces. You can add a comment to your workplaces with "-". Example [loc] PARIS - meet customer !')); ?></p>
<p><img src="<?php print_unescaped(image_path('whereami', 'example.png')); ?>" /></p>
</div>
</div>

0 comments on commit a5b7880

Please sign in to comment.