src/Entity/Tutoring/Course.php line 21

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Tutoring;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use App\Entity\Schoolyear;
  5. use App\Entity\User;
  6. use App\Repository\Tutoring\CourseRepository;
  7. use App\Traits\Actions;
  8. use Doctrine\Common\Collections\ArrayCollection;
  9. use Doctrine\Common\Collections\Collection;
  10. use Doctrine\ORM\Mapping as ORM;
  11. use Doctrine\ORM\Mapping\OrderBy;
  12. /**
  13.  * Course
  14.  */
  15. #[ORM\Entity(repositoryClassCourseRepository::class)]
  16. #[ORM\Table(name'hs_tc_tutoring_course')]
  17. #[ApiResource]
  18. class Course implements \Stringable
  19. {
  20.     use Actions;
  21.     /**
  22.      * @var string
  23.      */
  24.     #[ORM\Column(name'name'type'string'length255nullabletrue)]
  25.     private $name;
  26.     #[ORM\ManyToMany(targetEntityLevel::class, inversedBy"courses"cascade: ['persist'])]
  27.     private ?Collection $levels null;
  28.     #[ORM\ManyToOne(targetEntitySubject::class, cascade: ['persist'], inversedBy'courses')]
  29.     private ?Subject $subject null;
  30.     /**
  31.      * @var float
  32.      */
  33.     #[ORM\Column(name'price'type'float'nullabletrue)]
  34.     private $price;
  35.     #[ORM\Column(name'fees_registration'type'float'nullabletrue)]
  36.     private ?float $feesRegistration 0;
  37.     #[ORM\Column(name'days'type'string'length255nullabletrue)]
  38.     private ?string $days null;
  39.     #[ORM\Column(name'start_at'type'datetime'nullabletrue)]
  40.     private ?\DateTime $startAt null;
  41.     #[ORM\Column(name'end_at'type'datetime'nullabletrue)]
  42.     private ?\DateTime $endAt null;
  43.     #[ORM\ManyToOne(targetEntityTutor::class, inversedBy'courses')]
  44.     #[ORM\JoinColumn(nullablefalse)]
  45.     private ?Tutor $tutor null;
  46.     #[ORM\OneToMany(mappedBy'course'targetEntityRowscourse::class, cascade: ['persist'], orphanRemovaltrue)]
  47.     private ?Collection $rowscourses null;
  48.     #[ORM\OneToMany(mappedBy'course'targetEntityRessource::class, cascade: ['persist'], orphanRemovaltrue)]
  49.     private ?Collection $ressources null;
  50.     /**
  51.      * @OrderBy({"position" = "asc"})
  52.      */
  53.     #[ORM\OneToMany(mappedBy'course'targetEntityMonth::class, cascade: ['persist'], orphanRemovaltrue)]
  54.     private ?Collection $months null;
  55.     /**
  56.      * @var Schoolyear
  57.      */
  58.     #[ORM\ManyToOne(targetEntitySchoolyear::class)]
  59.     #[ORM\JoinColumn(nullablefalse)]
  60.     private $schoolyear;
  61.     #[ORM\ManyToOne(targetEntityUser::class, inversedBy"courses")]
  62.     #[ORM\JoinColumn(nullabletrue)]
  63.     private ?User $responsable;
  64.     /**
  65.      * @OrderBy({"createAt" = "ASC"})
  66.      */
  67.     #[ORM\OneToMany(mappedBy'course'targetEntityRegulation::class, cascade: ['persist'], orphanRemovaltrue)]
  68.     private ?Collection $regulations null;
  69.     public function __construct()
  70.     {
  71.         
  72.         $this->createAt=new \DateTime('now');
  73.         $this->published=true;
  74.         $this->regulations=new ArrayCollection();
  75.         $this->levels=new ArrayCollection();
  76.         $this->months=new ArrayCollection();
  77.         $this->ressources=new ArrayCollection();
  78.     }
  79.     /**
  80.      * Set nom
  81.      *
  82.      * @param string $name
  83.      * @return Course
  84.      */
  85.     public function setName($name)
  86.     {
  87.         $this->name $name;
  88.         return $this;
  89.     }
  90.     /**
  91.      * Get name
  92.      *
  93.      * @return string 
  94.      */
  95.     public function getName()
  96.     {
  97.         if($this->id!=null && $this->name == null) return $this->__toString();
  98.         else return $this->name;
  99.     }
  100.     public function getDays(): array
  101.     {
  102.         return explode(',',$this->days);
  103.     }
  104.     public function getDaysString(){
  105.         return $this->days;
  106.     }
  107.     /**
  108.      * @param string $days
  109.      */
  110.     public function setDays(array $days): Course
  111.     {
  112.         $this->days implode(","$days);
  113.         return $this;
  114.     }
  115.     function __toString(): string
  116.     {
  117.         return implode(" ",$this->getLevels()->toArray()).' - '.$this->getSubject();
  118.     }
  119.     /**
  120.      * Add level
  121.      *
  122.      *
  123.      * @return Course
  124.      */
  125.     public function addLevel(Level $level)
  126.     {
  127.         $this->levels[] = $level;
  128.         return $this;
  129.     }
  130.     /**
  131.      * Remove level
  132.      */
  133.     public function removeLevel(Level $level)
  134.     {
  135.         $this->levels->removeElement($level);
  136.     }
  137.     /**
  138.      * Get levels
  139.      *
  140.      * @return ArrayCollection
  141.      */
  142.     public function getLevels()
  143.     {
  144.         return $this->levels;
  145.     }
  146.     /**
  147.      * Set subject
  148.      *
  149.      *
  150.      * @return Course
  151.      */
  152.     public function setSubject(Subject $subject null)
  153.     {
  154.         $this->subject $subject;
  155.         return $this;
  156.     }
  157.     /**
  158.      * Get subject
  159.      *
  160.      * @return Subject
  161.      */
  162.     public function getSubject()
  163.     {
  164.         return $this->subject;
  165.     }
  166.     /**
  167.      * @return float
  168.      */
  169.     public function getPrice()
  170.     {
  171.         return $this->price;
  172.     }
  173.     /**
  174.      * @param float $price
  175.      * @return Course
  176.      */
  177.     public function setPrice($price)
  178.     {
  179.         $this->price $price;
  180.         return $this;
  181.     }
  182.     public function getFeesRegistration(): ?float
  183.     {
  184.         return $this->feesRegistration;
  185.     }
  186.     public function setFeesRegistration(?float $feesRegistration): Course
  187.     {
  188.         $this->feesRegistration $feesRegistration;
  189.         return $this;
  190.     }
  191.     /**
  192.      * @return \DateTime
  193.      */
  194.     public function getStartAt(): ?\DateTime
  195.     {
  196.         if($this->startAt instanceof \DateTime)
  197.             return $this->startAt;
  198.         else
  199.             return $this->getSchoolyear()->getStartAt();
  200.     }
  201.     /**
  202.      * @param \DateTime $startAt
  203.      */
  204.     public function setStartAt(?\DateTime $startAt): Course
  205.     {
  206.         $this->startAt $startAt;
  207.         return $this;
  208.     }
  209.     /**
  210.      * @return \DateTime
  211.      */
  212.     public function getEndAt(): ?\DateTime
  213.     {
  214.         if($this->endAt instanceof \DateTime)
  215.             return $this->endAt;
  216.         else
  217.             return $this->getSchoolyear()->getEndAt();
  218.     }
  219.     /**
  220.      * @param \DateTime $endAt
  221.      */
  222.     public function setEndAt(?\DateTime $endAt): Course
  223.     {
  224.         $this->endAt $endAt;
  225.         return $this;
  226.     }
  227.     /**
  228.      * @return Schoolyear
  229.      */
  230.     public function getSchoolyear()
  231.     {
  232.         return $this->schoolyear;
  233.     }
  234.     /**
  235.      * @param Schoolyear $schoolyear
  236.      * @return Course
  237.      */
  238.     public function setSchoolyear($schoolyear)
  239.     {
  240.         $this->schoolyear $schoolyear;
  241.         return $this;
  242.     }
  243.     /**
  244.      * @return Tutor
  245.      */
  246.     public function getTutor(): ?Tutor
  247.     {
  248.         return $this->tutor;
  249.     }
  250.     /**
  251.      * @param Tutor $tutor
  252.      */
  253.     public function setTutor(?Tutor $tutor): Course
  254.     {
  255.         $this->tutor $tutor;
  256.         return $this;
  257.     }
  258.     /**
  259.      * Add rowscourse
  260.      *
  261.      *
  262.      * @return Course
  263.      */
  264.     public function addRowscourse(Rowscourse $rowscourse)
  265.     {
  266.         $rowscourse->setCourse($this);
  267.         $this->rowscourses[] = $rowscourse;
  268.         return $this;
  269.     }
  270.     /**
  271.      * Remove rowscourse
  272.      */
  273.     public function removeRowscourse(Rowscourse $rowscourse)
  274.     {
  275.         $this->rowscourses->removeElement($rowscourse);
  276.     }
  277.     /**
  278.      * Get rowscourses
  279.      *
  280.      * @return Collection
  281.      */
  282.     public function getRowscourses()
  283.     {
  284.         return $this->rowscourses;
  285.     }
  286.     public function getRowscoursesSorted()
  287.     {
  288.         $items $this->rowscourses->toArray();
  289.         usort($items, function($a$b) {
  290.             $studentA $a->getStudent();
  291.             $studentB $b->getStudent();
  292.             $cmp strcmp($studentA->getFirstName(), $studentB->getFirstName());
  293.             if ($cmp === 0) {
  294.                 return strcmp($studentA->getLastName(), $studentB->getLastName());
  295.             }
  296.             return $cmp;
  297.         });
  298.         return $items;
  299.     }
  300.     /**
  301.      * Add ressource
  302.      *
  303.      *
  304.      * @return Course
  305.      */
  306.     public function addRessource(Ressource $ressource)
  307.     {
  308.         $ressource->setCourse($this);
  309.         $this->ressources[] = $ressource;
  310.         return $this;
  311.     }
  312.     /**
  313.      * Remove ressource
  314.      */
  315.     public function removeRessource(Ressource $ressource)
  316.     {
  317.         $this->ressources->removeElement($ressource);
  318.     }
  319.     /**
  320.      * Get ressources
  321.      *
  322.      * @return ArrayCollection
  323.      */
  324.     public function getRessources()
  325.     {
  326.         return $this->ressources;
  327.     }
  328.     /**
  329.      * Add month
  330.      *
  331.      *
  332.      * @return Course
  333.      */
  334.     public function addMonth(Month $month)
  335.     {
  336.         $month->setCourse($this);
  337.         $this->months[] = $month;
  338.         return $this;
  339.     }
  340.     /**
  341.      * Remove month
  342.      */
  343.     public function removeMonth(Month $month)
  344.     {
  345.         $this->months->removeElement($month);
  346.     }
  347.     /**
  348.      * Get months
  349.      *
  350.      * @return ArrayCollection
  351.      */
  352.     public function getMonths()
  353.     {
  354.         return $this->months;
  355.     }
  356.     public function getMonth(string $m)
  357.     {
  358.         /** @var Month $month */
  359.         foreach ($this->months as $month){
  360.             if($month->getName()==$m) return $month;
  361.         }
  362.         return null;
  363.     }
  364.     /**
  365.      * @return array
  366.      *
  367.      */
  368.     public function getCountedMonths(){
  369.         $list=[];
  370.         if(!$this->getMonths()->isEmpty())
  371.         {
  372.             /** @var Month $month */
  373.             foreach ($this->getMonths() as $month){
  374.                 if ($month->isPassed()){
  375.                     $list[]=$month;
  376.                 }
  377.             }
  378.         }
  379.         return $list;
  380.     }
  381.     public function getMeetings(): Collection
  382.     {
  383.         $meetings = new ArrayCollection();
  384.         foreach ($this->months as $month) {
  385.             foreach ($month->getMeetings() as $meeting) {
  386.                 $meetings->add($meeting);
  387.             }
  388.         }
  389.         return $meetings;
  390.     }
  391.     public function getMeetingPassed():  array
  392.     {
  393.         $meetings = [];
  394.         foreach ($this->months as $month) {
  395.             if($month->isPassed()) $meetings=array_merge($meetings,$month->getMeetings()->toArray());
  396.             else{
  397.                 foreach ($month->getMeetings() as $meeting) {
  398.                     if($meeting->getCreateAt()<new \DateTime('now'))
  399.                     $meetings[]=$meeting;
  400.                 }
  401.             }
  402.         }
  403.         return $meetings;
  404.     }
  405.     public function getMeetingFuture():  array
  406.     {
  407.         $meetings = [];
  408.         foreach ($this->months as $month) {
  409.             if(!$month->isPassed()) {
  410.                 foreach ($month->getMeetings() as $meeting) {
  411.                     if($meeting->getCreateAt()>=new \DateTime('now'))
  412.                         $meetings[]=$meeting;
  413.                 }
  414.             }
  415.         }
  416.         return $meetings;
  417.     }
  418.     public function getNbrMeetingsPassed()
  419.     {
  420.         return count($this->getMeetingPassed());
  421.     }
  422.     public function getNbrMeetingsFuture()
  423.     {
  424.         return count($this->getMeetingFuture());
  425.     }
  426.     public function getLastMeeting(): ?Meeting
  427.     {
  428.         $now = new \DateTime();
  429.         $lastMeeting null;
  430.         foreach ($this->getMeetings() as $meeting) {
  431.             if ($meeting->getCreateAt() < $now) {
  432.                 if ($lastMeeting === null || $meeting->getCreateAt() > $lastMeeting->getCreateAt()) {
  433.                     $lastMeeting $meeting;
  434.                 }
  435.             }
  436.         }
  437.         return $lastMeeting;
  438.     }
  439.     /**
  440.      * Add regulation
  441.      *
  442.      *
  443.      * @return Course
  444.      */
  445.     public function addRegulation(Regulation $regulation)
  446.     {
  447.         $regulation->setCourse($this);
  448.         $this->regulations[] = $regulation;
  449.         return $this;
  450.     }
  451.     /**
  452.      * Remove regulation
  453.      */
  454.     public function removeRegulation(Regulation $regulation)
  455.     {
  456.         $this->regulations->removeElement($regulation);
  457.     }
  458.     /**
  459.      * Get regulations
  460.      *
  461.      * @return ArrayCollection
  462.      */
  463.     public function getRegulations()
  464.     {
  465.         return $this->regulations;
  466.     }
  467.     public function getResponsable(): ?User
  468.     {
  469.         return $this->responsable;
  470.     }
  471.     public function setResponsable(?User $responsable): void
  472.     {
  473.         $this->responsable $responsable;
  474.     }
  475.     public function getDaysTexte(){
  476.         $days=['','Lundi''Mardi''Mercredi''Jeudi''Vendredi''Samedi','Dimanche'];
  477.         $daysText=[];
  478.         foreach ($this->getDays() as $day){
  479.             $daysText[]=$days[$day];
  480.         }
  481.         return $daysText;
  482.     }
  483.     public function getCountGenre($genre){
  484.         $i=0;
  485.         /** @var Ressource $ressource */
  486.         foreach ($this->getRessources() as $ressource){
  487.             if($ressource->getGenre()==$genre && $ressource->isPublished()) $i++;
  488.         }
  489.         return $i;
  490.     }
  491.     public function isStill(){
  492.         
  493.         $now=new \DateTime('now');
  494.         return ($now>=$this->getStartAt() &&  $now<=$this->getEndAt()) ? true false;
  495.     }
  496.     public function isStillInMonth(Month $month){
  497.         
  498.         //return (($month->getStartAt()>=$this->getStartAt() &&  $month->getStartAt()<=$this->getEndAt()) || ($month->getEndAt()>=$this->getStartAt() &&  $month->getEndAt()<=$this->getEndAt())) ? true : false;
  499.         return ($month->getStartAt()>=$this->getStartAt() &&  $month->getStartAt()<=$this->getEndAt()) || ($month->getEndAt()>=$this->getStartAt() &&  $month->getEndAt()<=$this->getEndAt());
  500.     }
  501.     public function getSumToPaid(){
  502.         $s=0;
  503.         /** @var Rowscourse $rowscours */
  504.         foreach ($this->rowscourses as $rowscours){
  505.             $s+=$rowscours->getSumToPaid();
  506.         }
  507.         return $s;
  508.     }
  509.     public function getSumPaidForTutor()
  510.     {
  511.         $s=0;
  512.         /** @var Rowscourse $rowscours */
  513.         foreach ($this->rowscourses as $rowscours){
  514.             $s+=$rowscours->getSumPaidForTutor();
  515.         }
  516.         return $s;
  517.     }
  518.     public function getTotalPaidByMonth($month)
  519.     {
  520.         $sum=0;
  521.         /** @var Rowscourse $rowscours */
  522.         foreach ($this->rowscourses as $rowscours){
  523.             $sum+=$rowscours->getAmountPaidByMonth($month);
  524.         }
  525.         return $sum;
  526.     }
  527.     public function getRestToPaidByMonth($month)
  528.     {
  529.         return $this->getOweByMonth($month)-$this->getTotalPaidByMonth($month);
  530.     }
  531.     public function getSumOutDate(){
  532.         $s=0;
  533.         /** @var Rowscourse $rowscours */
  534.         foreach ($this->rowscourses as $rowscours){
  535.             $s+=$rowscours->getOutDate();
  536.         }
  537.         return $s;
  538.     }
  539.     public function getSumPaid(){
  540.         $s=0;
  541.         /** @var Rowscourse $rowscours */
  542.         foreach ($this->rowscourses as $rowscours){
  543.             $s+=$rowscours->getSumPaid();
  544.         }
  545.         return $s;
  546.     }
  547.     public function getRest(){
  548.         $s=0;
  549.         /** @var Rowscourse $rowscours */
  550.         foreach ($this->rowscourses as $rowscours){
  551.             $s+=$rowscours->getRest();
  552.         }
  553.         return $s;
  554.     }
  555.     public function getAdvance(){
  556.         $s=0;
  557.         /** @var Rowscourse $rowscours */
  558.         foreach ($this->rowscourses as $rowscours){
  559.             $s+=$rowscours->getAdvance();
  560.         }
  561.         return $s;
  562.     }
  563.     public function getLatePaid(){
  564.         $s=0;
  565.         /** @var Rowscourse $rowscours */
  566.         foreach ($this->rowscourses as $rowscours){
  567.             $s+=$rowscours->getLatePaid();
  568.         }
  569.         return $s;
  570.     }
  571.     public  function getRowsRetards()
  572.     {
  573.         $items = [];
  574.         /** @var Rowscourse $rowscours */
  575.         foreach ($this->getRowscoursesSorted() as $rowscours){
  576.             if($rowscours->getLatePaid()>0$items[]=$rowscours;
  577.         }
  578.         return $items;
  579.     }
  580.     public function getNbrRetard()
  581.     {
  582.         return  count($this->getRowsRetards());
  583.     }
  584.     public function getPcPay(){
  585.         if($this->getSumToPaid()!=0)
  586.             return round($this->getSumPaid()/$this->getSumToPaid()*100,0);
  587.         else
  588.             return 0;
  589.     }
  590.     public function getOweByMonth($month){
  591.         $t=0;
  592.         /** @var Rowscourse $rowscours */
  593.         foreach ($this->getRowscourses() as $rowscours){
  594.             $t+=$rowscours->getOweByMonth($month)!==null?$rowscours->getOweByMonth($month)->getPrice():0;
  595.         }
  596.         return $t;
  597.     }
  598.     public function getTotalFees(){
  599.         if($this->tutor->getTypePay()=='Fixe'){
  600.             $f=$this->tutor->getPcPay()*count($this->getCountedMonths());
  601.         }
  602.         else{
  603.             $f=$this->getSumPaidForTutor()*$this->tutor->getPcPay()/100;
  604.         }
  605.         return $f;
  606.     }
  607.     public function getFeesByMonths($month){
  608.         if($this->tutor->getTypePay()=='Fixe'){
  609.             return $this->tutor->getPcPay();
  610.         }
  611.         else{
  612.             return $this->getTotalPaidByMonth($month)*$this->tutor->getPcPay()/100;
  613.         }
  614.     }
  615.     public function getTotalRegulations(){
  616.         $t=0;
  617.         /** @var Regulation $regulation */
  618.         foreach ($this->regulations as $regulation){
  619.             $t+=$regulation->getAmount();
  620.         }
  621.         return $t;
  622.     }
  623.     public function getRegulationDetails()
  624.     {
  625.         $details=[];
  626.         $total=$this->getTotalRegulations();
  627.         foreach ($this->getSchoolyear()->getMonths() as $month){
  628.             $details[$month]=min($total,$this->getFeesByMonths($month));
  629.             $total=max($total-$this->getFeesByMonths($month),0);
  630.         }
  631.         return $details;
  632.     }
  633.     public function getRegulationByMonth($month){
  634.         if(array_key_exists($month,$this->getRegulationDetails())){
  635.             return $this->getRegulationDetails()[$month];
  636.         }
  637.         return 0;
  638.     }
  639.     public function getRestByMonth($month)
  640.     {
  641.         return $this->getFeesByMonths($month)-$this->getRegulationByMonth($month);
  642.     }
  643.     public function getRestRegulation(){
  644.         return $this->getTotalFees()-$this->getTotalRegulations();
  645.     }
  646.     public function getInProgress()
  647.     {
  648.         $items = [];
  649.         $abandonsIds array_map(fn($a) => $a->getId(), $this->getAbandons());
  650.         foreach ($this->getRowscourses() as $rowscourse) {
  651.             if (!in_array($rowscourse->getId(), $abandonsIds)) {
  652.                 $items[] = $rowscourse;
  653.             }
  654.         }
  655.         // Tri par nom puis prénom de l'élève
  656.         usort($items, function($a$b) {
  657.             $studentA $a->getStudent();
  658.             $studentB $b->getStudent();
  659.             $cmp strcmp($studentA->getFirstName(), $studentB->getFirstName());
  660.             if ($cmp === 0) {
  661.                 return strcmp($studentA->getLastName(), $studentB->getLastName());
  662.             }
  663.             return $cmp;
  664.         });
  665.         return $items;
  666.     }
  667.     public function getAbandons()
  668.     {
  669.         $abandons = [];
  670.         $abandonsIds = []; // To avoid duplicates
  671.         foreach ($this->getMonths() as $month) {
  672.             if (!$month->isPassed()) continue;
  673.             foreach ($this->getRowscourses() as $rowscourse) {
  674.                 if ($rowscourse->isAbandoned($month) && !in_array($rowscourse->getId(), $abandonsIds)) {
  675.                     $abandons[] = $rowscourse;
  676.                     $abandonsIds[] = $rowscourse->getId(); // Store the ID to avoid duplicates
  677.                 }
  678.             }
  679.         }
  680.         return $abandons;
  681.     }
  682.     public function getActionsS($actionsItems=[])
  683.     {
  684.         $actions="<div class='btn-group'>" .
  685.             "<button type='button' class='btn btn-default btn-flat dropdown-toggle' data-toggle='dropdown' aria-expanded='false'>" .
  686.             "<span class='fa fa-ellipsis-v'></span>" .
  687.             "<span class='sr-only'>Toggle Dropdown</span>" .
  688.             "</button>" .
  689.             "<ul class='dropdown-menu dropdown-menu-right' role='menu'>";
  690.         if(in_array('edit'$actionsItems))
  691.             $actions.="<li><a title='Modifier' class='action' target='_self' href='javascript:void(0)' data-id='".$this->id."' data-route='".$this->getRoute('edit')."'>"
  692.             ."<i class='fa text-warning fa-fw fa-edit'></i> Modifier</a></li>";
  693.         if(in_array('show'$actionsItems))
  694.             $actions.="<li><a title='Afficher' class='action' target='_self' href='javascript:void(0)' data-id='".$this->id."' data-route='".$this->getRoute('show')."'>"
  695.             ."<i class='fa text-warning fa-fw fa-eye'></i> Afficher</a></li>";
  696.         if(in_array('remove'$actionsItems))
  697.             $actions.="<li><a title='Supprimer ?' 
  698.                 data-toggle='confirmation'
  699.                 data-btn-ok-label='Supprimer' 
  700.                 data-btn-ok-icon='glyphicon glyphicon-ok'
  701.                 data-btn-ok-class='btn-success'
  702.                 data-btn-cancel-label='Annuler' 
  703.                 data-btn-cancel-icon='glyphicon glyphicon-remove'
  704.                 data-btn-cancel-class='btn-danger'
  705.                 data-title='Supprimer ?'
  706.                 data-popout='true'
  707.                 data-content='Voulez-vous vraiment supprimer cet élément ?' 
  708.                 class='action' target='_self' href='javascript:void(0)' data-id='".$this->id."' data-route='".$this->getRoute('remove')."'>"
  709.             ."<i class='fa text-red fa-fw fa-trash-o'></i> Supprimer</a></li>";
  710.         if(in_array('list_items'$actionsItems))
  711.             $actions.="<li><a title='Liste des élèves' class='action' target='_self' href='javascript:void(0)' data-id='".$this->id."' data-route='hs_training_center_course_list_students'>"
  712.             ."<i class='fa text-blue fa-fw fa-list-ul'></i> Liste des élèves</a></li>";
  713.         if(in_array('edit_seances'$actionsItems))
  714.             $actions.="<li><a title='Editer les séances' class='action' target='_parent' href='javascript:void(0)' data-id='".$this->id."' data-route='hs_training_center_course_meetings'>"
  715.             ."<i class='fa text-red fa-fw fa-calendar-check-o'></i> Editer les séances</a></li>";
  716.         if(in_array('list_payments'$actionsItems))
  717.             $actions.="<li><a title='Liste des paiements' class='action' target='_blank' href='javascript:void(0)' data-id='".$this->id."' data-route='hs_training_center_course_paymentsheet'>"
  718.             ."<i class='fa text-green fa-fw fa-credit-card'></i> Liste des paiements</a></li>";
  719. //        $actions.="<li><a title='Générer PDF' class='action' target='_blank' href='javascript:void(0)' data-id='".$this->id."' data-route='hs_training_center_student_paymentsheet_detail'>"
  720. //            ."<i class='fa text-green fa-fw fa-credit-card'></i> Liste des paiements Detail</a></li>";
  721.         $actions.="</ul></div>";
  722.         return $actions;
  723.     }
  724. }