Esempio n. 1
0
 public function cancel(\System\Template\Renderer $ren, $drop)
 {
     $this->canceled = true;
     $this->save();
     $current_user = $ren->response()->request()->user();
     if ($this->id_user != $current_user->id) {
         $notice = \Impro\User\Notice::for_user($this->user, array("generated_by" => 'team_attendance', "redirect" => $drop ? $ren->url('team_attendance', array($this->training->team)) : $ren->url('team_training', array($this->training->team, $this->training)), "author" => $current_user, "team" => $this->training->team, "text" => stprintf($ren->trans('training_cancel_mail'), array("link_user" => \Impro\User::link($ren), "link_team" => $this->training->team->to_html_link($ren, true), "tg_date" => $ren->format_date($this->training->start, 'human')))));
     }
     return $this;
 }
Esempio n. 2
0
 public function mail_to(\System\Template\Renderer $ren, array $opts)
 {
     $leaders = $this->get_leaders();
     $rcpt = array();
     foreach ($leaders as $leader) {
         $opts["id_user"] = $leader->id_user;
         $notice = \Impro\User\Notice::for_user($leader->user, $opts);
         $notice->mail($ren->locales());
     }
     return $this;
 }