diff --git a/src/ninebadge-1.0/config/packages/knp_snappy.yaml b/src/ninebadge-1.0/config/packages/knp_snappy.yaml index 0689f56..43a3233 100644 --- a/src/ninebadge-1.0/config/packages/knp_snappy.yaml +++ b/src/ninebadge-1.0/config/packages/knp_snappy.yaml @@ -2,9 +2,9 @@ knp_snappy: temporary_folder: "%kernel.cache_dir%/snappy" pdf: enabled: true - binary: '/var/www/html/ninegitea/scripts/wkhtmltopdf/wkhtmltopdf' + binary: '/var/www/html/ninebadge/scripts/wkhtmltopdf/wkhtmltopdf' options: [] image: enabled: true - binary: '/var/www/html/ninegitea/scripts/wkhtmltopdf/wkhtmltoimage' + binary: '/var/www/html/ninebadge/scripts/wkhtmltopdf/wkhtmltoimage' options: [] diff --git a/src/ninebadge-1.0/config/routes.yaml b/src/ninebadge-1.0/config/routes.yaml index 022f012..db9ccbd 100644 --- a/src/ninebadge-1.0/config/routes.yaml +++ b/src/ninebadge-1.0/config/routes.yaml @@ -182,11 +182,11 @@ app_tallyday: defaults: { _controller: App\Controller\TallydayController:tallyday } app_tallyday_start: - path: /user/tallyday/start + path: /user/tallyday/start/{istelework}/{ispenaltypassive}/{ispenaltyactive} defaults: { _controller: App\Controller\TallydayController:start } app_tallyday_end: - path: /user/tallyday/end + path: /user/tallyday/end/{istelework}/{ispenaltypassive}/{ispenaltyactive} defaults: { _controller: App\Controller\TallydayController:end } app_tallyday_userlist: diff --git a/src/ninebadge-1.0/src/Controller/RestController.php b/src/ninebadge-1.0/src/Controller/RestController.php index 44bd12c..480e993 100644 --- a/src/ninebadge-1.0/src/Controller/RestController.php +++ b/src/ninebadge-1.0/src/Controller/RestController.php @@ -107,6 +107,13 @@ class RestController extends AbstractFOSRestController * description="User APIKey", * type="string" * ) + * @SWG\Parameter( + * name="type", + * in="formData", + * required=false, + * description="Type of time = null | istelework | ispenaltypassive | ispenaltyactive", + * type="string" + * ) */ @@ -120,6 +127,7 @@ class RestController extends AbstractFOSRestController // Récupération des parametres $key=$request->get("key"); + $type=$request->get("type"); // Rechercher l'utilisateur associé à la clé $user = $em->getRepository("App:User")->findOneBy(["apikey"=>$key]); @@ -127,6 +135,13 @@ class RestController extends AbstractFOSRestController $view = $this->view("API Key inconnue", 403); return $this->handleView($view); } + + // Tester le type + if($type!=null && $type!="istelework" && $type!="ispenaltypassive" && $type!="ispenaltyactive") { + $view = $this->view("Type inconnu", 403); + return $this->handleView($view); + } + $datenow=new \DateTime("now"); $datenow->setTime ( $datenow->format("H"), $datenow->format("i"), 0 ); @@ -146,6 +161,9 @@ class RestController extends AbstractFOSRestController $data->setValidateuser(false); $data->setValidatemaster(false); $data->setIsbreakday(false); + $data->setIstelework(($type=="istelework")); + $data->setIspenaltyactive(($type=="ispenaltyactive")); + $data->setIspenaltypassive(($type=="ispenaltypassive")); $data->setDatestart($datenow); $status="started"; } @@ -153,6 +171,9 @@ class RestController extends AbstractFOSRestController // Sinon c'est que l'on ferme un creneau elseif($data) { $data->setDateend($datenow); + $data->setIstelework(($type=="istelework")); + $data->setIspenaltyactive(($type=="ispenaltyactive")); + $data->setIspenaltypassive(($type=="ispenaltypassive")); $status="stopped"; } @@ -211,6 +232,13 @@ class RestController extends AbstractFOSRestController * description="User APIKey", * type="string" * ) + * @SWG\Parameter( + * name="type", + * in="formData", + * required=false, + * description="Type of time = null | istelework | ispenaltypassive | ispenaltyactive", + * type="string" + * ) */ @@ -224,13 +252,21 @@ class RestController extends AbstractFOSRestController // Récupération des parametres $key=$request->get("key"); - + $type=$request->get("type"); + // Rechercher l'utilisateur associé à la clé $user = $em->getRepository("App:User")->findOneBy(["apikey"=>$key]); if(!$user) { $view = $this->view("API Key inconnue", 403); return $this->handleView($view); } + + // Tester le type + if($type!=null && $type!="istelework" && $type!="ispenaltypassive" && $type!="ispenaltyactive") { + $view = $this->view("Type inconnu", 403); + return $this->handleView($view); + } + $datenow=new \DateTime("now"); $datenow->setTime ( $datenow->format("H"), $datenow->format("i"), 0 ); @@ -250,6 +286,9 @@ class RestController extends AbstractFOSRestController $data->setValidateuser(false); $data->setValidatemaster(false); $data->setIsbreakday(false); + $data->setIstelework(($type=="istelework")); + $data->setIspenaltyactive(($type=="ispenaltyactive")); + $data->setIspenaltypassive(($type=="ispenaltypassive")); $data->setDatestart($datenow); } @@ -309,6 +348,13 @@ class RestController extends AbstractFOSRestController * description="User APIKey", * type="string" * ) + * @SWG\Parameter( + * name="type", + * in="formData", + * required=false, + * description="Type of time = null | istelework | ispenaltypassive | ispenaltyactive", + * type="string" + * ) */ @@ -322,13 +368,21 @@ class RestController extends AbstractFOSRestController // Récupération des parametres $key=$request->get("key"); - + $type=$request->get("type"); + // Rechercher l'utilisateur associé à la clé $user = $em->getRepository("App:User")->findOneBy(["apikey"=>$key]); if(!$user) { $view = $this->view("API Key inconnue", 403); return $this->handleView($view); } + + // Tester le type + if($type!=null && $type!="istelework" && $type!="ispenaltypassive" && $type!="ispenaltyactive") { + $view = $this->view("Type inconnu", 403); + return $this->handleView($view); + } + $datenow=new \DateTime("now"); $datenow->setTime ( $datenow->format("H"), $datenow->format("i"), 0 ); @@ -349,6 +403,9 @@ class RestController extends AbstractFOSRestController // Sinon c'est que l'on ferme un creneau elseif($data) { $data->setDateend($datenow); + $data->setIstelework(($type=="istelework")); + $data->setIspenaltyactive(($type=="ispenaltyactive")); + $data->setIspenaltypassive(($type=="ispenaltypassive")); } // Sinon pas normal @@ -423,6 +480,14 @@ class RestController extends AbstractFOSRestController * description="Date end format YYYY-MM-DD H:I", * type="string" * ) + * + * @SWG\Parameter( + * name="type", + * in="formData", + * required=false, + * description="Type of time = null | istelework | ispenaltypassive | ispenaltyactive", + * type="string" + * ) */ public function addtimer(Request $request) { @@ -437,6 +502,7 @@ class RestController extends AbstractFOSRestController $start=new \DateTime($request->get("start")); $end=$request->get("end"); if(!is_null($end)) $end=new \DateTime($end); + $type=$request->get("type"); // Rechercher l'utilisateur associé à la clé $user = $em->getRepository("App:User")->findOneBy(["apikey"=>$key]); @@ -445,6 +511,14 @@ class RestController extends AbstractFOSRestController return $this->handleView($view); } + + // Tester le type + if($type!=null && $type!="istelework" && $type!="ispenaltypassive" && $type!="ispenaltyactive") { + $view = $this->view("Type inconnu", 403); + return $this->handleView($view); + } + + // Controler la validité des timers if(!$em->getRepository("App:Tallyday")->ctrlTallyday($user,$start)) { $view = $this->view("Impossible d'entamer une journée sans avoir terminé les jours précédents", 404); return $this->handleView($view); @@ -459,6 +533,9 @@ class RestController extends AbstractFOSRestController $data->setValidateuser(false); $data->setValidatemaster(false); $data->setIsbreakday(false); + $data->setIstelework(($type=="istelework")); + $data->setIspenaltyactive(($type=="ispenaltyactive")); + $data->setIspenaltypassive(($type=="ispenaltypassive")); $data->setDatestart($start); $data->setDateend($end); @@ -669,7 +746,10 @@ class RestController extends AbstractFOSRestController $data->setValidateuser(true); $data->setValidatemaster(false); $data->setIsbreakday(false); - + $data->setIstelework(false); + $data->setIspenaltyactive(false); + $data->setIspenaltypassive(false); + $em->persist($data); $em->flush(); } @@ -862,7 +942,11 @@ class RestController extends AbstractFOSRestController foreach($datas as $data) { $isvalideuser=$data->getValidateuser(); $isvalidemaster=$data->getValidatemaster(); - array_push($timers,["start"=>$data->getDatestart(),"end"=>$data->getDateend()]); + $type=""; + if($data->getIstelework()) $type="istelework"; + if($data->getIspenaltypassive()) $type="ispenaltypassive"; + if($data->getIspenaltyactive()) $type="ispenaltyactive"; + array_push($timers,["start"=>$data->getDatestart(),"end"=>$data->getDateend(),"type"=>$type]); $e->add($data->getTimeday()); } $interval = $f->diff($e); diff --git a/src/ninebadge-1.0/src/Controller/TallydayController.php b/src/ninebadge-1.0/src/Controller/TallydayController.php index 429ef8b..77290c8 100755 --- a/src/ninebadge-1.0/src/Controller/TallydayController.php +++ b/src/ninebadge-1.0/src/Controller/TallydayController.php @@ -298,6 +298,9 @@ class TallydayController extends AbstractController $data->setValidateuser(false); $data->setValidatemaster(false); $data->setIsbreakday(false); + $data->setIstelework(false); + $data->setIspenaltyactive(false); + $data->setIspenaltypassive(false); // Création du formulaire $form = $this->createForm(Form::class,$data); @@ -517,6 +520,9 @@ class TallydayController extends AbstractController $data->setValidateuser(true); $data->setValidatemaster(false); $data->setIsbreakday(false); + $data->setIstelework(false); + $data->setIspenaltyactive(false); + $data->setIspenaltypassive(false); $em->persist($data); $em->flush(); @@ -567,6 +573,9 @@ class TallydayController extends AbstractController $data->setValidateuser(false); $data->setValidatemaster(true); $data->setIsbreakday(false); + $data->setIstelework(false); + $data->setIspenaltyactive(false); + $data->setIspenaltypassive(false); $em->persist($data); $em->flush(); @@ -709,6 +718,9 @@ class TallydayController extends AbstractController "avatar"=>$user->getAvatar(), "displayname"=>$user->getDisplayname(), "timemonth"=>"00:00", + "timetelework"=>"00:00", + "timepenaltypassive"=>"00:00", + "timepenaltyactive"=>"00:00", "validates"=>[], ]; @@ -724,6 +736,15 @@ class TallydayController extends AbstractController $emonth = new \DateTime('00:00'); $fmonth = clone $emonth; + + $eteleworkmonth = new \DateTime('00:00'); + $fteleworkmonth = clone $eteleworkmonth; + + $epenaltypassivemonth = new \DateTime('00:00'); + $fpenaltypassivemonth = clone $epenaltypassivemonth; + + $epenaltyactivemonth = new \DateTime('00:00'); + $fpenaltyactivemonth = clone $epenaltyactivemonth; while($datenow<=$dateend) { $eday = new \DateTime('00:00'); @@ -733,6 +754,15 @@ class TallydayController extends AbstractController foreach($datas as $data) { $emonth->add($data->getTimeday()); $eday->add($data->getTimeday()); + + if($data->getIstelework()) + $eteleworkmonth->add($data->getTimeday()); + + if($data->getIspenaltypassive()) + $epenaltypassivemonth->add($data->getTimeday()); + + if($data->getIspenaltyactive()) + $epenaltyactivemonth->add($data->getTimeday()); } $interval = $fday->diff($eday); @@ -750,6 +780,18 @@ class TallydayController extends AbstractController $interval = $fmonth->diff($emonth); $timemonth = (($interval->days*24) + $interval->h).":".sprintf("%02s",$interval->i); $dates[$user->getId()]["timemonth"]=$timemonth; + + $interval = $fteleworkmonth->diff($eteleworkmonth); + $timemonth = (($interval->days*24) + $interval->h).":".sprintf("%02s",$interval->i); + $dates[$user->getId()]["timetelework"]=$timemonth; + + $interval = $fpenaltypassivemonth->diff($epenaltypassivemonth); + $timemonth = (($interval->days*24) + $interval->h).":".sprintf("%02s",$interval->i); + $dates[$user->getId()]["timepenaltypassive"]=$timemonth; + + $interval = $fpenaltyactivemonth->diff($epenaltyactivemonth); + $timemonth = (($interval->days*24) + $interval->h).":".sprintf("%02s",$interval->i); + $dates[$user->getId()]["timepenaltyactive"]=$timemonth; } } @@ -779,7 +821,6 @@ class TallydayController extends AbstractController $appAlias=$this->getParameter("appAlias"); $render=str_replace("/$appAlias/","https://$appWeburl/$appAlias/",$render); - //dump($render); $this->knpSnappy->generateFromHtml($render,$fileloc); return $this->file($fileloc); @@ -839,7 +880,7 @@ class TallydayController extends AbstractController return $response; } - public function start() { + public function start(bool $istelework,bool $ispenaltypassive,bool $ispenaltyactive) { $em = $this->getDoctrine()->getManager(); $datenow=new \DateTime("now"); @@ -856,6 +897,10 @@ class TallydayController extends AbstractController $data->setValidateuser(false); $data->setValidatemaster(false); $data->setIsbreakday(false); + $data->setIstelework($istelework); + $data->setIspenaltyactive($ispenaltyactive); + $data->setIspenaltypassive($ispenaltypassive); + $data->setDatestart($datenow); } @@ -871,7 +916,7 @@ class TallydayController extends AbstractController } - public function end() { + public function end(bool $istelework,bool $ispenaltypassive,bool $ispenaltyactive) { $em = $this->getDoctrine()->getManager(); // On recherche le dernier pointage de la journée @@ -898,6 +943,10 @@ class TallydayController extends AbstractController } $data->setDateend($datenow); + $data->setIstelework($istelework); + $data->setIspenaltyactive($ispenaltyactive); + $data->setIspenaltypassive($ispenaltypassive); + $em->persist($data); $em->flush(); @@ -965,7 +1014,7 @@ class TallydayController extends AbstractController protected function getErrorForm($id,$form,$request,$data,$mode) { $em = $this->getDoctrine()->getManager(); - if(!$em->getRepository("App:Tallyday")->ctrlTallyday($data->getUser(),$data->getDateof())); + if(!$em->getRepository("App:Tallyday")->ctrlTallyday($data->getUser(),$data->getDateof())) $form->addError(new FormError("Impossible d'entamer une journée sans avoir terminé les jours précédents")); if ($form->get('submit')->isClicked()) { diff --git a/src/ninebadge-1.0/src/Entity/Tallyday.php b/src/ninebadge-1.0/src/Entity/Tallyday.php index 987ce3c..a6168f5 100644 --- a/src/ninebadge-1.0/src/Entity/Tallyday.php +++ b/src/ninebadge-1.0/src/Entity/Tallyday.php @@ -52,6 +52,21 @@ class Tallyday */ private $isbreakday; + /** + * @ORM\Column(type="boolean") + */ + private $istelework; + + /** + * @ORM\Column(type="boolean") + */ + private $ispenaltypassive; + + /** + * @ORM\Column(type="boolean") + */ + private $ispenaltyactive; + /** * @ORM\Column(type="string", nullable=true) */ @@ -181,6 +196,42 @@ class Tallyday return $this; } + public function getIstelework(): ?bool + { + return $this->istelework; + } + + public function setIstelework(bool $istelework): self + { + $this->istelework = $istelework; + + return $this; + } + + public function getIspenaltypassive(): ?bool + { + return $this->ispenaltypassive; + } + + public function setIspenaltypassive(bool $ispenaltypassive): self + { + $this->ispenaltypassive = $ispenaltypassive; + + return $this; + } + + public function getIspenaltyactive(): ?bool + { + return $this->ispenaltyactive; + } + + public function setIspenaltyactive(bool $ispenaltyactive): self + { + $this->ispenaltyactive = $ispenaltyactive; + + return $this; + } + } diff --git a/src/ninebadge-1.0/src/Form/TallydayType.php b/src/ninebadge-1.0/src/Form/TallydayType.php index 5c9a24b..a8d1d8b 100644 --- a/src/ninebadge-1.0/src/Form/TallydayType.php +++ b/src/ninebadge-1.0/src/Form/TallydayType.php @@ -52,6 +52,30 @@ class TallydayType extends AbstractType "attr" => ["class"=>"timepicker"], ] ); + + $choices=["non" => "0","oui" => "1"]; + $builder->add("istelework", + ChoiceType::class,[ + "label" =>"En Télétravail ?", + "choices" => $choices + ] + ); + + $choices=["non" => "0","oui" => "1"]; + $builder->add("ispenaltypassive", + ChoiceType::class,[ + "label" =>"En Astreinte passive ?", + "choices" => $choices + ] + ); + + $choices=["non" => "0","oui" => "1"]; + $builder->add("ispenaltyactive", + ChoiceType::class,[ + "label" =>"En Astreinte active ?", + "choices" => $choices + ] + ); } public function configureOptions(OptionsResolver $resolver) diff --git a/src/ninebadge-1.0/templates/Tallyday/edit.html.twig b/src/ninebadge-1.0/templates/Tallyday/edit.html.twig index 952c32f..9b26bb2 100755 --- a/src/ninebadge-1.0/templates/Tallyday/edit.html.twig +++ b/src/ninebadge-1.0/templates/Tallyday/edit.html.twig @@ -81,19 +81,27 @@ {% block localjavascript %} $(document).ready(function() { - /* - $('.timepicker').timepicki({ - show_meridian:false, - min_hour_value:0, - max_hour_value:23, - step_size_minutes:5, - overflow_minutes:true, - increase_direction:'up', - disable_keyboard_mobile: true, - reset: true + $("#tallyday_istelework").change(function(){ + if($("#tallyday_istelework").val()==1) { + $("#tallyday_ispenaltypassive").val(0); + $("#tallyday_ispenaltyactive").val(0); + } }); - */ - + + $("#tallyday_ispenaltypassive").change(function(){ + if($("#tallyday_ispenaltypassive").val()==1) { + $("#tallyday_istelework").val(0); + $("#tallyday_ispenaltyactive").val(0); + } + }); + + $("#tallyday_ispenaltyactive").change(function(){ + if($("#tallyday_ispenaltyactive").val()==1) { + $("#tallyday_ispenaltypassive").val(0); + $("#tallyday_istelework").val(0); + } + }); + $('.timepicker').timepicker({ timeFormat: 'HH:mm', interval:5, diff --git a/src/ninebadge-1.0/templates/Tallyday/master.html.twig b/src/ninebadge-1.0/templates/Tallyday/master.html.twig index 33513f5..eb3f8ec 100644 --- a/src/ninebadge-1.0/templates/Tallyday/master.html.twig +++ b/src/ninebadge-1.0/templates/Tallyday/master.html.twig @@ -6,7 +6,7 @@ th, td { color: #ffffff; background-color: #37474F; text-align: center; - width: 100px; + width: 115px; } td { @@ -44,7 +44,7 @@ td { {% endif %} -
+
{% for date in dates %} {% if date.validates or date.notvalidates %}
@@ -93,6 +93,16 @@ td { {% else %} {%if tallyday.datestart %} de {{tallyday.datestart|date("H:i") }} {% endif %} {%if tallyday.dateend %} à {{tallyday.dateend|date("H:i") }} {% endif %} + + {% if tallyday.istelework %} + + {% endif %} + {% if tallyday.ispenaltypassive %} + + {% endif %} + {% if tallyday.ispenaltyactive %} + + {% endif %} {%endif%}
{% endfor %} @@ -137,6 +147,15 @@ td { {%if tallyday.datestart %} de {{tallyday.datestart|date("H:i") }} {% endif %} {%if tallyday.dateend %} à {{tallyday.dateend|date("H:i") }} {% endif %} + {% if tallyday.istelework %} + + {% endif %} + {% if tallyday.ispenaltypassive %} + + {% endif %} + {% if tallyday.ispenaltyactive %} + + {% endif %} {% endif %}
diff --git a/src/ninebadge-1.0/templates/Tallyday/month.html.twig b/src/ninebadge-1.0/templates/Tallyday/month.html.twig index 96b6f3e..ce7add6 100644 --- a/src/ninebadge-1.0/templates/Tallyday/month.html.twig +++ b/src/ninebadge-1.0/templates/Tallyday/month.html.twig @@ -6,7 +6,7 @@ th, td { color: #ffffff; background-color: #37474F; text-align: center; - width: {% if fgprint %}120px{%else%}100px{%endif%}; + width: {% if fgprint %}135px{%else%}115px{%endif%}; padding: 0px; } @@ -61,7 +61,7 @@ td { {% endif %} -
+
{% set nbusers=0 %} {% for date in dates %} {% if date.validates %} @@ -70,7 +70,7 @@ td {
{{ date.displayname }} -
+
{{date.timemonth}} / {{ timetowork }}
@@ -123,6 +123,17 @@ td { {% else %} {%if tallyday.datestart %} de {{tallyday.datestart|date("H:i") }} {% endif %} {%if tallyday.dateend %} à {{tallyday.dateend|date("H:i") }} {% endif %} + + + {% if tallyday.istelework %} + + {% endif %} + {% if tallyday.ispenaltypassive %} + + {% endif %} + {% if tallyday.ispenaltyactive %} + + {% endif %} {%endif%}
{% endfor %} @@ -139,6 +150,27 @@ td { {% endfor %} + + {%if date.timetelework!="0:00" or date.timepenaltypassive!="0:00" or date.timepenaltyactive!="0:00" %} +
+ + {% endif %} + {%if date.timetelework!="0:00"%} + + {%endif%} + + {%if date.timepenaltypassive!="0:00"%} + + {%endif%} + + {%if date.timepenaltyactive!="0:00"%} + + {%endif%} + + {%if date.timetelework!="0:00" or date.timepenaltypassive!="0:00" or date.timepenaltyactive!="0:00" %} +

Télétravail
{{date.timetelework}}

Astreinte Passive
{{date.timepenaltypassive}}

Astreinte Active
{{date.timepenaltyactive}}
+ {% endif %} +
diff --git a/src/ninebadge-1.0/templates/Tallyday/tallyday.html.twig b/src/ninebadge-1.0/templates/Tallyday/tallyday.html.twig index 53b50f7..7c15795 100644 --- a/src/ninebadge-1.0/templates/Tallyday/tallyday.html.twig +++ b/src/ninebadge-1.0/templates/Tallyday/tallyday.html.twig @@ -18,7 +18,7 @@ font-size: 40px; text-align: center; line-height:30px; - width:250px; + width:300px; border-radius: 0.25rem; } .clock small { @@ -27,11 +27,11 @@ } .alert { - width:250px; + width:300px; } .tallydaydetail { - width:250px; + width:300px; text-align: left; margin-top: 20px; } @@ -61,12 +61,10 @@ {% if not tallydays or not tallydays|last.dateend is null %} {% if not isvalideuser and not isvalidemaster %} - Début Pointage + Début Pointage {% endif %} {% elseif not isvalideuser and not isvalidemaster %} - - Fin Pointage - + Fin Pointage {% endif %}
@@ -76,16 +74,24 @@ Début Fin Temps + {% set isvalideuser=false %} {% set isvalidemaster=false %} + {% set istelework=false %} + {% set ispenaltypassive=false %} + {% set ispenaltyactive=false %} {% for tallyday in tallydays %} {% set isvalideuser=tallyday.validateuser %} {% set isvalidemaster=tallyday.validatemaster %} + {% set istelework=tallyday.istelework %} + {% set ispenaltypassive=tallyday.ispenaltypassive %} + {% set ispenaltyactive=tallyday.ispenaltyactive %} + {% if tallyday.datestart %} {% if tallyday.isbreakday %} @@ -103,6 +109,17 @@ {% endif %} {{tallyday.timedayformatted}} + + {% if tallyday.istelework %} + + {% endif %} + {% if tallyday.ispenaltypassive %} + + {% endif %} + {% if tallyday.ispenaltyactive %} + + {% endif %} + {% endif %} {% endfor %} @@ -122,6 +139,23 @@
{% if not isvalideuser and not isvalidemaster %} +
+
+ + +
+ +
+ + +
+ +
+ + +
+
+ Valider ma journée
{% endif %} @@ -135,7 +169,7 @@ {% if is_granted('ROLE_MASTER') %}

GESTION

- Gestion des Pointages + Gestion des Pointages {% endif %} @@ -149,6 +183,59 @@ var nextrecalcul=new Date(); var firstrecalcul=true; + $('#istelework').change(function() { + if($("#istelework").is(":checked")) { + $("#ispenaltyactive").prop("checked",false); + $("#ispenaltypassive").prop("checked",false); + } + }); + + $('#ispenaltypassive').change(function() { + if($("#ispenaltypassive").is(":checked")) { + $("#istelework").prop("checked",false); + $("#ispenaltyactive").prop("checked",false); + } + }); + + $('#ispenaltyactive').change(function() { + if($("#ispenaltyactive").is(":checked")) { + $("#istelework").prop("checked",false); + $("#ispenaltypassive").prop("checked",false); + } + }); + + $("#btnstart").click(function() { + istelework=0; + ispenaltypassive=0; + ispenaltyactive=0; + + if($("#istelework").is(":checked")) istelework=1; + if($("#ispenaltypassive").is(":checked")) ispenaltypassive=1; + if($("#ispenaltyactive").is(":checked")) ispenaltyactive=1; + + url="{{ path("app_tallyday_start",{istelework:'xxx',ispenaltypassive:'yyy',ispenaltyactive:'zzz'}) }}"; + url=url.replace('xxx',istelework); + url=url.replace('yyy',ispenaltypassive); + url=url.replace('zzz',ispenaltyactive); + document.location.href=url; + }); + + $("#btnend").click(function() { + istelework=0; + ispenaltypassive=0; + ispenaltyactive=0; + + if($("#istelework").is(":checked")) istelework=1; + if($("#ispenaltypassive").is(":checked")) ispenaltypassive=1; + if($("#ispenaltyactive").is(":checked")) ispenaltyactive=1; + + url="{{ path("app_tallyday_end",{istelework:'xxx',ispenaltypassive:'yyy',ispenaltyactive:'zzz'}) }}"; + url=url.replace('xxx',istelework); + url=url.replace('yyy',ispenaltypassive); + url=url.replace('zzz',ispenaltyactive); + document.location.href=url; + }); + function showTime(){ // to get current time/ date. var date = new Date(); diff --git a/src/ninebadge-1.0/templates/Tallyday/user.html.twig b/src/ninebadge-1.0/templates/Tallyday/user.html.twig index dd8ef15..b48eb4e 100644 --- a/src/ninebadge-1.0/templates/Tallyday/user.html.twig +++ b/src/ninebadge-1.0/templates/Tallyday/user.html.twig @@ -87,6 +87,17 @@ {%endif%} {% endif %} = {{tallyday.timedayformatted}} + + {% if tallyday.istelework %} + + {% endif %} + {% if tallyday.ispenaltypassive %} + + {% endif %} + {% if tallyday.ispenaltyactive %} + + {% endif %} +
{% endif %} {% endfor %}