예제 #1
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;
 }
예제 #2
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;
 }
예제 #3
0
 public function to_html(\System\Template\Renderer $ren)
 {
     return $this->name ? sprintf('%s (%s): %s', $ren->locales()->trans($this->get_type_name()), $this->name, $this->ident) : sprintf('%s: %s', $ren->locales()->trans($this->get_type_name()), $this->ident);
 }
예제 #4
0
 public function to_html(\System\Template\Renderer $ren)
 {
     return div('team_member', array($ren->link_for('team', $this->team->logo->to_html($ren, 56, 38), args($this->team)), div('team_member_info', array($this->team->to_html_link($ren), div('roles', implode(', ', $this->get_roles($ren))))), div('cleaner', '')));
 }
예제 #5
0
 public function to_html(\System\Template\Renderer $ren)
 {
     return div('event', array(div('event_image', $ren->link_for('event', $this->image->to_html($ren, 78, 56), args($this))), div('event_info', array(span('part name', $ren->link_for('event', $this->name, args($this))), $this->location ? span('part city', $ren->link_ext($this->location->map_link(), $this->location->name)) : '', span('part date', $ren->format_date($this->start, 'human-full-datetime')))), span('cleaner', '')));
 }
예제 #6
0
파일: date.php 프로젝트: just-paja/fudjan
 public static function imprecise(\System\Template\Renderer $ren, \DateTime $date)
 {
     $now = time();
     $delta = $now - $date->getTimestamp();
     $str = '';
     if ($delta >= 0) {
         if ($delta < 3) {
             $str = $ren->trans('time_moment_ago');
         } else {
             if ($delta < 60) {
                 $str = $ren->trans('time_seconds_ago', $delta);
             } else {
                 if ($delta < 120) {
                     $str = $ren->trans('time_minute_ago');
                 } else {
                     if ($delta < 3600) {
                         $str = $ren->trans('time_minutes_ago', ceil($delta / 60));
                     } else {
                         if ($delta < 7200) {
                             $str = $ren->trans('time_hour_ago');
                         } else {
                             if ($delta < 86400) {
                                 $str = $ren->trans('time_hours_ago', floor($delta / 3600));
                             } else {
                                 if ($delta < 172800) {
                                     $str = $ren->trans('time_yesterday');
                                 } else {
                                     if ($delta < 604800) {
                                         $str = $ren->trans('time_days_ago', floor($delta / 86400));
                                     } else {
                                         if ($delta < 1209600) {
                                             $str = $ren->trans('time_week_ago');
                                         } else {
                                             if ($delta < 2592000) {
                                                 $str = $ren->trans('time_weeks_ago', floor($delta / 86400 / 7));
                                             } else {
                                                 if ($delta < 5184000) {
                                                     $str = $ren->trans('time_month_ago');
                                                 } else {
                                                     if ($delta < 31536000) {
                                                         $str = $ren->trans('time_months_ago', floor($delta / 86400 / 30));
                                                     } else {
                                                         if ($delta < 63072000) {
                                                             $str = $ren->trans('time_year_ago');
                                                         } else {
                                                             if ($delta < 86400 * 365 * 50) {
                                                                 $str = $ren->trans('time_years_ago', floor($delta / 86400 / 365));
                                                             } else {
                                                                 $str = $ren->trans('time_long_ago');
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     } else {
         $delta = -1 * $delta;
         if ($delta < 3) {
             $str = $ren->trans('time_in_a_moment');
         } else {
             if ($delta < 10) {
                 $str = $ren->trans('time_in_a_few_seconds');
             } else {
                 if ($delta < 60) {
                     $str = $ren->trans('time_in_seconds', $delta);
                 } else {
                     if ($delta < 120) {
                         $str = $ren->trans('time_in_a_minute');
                     } else {
                         if ($delta < 3600) {
                             $str = $ren->trans('time_in_minutes', ceil(-$delta / 60));
                         } else {
                             if ($delta < 7200) {
                                 $str = $ren->trans('time_in_an_hour');
                             } else {
                                 if ($delta < 86400) {
                                     $str = $ren->trans('time_in_hours', floor($delta / 3600));
                                 } else {
                                     if ($delta < 172800) {
                                         $str = $ren->trans('time_tommorow');
                                     } else {
                                         if ($delta < 604800) {
                                             $str = $ren->trans('time_in_days', floor($delta / 86400));
                                         } else {
                                             if ($delta < 1209600) {
                                                 $str = $ren->trans('time_in_a_week');
                                             } else {
                                                 if ($delta < 2592000) {
                                                     $str = $ren->trans('time_in_weeks', floor($delta / 86400 / 7));
                                                 } else {
                                                     if ($delta < 5184000) {
                                                         $str = $ren->trans('time_in_a_month');
                                                     } else {
                                                         if ($delta < 31536000) {
                                                             $str = $ren->trans('time_in_months', floor($delta / 86400 / 30));
                                                         } else {
                                                             if ($delta < 63072000) {
                                                                 $str = $ren->trans('time_in_a_year');
                                                             } else {
                                                                 $str = $ren->trans('time_in_years', floor($delta / 86400 / 365));
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     return $str;
 }