diff --git a/js/main.app.js b/js/main.app.js index 90387e6..48fd72e 100755 --- a/js/main.app.js +++ b/js/main.app.js @@ -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] + "
" : filter + "
" ; - title += filter.includes(",") ? filter.split(',')[1] + "-" : ""; + res += filter.includes("-") ? filter.split('-')[0] + "
" : filter + "
" ; + title += filter.includes("-") ? filter.split('-')[1] + "," : ""; trouve = true; } }); @@ -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; } } @@ -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; } diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index d6d5129..8e699cf 100755 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -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] = []; diff --git a/src/js/class/listEvents.js b/src/js/class/listEvents.js index bee6afc..9ef8d43 100644 --- a/src/js/class/listEvents.js +++ b/src/js/class/listEvents.js @@ -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] + "
" : filter + "
" ; - title += filter.includes(",") ? filter.split(',')[1] + "-" : ""; + res += filter.includes("-") ? filter.split('-')[0] + "
" : filter + "
" ; + title += filter.includes("-") ? filter.split('-')[1] + "," : ""; trouve = true; } }); @@ -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; } } \ No newline at end of file diff --git a/src/js/module/xhr.js b/src/js/module/xhr.js index 9ad0052..061c062 100644 --- a/src/js/module/xhr.js +++ b/src/js/module/xhr.js @@ -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; } diff --git a/templates/content/modal.php b/templates/content/modal.php index f6bea2f..6fa4ca9 100755 --- a/templates/content/modal.php +++ b/templates/content/modal.php @@ -5,7 +5,7 @@

t('This application summarizes the workplaces of employees/persons from the calendar.')); ?>


-

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 !')); ?>

+

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 !')); ?>

\ No newline at end of file