|
@ -43,7 +43,7 @@ class user_sessions_cells_generator { |
|
|
$this->user = $user; |
|
|
$this->user = $user; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function get_cells() { |
|
|
public function get_cells($remarks = false) { |
|
|
$this->init_cells(); |
|
|
$this->init_cells(); |
|
|
foreach ($this->reportdata->sessions as $sess) { |
|
|
foreach ($this->reportdata->sessions as $sess) { |
|
|
if (array_key_exists($sess->id, $this->reportdata->sessionslog[$this->user->id])) { |
|
|
if (array_key_exists($sess->id, $this->reportdata->sessionslog[$this->user->id])) { |
|
@ -53,6 +53,9 @@ class user_sessions_cells_generator { |
|
|
} else { |
|
|
} else { |
|
|
$this->construct_hidden_status_cell($this->reportdata->allstatuses[$statusid]->acronym); |
|
|
$this->construct_hidden_status_cell($this->reportdata->allstatuses[$statusid]->acronym); |
|
|
} |
|
|
} |
|
|
|
|
|
if ($remarks) { |
|
|
|
|
|
$this->construct_remarks_cell($this->reportdata->sessionslog[$this->user->id][$sess->id]->remarks); |
|
|
|
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
if ($this->user->enrolmentstart > $sess->sessdate) { |
|
|
if ($this->user->enrolmentstart > $sess->sessdate) { |
|
|
$starttext = get_string('enrolmentstart', 'attendance', userdate($this->user->enrolmentstart, '%d.%m.%Y')); |
|
|
$starttext = get_string('enrolmentstart', 'attendance', userdate($this->user->enrolmentstart, '%d.%m.%Y')); |
|
@ -71,6 +74,9 @@ class user_sessions_cells_generator { |
|
|
$this->construct_not_existing_for_user_session_cell(''); |
|
|
$this->construct_not_existing_for_user_session_cell(''); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
if ($remarks) { |
|
|
|
|
|
$this->construct_remarks_cell(''); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
$this->finalize_cells(); |
|
|
$this->finalize_cells(); |
|
@ -98,6 +104,10 @@ class user_sessions_cells_generator { |
|
|
$this->cells[] = $text; |
|
|
$this->cells[] = $text; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected function construct_remarks_cell($text) { |
|
|
|
|
|
$this->cells[] = $text; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
protected function construct_not_existing_for_user_session_cell($text) { |
|
|
protected function construct_not_existing_for_user_session_cell($text) { |
|
|
$this->cells[] = $text; |
|
|
$this->cells[] = $text; |
|
|
} |
|
|
} |
|
@ -151,6 +161,11 @@ class user_sessions_cells_html_generator extends user_sessions_cells_generator { |
|
|
$this->cells[] = $text; |
|
|
$this->cells[] = $text; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected function construct_remarks_cell($text) { |
|
|
|
|
|
$this->close_open_cell_if_needed(); |
|
|
|
|
|
$this->cells[] = $text; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
protected function construct_not_existing_for_user_session_cell($text) { |
|
|
protected function construct_not_existing_for_user_session_cell($text) { |
|
|
$this->close_open_cell_if_needed(); |
|
|
$this->close_open_cell_if_needed(); |
|
|
$this->cells[] = $text; |
|
|
$this->cells[] = $text; |
|
|