headTitle()->set($job->getId())->setTranslatorEnabled(false); // prepare by-line text for the popover title $createdBy = $job->hasCreatedByField() ? $job->get($job->getCreatedByField()) : null; $modifiedBy = $job->hasModifiedByField() ? $job->get($job->getModifiedByField()) : null; $created = $job->hasCreatedDateField() ? $job->getAsTime($job->getCreatedDateField()) : null; $modified = $job->hasModifiedDateField() ? $job->getAsTime($job->getModifiedDateField()) : null; $view = $this; $renderDate = function ($time) use ($view) { return ''; }; if ($createdBy && $modifiedBy && $created && $modified) { $user = $createdBy; $byLine = $this->userLink($createdBy) . ' ' . $this->te('created this job') . ' ' . $renderDate($created); if ($created !== $modified) { $byLine .= ", " . $this->t('modified by') . ' ' . $this->userLink($modifiedBy) . ' ' . $renderDate($modified); } } else if ($createdBy && $modified) { $user = $createdBy; $byLine = $this->userLink($createdBy) . ' ' . $this->t('created this job') . ($modified === $created ? ' ' : ', ' . $this->t('last modified') . ' ') . $renderDate($modified); } else { $user = $job->getUser(); $byLine = $this->userLink($user) . ' ' . $this->te('modified this job') . ' ' . $renderDate($job->getTime()); } // prepare job status $status = ucwords($job->getStatus()); $class = 'status-' . strtolower($status); ?>