コード例 #1
0
ファイル: renderables.php プロジェクト: anilch/Personel
    public function __construct(local_attendance $att) {
        if ($att->pageparams->grouptype) {
            $this->users = $att->get_users($att->pageparams->grouptype);
        } else {
            $this->users = $att->get_users($att->pageparams->group);
        }

        $this->pageparams = $att->pageparams;
        $this->perm = $att->perm;

        //$this->groupmode = $att->get_group_mode();
        //$this->cm = $att->cm;

        $this->statuses = $att->get_statuses();

        $this->sessioninfo = $att->get_session_info($att->pageparams->sessionid);
        $this->updatemode = $this->sessioninfo->lasttaken > 0;

        if (isset($att->pageparams->copyfrom)) {
            $this->sessionlog = $att->get_session_log($att->pageparams->copyfrom);
        } else if ($this->updatemode) {
            $this->sessionlog = $att->get_session_log($att->pageparams->sessionid);
        } else {
            $this->sessionlog = array();
        }

        if (!$this->updatemode) {
            $this->sessions4copy = $att->get_today_sessions_for_copy($this->sessioninfo);
        }

        $this->urlpath = $att->url_take()->out_omit_querystring();
        $params = $att->pageparams->get_significant_params();
        $params['id'] = $att->id;
        $this->urlparams = $params;

        $this->att = $att;
    }