|
|
|
@@ -0,0 +1,616 @@
|
|
|
|
|
<?PHP
|
|
|
|
|
/**
|
|
|
|
|
* Plausability checker for object events.
|
|
|
|
|
*
|
|
|
|
|
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
|
|
|
|
|
*/
|
|
|
|
|
declare(strict_types = 1);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Plausability checker for object events.
|
|
|
|
|
*/
|
|
|
|
|
final class MDPlausi {
|
|
|
|
|
|
|
|
|
|
const UNKNOWN_TIME_MAX = MDRequirementsSet::TIME_LATEST_YEAR;
|
|
|
|
|
const UNKNOWN_TIME_MIN = MDRequirementsSet::TIME_EARLIEST_YEAR;
|
|
|
|
|
|
|
|
|
|
private readonly int $default_time_max;
|
|
|
|
|
private readonly int $default_time_min;
|
|
|
|
|
|
|
|
|
|
private MDTlLoader $_tlLoader;
|
|
|
|
|
|
|
|
|
|
/** @var array<MDPlausiEvent> */
|
|
|
|
|
private array $_events;
|
|
|
|
|
/** @var array<string> */
|
|
|
|
|
private array $_messageList = [];
|
|
|
|
|
private bool $_hasCertainWarnings = false; // True === 'alarm'
|
|
|
|
|
|
|
|
|
|
private bool $_is_print_material;
|
|
|
|
|
private bool $_is_painted_drawn;
|
|
|
|
|
|
|
|
|
|
private MDPlausiEventCategory $_production;
|
|
|
|
|
private MDPlausiEventCategory $_pre_production;
|
|
|
|
|
private MDPlausiEventCategory $_post_production;
|
|
|
|
|
private MDPlausiEventCategory $_printing_plate;
|
|
|
|
|
private MDPlausiEventCategory $_template_creation;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Checks whether events themselves are logical regarding the birth and
|
|
|
|
|
* death dates vis-a-vis the stated time.
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
private function _checkPlausibilityOnBirthDeath():void {
|
|
|
|
|
|
|
|
|
|
if (empty($this->_events)) return;
|
|
|
|
|
|
|
|
|
|
// Get values for time_entries and actor_life dates from nodac
|
|
|
|
|
|
|
|
|
|
foreach ($this->_events as $event) {
|
|
|
|
|
|
|
|
|
|
// Evaluating actor birth
|
|
|
|
|
if ($event->actor_birth_normalized !== false) {
|
|
|
|
|
|
|
|
|
|
// Work on the object started before the actor was born
|
|
|
|
|
if ($event->time_start_normalized !== false && $event->time_start_normalized < $event->actor_birth_normalized) {
|
|
|
|
|
$this->_messageList[] = '<b>' . $this->_tlLoader->tl("eventtype_name", "eventname", (string)$event->event_type) . '</b> (' . $event->time_name . ') ' . $this->_tlLoader->tl("quality", "quality", "before_birth_possibly") . ' ' . $event->actor_name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// The actor was involved with the object totally before they were born
|
|
|
|
|
// Ended being involved before birth
|
|
|
|
|
|
|
|
|
|
else if ($event->time_end_normalized !== false && $event->time_end_normalized < $event->actor_birth_normalized) {
|
|
|
|
|
$this->_messageList[] = '<b>' . $this->_tlLoader->tl("eventtype_name", "eventname", (string)$event->event_type) . '</b> (' . $event->time_name . ') ' . $this->_tlLoader->tl("quality", "quality", "before_birth") . ' ' . $event->actor_name;
|
|
|
|
|
$this->_hasCertainWarnings = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Evaluate actor death
|
|
|
|
|
if ($event->actor_death_normalized !== false) {
|
|
|
|
|
|
|
|
|
|
// Check if the actor died before they started being involved with the object
|
|
|
|
|
if ($event->time_start_normalized !== false && $event->actor_death_normalized < $event->time_start_normalized) {
|
|
|
|
|
$this->_messageList[] = '<b>' . $this->_tlLoader->tl("eventtype_name", "eventname", (string)$event->event_type) . '</b> (' . $event->time_name . ') ' . $this->_tlLoader->tl("quality", "quality", "after_death") . ' ' . $event->actor_name;
|
|
|
|
|
$this->_hasCertainWarnings = true;
|
|
|
|
|
}
|
|
|
|
|
else if ($event->time_end_normalized !== false && $event->actor_death_normalized < $event->time_end_normalized) {
|
|
|
|
|
$this->_messageList[] = '<b>' . $this->_tlLoader->tl("eventtype_name", "eventname", (string)$event->event_type) . '</b> (' . $event->time_name . ') ' . $this->_tlLoader->tl("quality", "quality", "after_death_possibly") . ' ' . $event->actor_name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Evaluates the relation between template creation, printing plate or drawing dates.
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
public function _evaluateTemplateStatus():void {
|
|
|
|
|
|
|
|
|
|
// Printing plate was produced before template was even started
|
|
|
|
|
if ($this->_printing_plate->latest_event_type !== 0
|
|
|
|
|
&& $this->_template_creation->earliest_event_type !== 0
|
|
|
|
|
&& $this->_printing_plate->latest < $this->_template_creation->earliest) {
|
|
|
|
|
|
|
|
|
|
$message = '<b>' . $this->_tlLoader->tl("eventtype_name", "eventname", "12") . '</b>';
|
|
|
|
|
|
|
|
|
|
$message .= $this->_printing_plate->formulateMessagePartForLatest($this->_tlLoader);
|
|
|
|
|
|
|
|
|
|
$message .= ' ' . $this->_tlLoader->tl("quality", "quality", "before") . ' <b>' . $this->_tlLoader->tl("eventtype_name", "eventname", "4") . '</b>';
|
|
|
|
|
|
|
|
|
|
$message .= $this->_template_creation->formulateMessagePartForEarliest($this->_tlLoader);
|
|
|
|
|
|
|
|
|
|
$this->_messageList[] = $message;
|
|
|
|
|
$this->_hasCertainWarnings = true;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// Printing plate was produced before template was finished
|
|
|
|
|
else if ($this->_printing_plate->latest_event_type !== 0
|
|
|
|
|
&& $this->_template_creation->latest_event_type !== 0
|
|
|
|
|
&& $this->_printing_plate->latest < $this->_template_creation->latest) {
|
|
|
|
|
|
|
|
|
|
$message = '<b>' . $this->_tlLoader->tl("eventtype_name", "eventname", "12") . '</b>';
|
|
|
|
|
|
|
|
|
|
$message .= $this->_printing_plate->formulateMessagePartForLatest($this->_tlLoader);
|
|
|
|
|
|
|
|
|
|
$message .= ' ' . $this->_tlLoader->tl("quality", "quality", "before_possibly") . ' <b>' . $this->_tlLoader->tl("eventtype_name", "eventname", "4") . '</b>';
|
|
|
|
|
|
|
|
|
|
$message .= $this->_template_creation->formulateMessagePartForLatest($this->_tlLoader);
|
|
|
|
|
|
|
|
|
|
$this->_messageList[] = $message;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Adds a warning message if an object was both drawn and printed
|
|
|
|
|
* (prints of drawn materials make the drawing a template).
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
private function _evaluateDrawingsWhichArePrinted():void {
|
|
|
|
|
|
|
|
|
|
// Paintings should not be printed at the same time
|
|
|
|
|
if ($this->_is_painted_drawn === true and $this->_is_print_material === true) {
|
|
|
|
|
|
|
|
|
|
$message = '<b>' . $this->_tlLoader->tl("quality", "quality", "print_not_paint") . '</b> ' . $this->_tlLoader->tl("quality", "quality", "better_use") . ' "' . $this->_tlLoader->tl("eventtype_name", "eventname", "4") . '" . ';
|
|
|
|
|
$this->_hasCertainWarnings = true;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Evaluates if an object's preproduction (e.g. template) took place after the object was
|
|
|
|
|
* already produced.
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
private function _evaluatePreproductionAfterProduction():void {
|
|
|
|
|
|
|
|
|
|
// Printing plate was produced before template was finished
|
|
|
|
|
if ($this->_production->latest_event_type !== 0
|
|
|
|
|
&& $this->_pre_production->earliest_event_type !== 0
|
|
|
|
|
&& $this->_production->latest < $this->_pre_production->earliest) {
|
|
|
|
|
|
|
|
|
|
$message = '<b>' . $this->_tlLoader->tl("eventtype_name", "eventname", (string)$this->_production->latest_event_type) . '</b>';
|
|
|
|
|
|
|
|
|
|
$message .= $this->_production->formulateMessagePartForLatest($this->_tlLoader);
|
|
|
|
|
|
|
|
|
|
$message .= ' ' . $this->_tlLoader->tl("quality", "quality", "before") . ' <b>' . $this->_tlLoader->tl("eventtype_name", "eventname", (string)$this->_pre_production->earliest_event_type) . '</b>';
|
|
|
|
|
|
|
|
|
|
$message .= $this->_pre_production->formulateMessagePartForEarliest($this->_tlLoader);
|
|
|
|
|
|
|
|
|
|
$this->_messageList[] = $message;
|
|
|
|
|
$this->_hasCertainWarnings = true;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Printing plate was produced before template was finished
|
|
|
|
|
else if ($this->_production->latest_event_type !== 0
|
|
|
|
|
&& $this->_pre_production->latest_event_type !== 0
|
|
|
|
|
&& $this->_production->latest < $this->_pre_production->latest) {
|
|
|
|
|
|
|
|
|
|
$message = '<b>' . $this->_tlLoader->tl("eventtype_name", "eventname", (string)$this->_production->latest_event_type) . '</b>';
|
|
|
|
|
|
|
|
|
|
$message .= $this->_production->formulateMessagePartForLatest($this->_tlLoader);
|
|
|
|
|
|
|
|
|
|
$message .= ' ' . $this->_tlLoader->tl("quality", "quality", "before_possibly") . ' <b>' . $this->_tlLoader->tl("eventtype_name", "eventname", (string)$this->_pre_production->latest_event_type) . '</b>';
|
|
|
|
|
|
|
|
|
|
$message .= $this->_pre_production->formulateMessagePartForLatest($this->_tlLoader);
|
|
|
|
|
|
|
|
|
|
$this->_messageList[] = $message;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Evaluates if an object's preproduction (e.g. template) took place after the object was
|
|
|
|
|
* already being used (or otherwise interacted with past it's completion).
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
private function _evaluatePreproductionAfterPostproduction():void {
|
|
|
|
|
|
|
|
|
|
// Printing plate was postproduced before template was finished
|
|
|
|
|
if ($this->_post_production->latest_event_type !== 0
|
|
|
|
|
&& $this->_pre_production->earliest_event_type !== 0
|
|
|
|
|
&& $this->_post_production->latest < $this->_pre_production->earliest) {
|
|
|
|
|
|
|
|
|
|
$message = '<b>' . $this->_tlLoader->tl("eventtype_name", "eventname", (string)$this->_post_production->latest_event_type) . '</b>';
|
|
|
|
|
|
|
|
|
|
$message .= $this->_post_production->formulateMessagePartForLatest($this->_tlLoader);
|
|
|
|
|
|
|
|
|
|
$message .= ' ' . $this->_tlLoader->tl("quality", "quality", "before") . ' <b>' . $this->_tlLoader->tl("eventtype_name", "eventname", (string)$this->_pre_production->earliest_event_type) . '</b>';
|
|
|
|
|
|
|
|
|
|
$message .= $this->_pre_production->formulateMessagePartForEarliest($this->_tlLoader);
|
|
|
|
|
|
|
|
|
|
$this->_messageList[] = $message;
|
|
|
|
|
$this->_hasCertainWarnings = true;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// E.g. template creation after being all use was finished
|
|
|
|
|
else if ($this->_post_production->latest_event_type !== 0
|
|
|
|
|
&& $this->_pre_production->latest_event_type !== 0
|
|
|
|
|
&& $this->_post_production->latest < $this->_pre_production->latest) {
|
|
|
|
|
|
|
|
|
|
$message = '<b>' . $this->_tlLoader->tl("eventtype_name", "eventname", (string)$this->_post_production->latest_event_type) . '</b>';
|
|
|
|
|
|
|
|
|
|
$message .= $this->_post_production->formulateMessagePartForLatest($this->_tlLoader);
|
|
|
|
|
|
|
|
|
|
$message .= ' ' . $this->_tlLoader->tl("quality", "quality", "before") . ' <b>' . $this->_tlLoader->tl("eventtype_name", "eventname", (string)$this->_pre_production->latest_event_type) . '</b>';
|
|
|
|
|
|
|
|
|
|
$message .= $this->_pre_production->formulateMessagePartForLatest($this->_tlLoader);
|
|
|
|
|
|
|
|
|
|
$this->_messageList[] = $message;
|
|
|
|
|
$this->_hasCertainWarnings = true;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// E.g. template creation was only started after the object was beyond use
|
|
|
|
|
// This may happen, if the template is for renovations or so. Hence, there is
|
|
|
|
|
// only a warning here.
|
|
|
|
|
else if ($this->_post_production->earliest_event_type !== 0
|
|
|
|
|
&& $this->_pre_production->earliest_event_type !== 0
|
|
|
|
|
&& $this->_post_production->earliest < $this->_pre_production->earliest) {
|
|
|
|
|
|
|
|
|
|
$message = '<b>' . $this->_tlLoader->tl("eventtype_name", "eventname", (string)$this->_post_production->earliest_event_type) . '</b>';
|
|
|
|
|
|
|
|
|
|
$message .= $this->_post_production->formulateMessagePartForEarliest($this->_tlLoader);
|
|
|
|
|
|
|
|
|
|
$message .= ' ' . $this->_tlLoader->tl("quality", "quality", "before_possibly") . ' <b>' . $this->_tlLoader->tl("eventtype_name", "eventname", (string)$this->_pre_production->earliest_event_type) . '</b>';
|
|
|
|
|
|
|
|
|
|
$message .= $this->_pre_production->formulateMessagePartForEarliest($this->_tlLoader);
|
|
|
|
|
|
|
|
|
|
$this->_messageList[] = $message;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Evaluates if an object's production (e.g. template) took place after the object was
|
|
|
|
|
* already being used (or otherwise interacted with past it's completion).
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
private function _evaluateProductionAfterPostproduction():void {
|
|
|
|
|
|
|
|
|
|
if ($this->_post_production->earliest_event_type !== 0
|
|
|
|
|
&& $this->_production->earliest_event_type !== 0
|
|
|
|
|
&& $this->_post_production->earliest < $this->_production->earliest) {
|
|
|
|
|
|
|
|
|
|
$message = '<b>' . $this->_tlLoader->tl("eventtype_name", "eventname", (string)$this->_post_production->earliest_event_type) . '</b>';
|
|
|
|
|
|
|
|
|
|
$message .= $this->_post_production->formulateMessagePartForEarliest($this->_tlLoader);
|
|
|
|
|
|
|
|
|
|
$message .= ' ' . $this->_tlLoader->tl("quality", "quality", "before") . ' <b>' . $this->_tlLoader->tl("eventtype_name", "eventname", (string)$this->_production->earliest_event_type) . '</b>';
|
|
|
|
|
|
|
|
|
|
$message .= $this->_production->formulateMessagePartForEarliest($this->_tlLoader);
|
|
|
|
|
|
|
|
|
|
$this->_messageList[] = $message;
|
|
|
|
|
$this->_hasCertainWarnings = true;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
else if ($this->_post_production->earliest_event_type !== 0
|
|
|
|
|
&& $this->_production->latest_event_type !== 0
|
|
|
|
|
&& $this->_post_production->earliest < $this->_production->latest) {
|
|
|
|
|
|
|
|
|
|
$message = '<b>' . $this->_tlLoader->tl("eventtype_name", "eventname", (string)$this->_post_production->earliest_event_type) . '</b>';
|
|
|
|
|
|
|
|
|
|
$message .= $this->_post_production->formulateMessagePartForEarliest($this->_tlLoader);
|
|
|
|
|
|
|
|
|
|
$message .= ' ' . $this->_tlLoader->tl("quality", "quality", "before_possibly") . ' <b>' . $this->_tlLoader->tl("eventtype_name", "eventname", (string)$this->_production->latest_event_type) . '</b>';
|
|
|
|
|
|
|
|
|
|
$message .= $this->_production->formulateMessagePartForLatest($this->_tlLoader);
|
|
|
|
|
|
|
|
|
|
$this->_messageList[] = $message;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if ($this->_post_production->latest_event_type !== 0
|
|
|
|
|
&& $this->_production->latest_event_type !== 0
|
|
|
|
|
&& $this->_post_production->latest < $this->_production->latest) {
|
|
|
|
|
|
|
|
|
|
$message = '<b>' . $this->_tlLoader->tl("eventtype_name", "eventname", (string)$this->_post_production->latest_event_type) . '</b>';
|
|
|
|
|
|
|
|
|
|
$message .= $this->_post_production->formulateMessagePartForLatest($this->_tlLoader);
|
|
|
|
|
|
|
|
|
|
$message .= ' ' . $this->_tlLoader->tl("quality", "quality", "before_possibly") . ' <b>' . $this->_tlLoader->tl("eventtype_name", "eventname", (string)$this->_production->latest_event_type) . '</b>';
|
|
|
|
|
|
|
|
|
|
$message .= $this->_production->formulateMessagePartForLatest($this->_tlLoader);
|
|
|
|
|
|
|
|
|
|
$this->_messageList[] = $message;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Warns if an actor was displayed on an object finished before they were born.
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
private function _checkActorDisplayedBeforeBirth():void {
|
|
|
|
|
|
|
|
|
|
foreach ($this->_events as $event) {
|
|
|
|
|
|
|
|
|
|
// Ignore events other than "was displayed"
|
|
|
|
|
if ($event->event_type !== 5) continue;
|
|
|
|
|
|
|
|
|
|
if ($event->actor_birth_normalized !== false
|
|
|
|
|
&& $this->_production->latest_event_type !== 0
|
|
|
|
|
&& $event->actor_birth_normalized > $this->_production->latest
|
|
|
|
|
) {
|
|
|
|
|
|
|
|
|
|
$message = '<b>' . $this->_tlLoader->tl("eventtype_name", "eventname", (string)$this->_production->latest_event_type) . '</b>';
|
|
|
|
|
|
|
|
|
|
$message .= $this->_production->formulateMessagePartForLatest($this->_tlLoader);
|
|
|
|
|
|
|
|
|
|
$message .= ' ' . $this->_tlLoader->tl("quality", "quality", "before") . ' <b>' . $this->_tlLoader->tl("eventtype_name", "eventname", "5") . '</b>';
|
|
|
|
|
$message .= ' (' . $this->_tlLoader->tl("basis", "basis", "actor_short") . ': ' . $event->actor_name . ' (* ' . $event->actor_birth . '))';
|
|
|
|
|
|
|
|
|
|
$this->_messageList[] = $message;
|
|
|
|
|
$this->_hasCertainWarnings = true;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Checks plausibility by event category.
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
private function _checkIllogicalEventsByCategory():void {
|
|
|
|
|
|
|
|
|
|
$this->_evaluateTemplateStatus();
|
|
|
|
|
$this->_evaluateDrawingsWhichArePrinted();
|
|
|
|
|
$this->_evaluatePreproductionAfterProduction();
|
|
|
|
|
$this->_evaluatePreproductionAfterPostproduction();
|
|
|
|
|
$this->_evaluateProductionAfterPostproduction();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Runs the available evaluations.
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
public function evaluate():void {
|
|
|
|
|
|
|
|
|
|
$this->_checkPlausibilityOnBirthDeath();
|
|
|
|
|
$this->_checkIllogicalEventsByCategory();
|
|
|
|
|
$this->_checkActorDisplayedBeforeBirth();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Setup function for setting event categories.
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
public function _categorizeEvents():void {
|
|
|
|
|
|
|
|
|
|
foreach ($this->_events as $event) {
|
|
|
|
|
|
|
|
|
|
if ($event->actor_death_normalized !== false) {
|
|
|
|
|
$actor_death = date("Y", $event->actor_death_normalized);
|
|
|
|
|
}
|
|
|
|
|
else $actor_death = self::UNKNOWN_TIME_MIN;
|
|
|
|
|
|
|
|
|
|
switch ($event->event_category) {
|
|
|
|
|
case MDEventCategory::production:
|
|
|
|
|
|
|
|
|
|
if ($event->time_start_normalized !== false && $this->_production->earliest > $event->time_start_normalized) {
|
|
|
|
|
$this->_production->earliest = $event->time_start_normalized;
|
|
|
|
|
$this->_production->earliest_name = $event->time_name;
|
|
|
|
|
$this->_production->earliest_time_name = $event->time_start;
|
|
|
|
|
$this->_production->earliest_source = 'time';
|
|
|
|
|
$this->_production->earliest_event_type = $event->event_type;
|
|
|
|
|
}
|
|
|
|
|
if ($event->time_end_normalized !== false && $this->_production->latest < $event->time_end_normalized) {
|
|
|
|
|
$this->_production->latest = $event->time_end_normalized;
|
|
|
|
|
$this->_production->latest_name = $event->time_name;
|
|
|
|
|
$this->_production->latest_time_name = $event->time_end;
|
|
|
|
|
$this->_production->latest_source = 'time';
|
|
|
|
|
$this->_production->latest_event_type = $event->event_type;
|
|
|
|
|
}
|
|
|
|
|
if ($event->actor_birth_normalized !== false && $this->_production->earliest > $event->actor_birth_normalized) {
|
|
|
|
|
$this->_production->earliest = $event->actor_birth_normalized;
|
|
|
|
|
$this->_production->earliest_name = $event->actor_name;
|
|
|
|
|
$this->_production->earliest_time_name = $event->actor_birth;
|
|
|
|
|
$this->_production->earliest_source = 'actor';
|
|
|
|
|
$this->_production->earliest_event_type = $event->event_type;
|
|
|
|
|
}
|
|
|
|
|
if ($event->actor_death_normalized !== false && $this->_production->latest < $event->actor_death_normalized) {
|
|
|
|
|
$this->_production->latest = $event->actor_death_normalized;
|
|
|
|
|
$this->_production->latest_name = $event->actor_name;
|
|
|
|
|
$this->_production->latest_time_name = $event->actor_death;
|
|
|
|
|
$this->_production->latest_source = 'actor';
|
|
|
|
|
$this->_production->latest_event_type = $event->event_type;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case MDEventCategory::pre_production:
|
|
|
|
|
|
|
|
|
|
if ($event->time_start_normalized !== false && $this->_pre_production->earliest > $event->time_start_normalized) {
|
|
|
|
|
$this->_pre_production->earliest = $event->time_start_normalized;
|
|
|
|
|
$this->_pre_production->earliest_name = $event->time_name;
|
|
|
|
|
$this->_pre_production->earliest_time_name = $event->time_start;
|
|
|
|
|
$this->_pre_production->earliest_source = 'time';
|
|
|
|
|
$this->_pre_production->earliest_event_type = $event->event_type;
|
|
|
|
|
}
|
|
|
|
|
if ($event->time_end_normalized !== false && $this->_pre_production->latest < $event->time_end_normalized) {
|
|
|
|
|
$this->_pre_production->latest = $event->time_end_normalized;
|
|
|
|
|
$this->_pre_production->latest_name = $event->time_name;
|
|
|
|
|
$this->_pre_production->latest_time_name = $event->time_end;
|
|
|
|
|
$this->_pre_production->latest_source = 'time';
|
|
|
|
|
$this->_pre_production->latest_event_type = $event->event_type;
|
|
|
|
|
}
|
|
|
|
|
if ($event->actor_birth_normalized !== false && $this->_pre_production->earliest > $event->actor_birth_normalized) {
|
|
|
|
|
$this->_pre_production->earliest = $event->actor_birth_normalized;
|
|
|
|
|
$this->_pre_production->earliest_name = $event->actor_name;
|
|
|
|
|
$this->_pre_production->earliest_time_name = $event->actor_birth;
|
|
|
|
|
$this->_pre_production->earliest_source = 'actor';
|
|
|
|
|
$this->_pre_production->earliest_event_type = $event->event_type;
|
|
|
|
|
}
|
|
|
|
|
if ($event->actor_death_normalized !== false && $this->_pre_production->latest < $event->actor_death_normalized) {
|
|
|
|
|
$this->_pre_production->latest = $event->actor_death_normalized;
|
|
|
|
|
$this->_pre_production->latest_name = $event->actor_name;
|
|
|
|
|
$this->_pre_production->latest_time_name = $event->actor_death;
|
|
|
|
|
$this->_pre_production->latest_source = 'actor';
|
|
|
|
|
$this->_pre_production->latest_event_type = $event->event_type;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case MDEventCategory::post_production:
|
|
|
|
|
|
|
|
|
|
if ($event->time_start_normalized !== false && $this->_post_production->earliest > $event->time_start_normalized) {
|
|
|
|
|
$this->_post_production->earliest = $event->time_start_normalized;
|
|
|
|
|
$this->_post_production->earliest_name = $event->time_name;
|
|
|
|
|
$this->_post_production->earliest_time_name = $event->time_start;
|
|
|
|
|
$this->_post_production->earliest_source = 'time';
|
|
|
|
|
$this->_post_production->earliest_event_type = $event->event_type;
|
|
|
|
|
}
|
|
|
|
|
if ($event->time_end_normalized !== false && $this->_post_production->latest < $event->time_end_normalized) {
|
|
|
|
|
$this->_post_production->latest = $event->time_end_normalized;
|
|
|
|
|
$this->_post_production->latest_name = $event->time_name;
|
|
|
|
|
$this->_post_production->latest_time_name = $event->time_end;
|
|
|
|
|
$this->_post_production->latest_source = 'time';
|
|
|
|
|
$this->_post_production->latest_event_type = $event->event_type;
|
|
|
|
|
}
|
|
|
|
|
if ($event->actor_birth_normalized !== false && $this->_post_production->earliest > $event->actor_birth_normalized) {
|
|
|
|
|
$this->_post_production->earliest = $event->actor_birth_normalized;
|
|
|
|
|
$this->_post_production->earliest_name = $event->actor_name;
|
|
|
|
|
$this->_post_production->earliest_time_name = $event->actor_birth;
|
|
|
|
|
$this->_post_production->earliest_source = 'actor';
|
|
|
|
|
$this->_post_production->earliest_event_type = $event->event_type;
|
|
|
|
|
}
|
|
|
|
|
if ($event->actor_death_normalized !== false && $this->_post_production->latest < $event->actor_death_normalized) {
|
|
|
|
|
$this->_post_production->latest = $event->actor_death_normalized;
|
|
|
|
|
$this->_post_production->latest_name = $event->actor_name;
|
|
|
|
|
$this->_post_production->latest_time_name = $event->actor_death;
|
|
|
|
|
$this->_post_production->latest_source = 'actor';
|
|
|
|
|
$this->_post_production->latest_event_type = $event->event_type;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($event->event_type === 9 || $event->event_type === 19) {
|
|
|
|
|
$this->_is_painted_drawn = true;
|
|
|
|
|
}
|
|
|
|
|
if ($event->event_type === 4) {
|
|
|
|
|
|
|
|
|
|
if ($event->time_start_normalized !== false && $this->_template_creation->earliest > $event->time_start_normalized) {
|
|
|
|
|
$this->_template_creation->earliest = $event->time_start_normalized;
|
|
|
|
|
$this->_template_creation->earliest_name = $event->time_name;
|
|
|
|
|
$this->_template_creation->earliest_time_name = $event->time_start;
|
|
|
|
|
$this->_template_creation->earliest_source = 'time';
|
|
|
|
|
$this->_template_creation->earliest_event_type = $event->event_type;
|
|
|
|
|
}
|
|
|
|
|
if ($event->time_end_normalized !== false && $this->_template_creation->latest < $event->time_end_normalized) {
|
|
|
|
|
$this->_template_creation->latest = $event->time_end_normalized;
|
|
|
|
|
$this->_template_creation->latest_name = $event->time_name;
|
|
|
|
|
$this->_template_creation->latest_time_name = $event->time_end;
|
|
|
|
|
$this->_template_creation->latest_source = 'time';
|
|
|
|
|
$this->_template_creation->latest_event_type = $event->event_type;
|
|
|
|
|
}
|
|
|
|
|
if ($event->actor_birth_normalized !== false && $this->_template_creation->earliest > $event->actor_birth_normalized) {
|
|
|
|
|
$this->_template_creation->earliest = $event->actor_birth_normalized;
|
|
|
|
|
$this->_template_creation->earliest_name = $event->actor_name;
|
|
|
|
|
$this->_template_creation->earliest_time_name = $event->actor_birth;
|
|
|
|
|
$this->_template_creation->earliest_source = 'actor';
|
|
|
|
|
$this->_template_creation->earliest_event_type = $event->event_type;
|
|
|
|
|
}
|
|
|
|
|
if ($event->actor_death_normalized !== false && $this->_template_creation->latest < $event->actor_death_normalized) {
|
|
|
|
|
$this->_template_creation->latest = $event->actor_death_normalized;
|
|
|
|
|
$this->_template_creation->latest_name = $event->actor_name;
|
|
|
|
|
$this->_template_creation->latest_time_name = $event->actor_death;
|
|
|
|
|
$this->_template_creation->latest_source = 'actor';
|
|
|
|
|
$this->_template_creation->latest_event_type = $event->event_type;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if ($event->event_type === 12) {
|
|
|
|
|
|
|
|
|
|
if ($event->time_start_normalized !== false && $this->_printing_plate->earliest > $event->time_start_normalized) {
|
|
|
|
|
$this->_printing_plate->earliest = $event->time_start_normalized;
|
|
|
|
|
$this->_printing_plate->earliest_name = $event->time_name;
|
|
|
|
|
$this->_printing_plate->earliest_time_name = $event->time_start;
|
|
|
|
|
$this->_printing_plate->earliest_source = 'time';
|
|
|
|
|
$this->_printing_plate->earliest_event_type = $event->event_type;
|
|
|
|
|
}
|
|
|
|
|
if ($event->time_end_normalized !== false && $this->_printing_plate->latest < $event->time_end_normalized) {
|
|
|
|
|
$this->_printing_plate->latest = $event->time_end_normalized;
|
|
|
|
|
$this->_printing_plate->latest_name = $event->time_name;
|
|
|
|
|
$this->_printing_plate->latest_time_name = $event->time_end;
|
|
|
|
|
$this->_printing_plate->latest_source = 'time';
|
|
|
|
|
$this->_printing_plate->latest_event_type = $event->event_type;
|
|
|
|
|
}
|
|
|
|
|
if ($event->actor_birth_normalized !== false && $this->_printing_plate->earliest > $event->actor_birth_normalized) {
|
|
|
|
|
$this->_printing_plate->earliest = $event->actor_birth_normalized;
|
|
|
|
|
$this->_printing_plate->earliest_name = $event->actor_name;
|
|
|
|
|
$this->_printing_plate->earliest_time_name = $event->actor_birth;
|
|
|
|
|
$this->_printing_plate->earliest_source = 'actor';
|
|
|
|
|
$this->_printing_plate->earliest_event_type = $event->event_type;
|
|
|
|
|
}
|
|
|
|
|
if ($event->actor_death_normalized !== false && $this->_printing_plate->latest < $event->actor_death_normalized) {
|
|
|
|
|
$this->_printing_plate->latest = $event->actor_death_normalized;
|
|
|
|
|
$this->_printing_plate->latest_name = $event->actor_name;
|
|
|
|
|
$this->_printing_plate->latest_time_name = $event->actor_death;
|
|
|
|
|
$this->_printing_plate->latest_source = 'actor';
|
|
|
|
|
$this->_printing_plate->latest_event_type = $event->event_type;
|
|
|
|
|
}
|
|
|
|
|
$this->_is_print_material = true;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!isset($this->_is_painted_drawn)) $this->_is_painted_drawn = true;
|
|
|
|
|
if (!isset($this->_is_print_material)) $this->_is_print_material = true;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the message list.
|
|
|
|
|
*
|
|
|
|
|
* @return array<string>
|
|
|
|
|
*/
|
|
|
|
|
public function getMessages():array {
|
|
|
|
|
|
|
|
|
|
return $this->_messageList;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the warning status.
|
|
|
|
|
*
|
|
|
|
|
* @return boolean
|
|
|
|
|
*/
|
|
|
|
|
public function getWarningStatus():bool {
|
|
|
|
|
|
|
|
|
|
return $this->_hasCertainWarnings;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Constructor.
|
|
|
|
|
*
|
|
|
|
|
* @param MDTlLoader $tlLoader Translation loader.
|
|
|
|
|
* @param array<MDPlausiEvent> $events Events.
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
public function __construct(MDTlLoader $tlLoader, array $events) {
|
|
|
|
|
|
|
|
|
|
$this->_tlLoader = $tlLoader;
|
|
|
|
|
$this->_events = $events;
|
|
|
|
|
|
|
|
|
|
$this->default_time_max = time();
|
|
|
|
|
$this->default_time_min = -99999999999999999;
|
|
|
|
|
|
|
|
|
|
$this->_production = new MDPlausiEventCategory($this->default_time_max, $this->default_time_min);
|
|
|
|
|
$this->_pre_production = new MDPlausiEventCategory($this->default_time_max, $this->default_time_min);
|
|
|
|
|
$this->_post_production = new MDPlausiEventCategory($this->default_time_max, $this->default_time_min);
|
|
|
|
|
$this->_printing_plate = new MDPlausiEventCategory($this->default_time_max, $this->default_time_min);
|
|
|
|
|
$this->_template_creation = new MDPlausiEventCategory($this->default_time_max, $this->default_time_min);
|
|
|
|
|
|
|
|
|
|
$this->_categorizeEvents();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|