/** * Outputs the object as HTML. * @param JOB $entry * @access private */ protected function _display_as_html($entry) { ?> <div> <table class="basic columns left-labels"> <tr> <th>Kind</th> <td> <?php $props = $entry->kind_properties(); echo $this->app->get_icon_with_text($props->icon, Sixteen_px, $entry->kind_as_text()); ?> </td> </tr> <?php if ($entry->component_id) { $comp = $entry->component(); ?> <tr> <th>Component</th> <td> <?php echo $this->app->get_icon_with_text($comp->icon_url, Sixteen_px, $comp->title_as_link()); ?> </td> </tr> <?php } if ($entry->time_needed->is_valid()) { ?> <tr> <th>Needed By</th> <td> <?php $f = $entry->time_needed->formatter(); $f->type = Date_time_format_date_only; echo $entry->time_needed->format($f); ?> </td> </tr> <?php } ?> <tr> <th>Assigned to</th> <td> <?php $assignee = $entry->assignee(); if ($assignee) { $text = $assignee->title_as_link(); $time_owned = $entry->assignee_age(); if (isset($time_owned)) { $text .= ' (' . $time_owned->format() . ')'; } } else { $text = '(None)'; } echo $this->app->get_icon_with_text($entry->get_assignee_icon_url(), Sixteen_px, $text); ?> </td> </tr> <?php $creator = $entry->creator(); $reporter = $entry->reporter(); if (!$reporter->equals($creator)) { ?> <tr> <th>Reported By</th> <td> <?php if ($reporter) { echo $reporter->title_as_link(); } else { echo '(None)'; } ?> </td> </tr> <?php } if (!$this->_hide_users) { ?> <tr> <th>Created</th> <td> <?php echo $entry->time_created->format(); ?> by <?php echo $creator->title_as_link(); ?> </td> </tr> <?php if (!$entry->time_created->equals($entry->time_modified)) { $modifier = $entry->modifier(); ?> <tr> <th>Modified</th> <td><?php echo $entry->time_modified->format(); ?> by <?php echo $modifier->title_as_link(); ?> </td> </tr> <?php } } ?> </table> <?php $this->_echo_branches_as_html($entry); ?> </div> <?php $this->_echo_html_description($entry); $this->_echo_html_extra_description($entry); }
/** * Draw user-specific information for the given release. * @param JOB $obj * @param JOB_BRANCH_INFO $branch_info */ protected function _draw_user_details($obj, $branch_info) { $is_closed = $branch_info->is_closed(); $time_open = $branch_info->age(); $time_in_status = $branch_info->status_age(); if (!$is_closed) { $needed_by = $branch_info->needed_by_as_html(); if ($needed_by) { ?> <div> <?php echo $needed_by; ?> </div> <?php } } ?> <div> <span class="field"><?php $status_props = $branch_info->status_properties(); echo $this->app->get_icon_with_text($status_props->icon, Sixteen_px, $status_props->title); ?> </span> <?php if ($is_closed) { $closer = $branch_info->closer(); ?> (<?php echo $branch_info->time_closed->format(); ?> by <?php echo $closer->title_as_link(); ?> after <?php echo $time_open->format(); ?> ) <?php } else { if ($time_open->equals($time_in_status)) { ?> (<?php echo $time_open->format(); ?> ) <?php } else { ?> – <?php echo $time_in_status->format(); ?> (open for <?php echo $time_open->format(); ?> ) <?php } } ?> </div> <?php if (!$is_closed) { ?> <div> <?php $priority_props = $branch_info->priority_properties(); echo $this->app->get_icon_with_text($priority_props->icon, Sixteen_px, $priority_props->title); ?> </div> <?php } ?> <div> <div> <?php if (!$is_closed) { $assignee = $obj->assignee(); if ($assignee) { $text = 'Assigned to ' . $assignee->title_as_link(); $time_owned = $obj->assignee_age(); if (isset($time_owned)) { $text .= ' (' . $time_owned->format() . ')'; } } else { $text = 'Not assigned'; } echo $this->app->get_icon_with_text($obj->get_assignee_icon_url(), Sixteen_px, $text); } ?> </div> <div class="clear-both"></div> </div> <?php }