Skip to content

Cert#255

Merged
luniki merged 8 commits intomaster46from
cert
Jun 29, 2021
Merged

Cert#255
luniki merged 8 commits intomaster46from
cert

Conversation

@rlucke
Copy link
Copy Markdown
Contributor

@rlucke rlucke commented Jun 18, 2021

No description provided.

@luniki luniki self-requested a review June 18, 2021 07:27
Comment thread controllers/courseware.php Outdated
if(isset($courseware_settings['reminder_interval'])){
$this->storeReminderInterval($courseware_settings['reminder_interval']);
} else {
$this->storeReminderInterval('5'); // default jährlich
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hier bitte Konstanten verwenden, das macht es lesbarer.

Comment thread controllers/courseware.php Outdated
if(isset($courseware_settings['resetter_interval'])){
$this->storeResetterInterval($courseware_settings['resetter_interval']);
} else {
$this->storeResetterInterval('5'); // default jährlich
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hier auch bitte eine Konstante.

Comment thread controllers/progress.php
return $this->redirect('progress?cid='.$cid);
}

require_once dirname(__FILE__).'/../pdf/coursewareCertificatePDF.php';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warum lädst du diese Klasse selbst? Warum nicht über den Autoloader?

Comment thread controllers/progress.php
$pdf->writeHTML($html, true, false, true, false, '');
$filename = _('Zertifikat');
$pdf->Output($user->nachname.'_'.$course->name.'_'.$filename.'.pdf', 'I');
die;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Müsste doch mit $this->render_nothing() auch funktionieren?

Comment thread cronjobs/CoursewareMailCronjob.php Outdated
}
$is_in_interval = false;
switch ($interval) {
case '0': //wöchentlich
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Und hier bitte auch Konstanten


public function getReminderStartDate()
{
return $this->reminder_start_date == '' ? '': date('d.m.Y', (int) $this->reminder_start_date);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hier muss das Format von reminder_start_date festgelegt sein.
Mein Vorschlag: Entweder ein String im Format d.m.Y oder null.


public function setReminderStartDate($state)
{
$this->reminder_start_date = $state;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hier wäre gut, wenn die Eingabe geprüft würde. Erlaubte Werte sind analog dann ein String im Format d.m.Y oder null.

return $this->reminder_start_date == '' ? '': date('d.m.Y', (int) $this->reminder_start_date);
}

public function setReminderEndDate($state)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hier dasselbe wie für reminder start

$this->reminder_end_date = $state;
}

public function getReminderEndDate()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Und hier auch.

Comment thread blocks/Courseware/Courseware.php Outdated
return $this->reseter;
}

public function setReseterInterval($state)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typ der Eingabe prüfen

mlunzena and others added 2 commits June 21, 2021 09:17
Comment thread blocks/Courseware/Courseware.php Outdated
return $this->reseter_interval;
}

public function setReseterStartDate($state)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Format prüfen

Comment thread blocks/Courseware/Courseware.php Outdated
return $this->reseter_start_date = $state;
}

public function getReseterStartDate()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Format festlegen

return $this->reminder;
}

public function setReminderInterval($state)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eingabe prüfen, ob sie zu den Konstanten gehört.

return $this->resetter;
}

public function setResetterInterval($state)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Konstanten verwenden und prüfen

////////////////////////
// Certificate //
////////////////////////
if ($courseware_settings['certificate'] === '1') {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'1' bedeutet enabled?

@luniki
Copy link
Copy Markdown
Member

luniki commented Jun 24, 2021

Spricht nichts gegen einen Merge?

@luniki luniki merged commit fa0023a into master46 Jun 29, 2021
@luniki luniki deleted the cert branch June 29, 2021 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants