Also fixes Status Board display on homepage to show correct status on each day. It was previously reusing the currnent status for all previous days on which the incidents were open.
30 lines
804 B
PHP
30 lines
804 B
PHP
<?php
|
|
|
|
class StatusBoard_IncidentStatus extends StatusBoard_DatabaseObject {
|
|
|
|
protected static $table = 'incidentstatus';
|
|
|
|
protected $_db_id;
|
|
protected $_db_incident;
|
|
protected $_db_status;
|
|
protected $_db_description;
|
|
protected $_db_ctime;
|
|
|
|
public function all_for_incident(StatusBoard_Incident $incident) {
|
|
return static::all_for('incident', $incident->id);
|
|
}
|
|
|
|
public function newForIncident(StatusBoard_Incident $incident, $status, $description) {
|
|
$new_status = new self();
|
|
$new_status->incident = $incident->id;
|
|
$new_status->status = $status;
|
|
$new_status->description = $description;
|
|
$new_status->ctime = time();
|
|
|
|
$new_status->create();
|
|
|
|
return $new_status;
|
|
}
|
|
}
|
|
|
|
?>
|