Пример #1
0
 /**
  * @param RELEASE $obj
  * @access private
  */
 protected function _draw_box($obj)
 {
     $creator = $obj->creator();
     $this->_display_start_minimal_commands_block($obj);
     ?>
 <h3>
   <?php 
     echo $this->obj_link($obj);
     ?>
 </h3>
 <p class="info-box-top">
   <?php 
     echo 'Created ';
     if ($this->show_user) {
         echo 'by ' . $creator->title_as_link() . ' - ';
     }
     echo $obj->time_created->format();
     if (!$obj->time_created->equals($obj->time_modified)) {
         $modifier = $obj->modifier();
         echo '<br>Updated ';
         if ($this->show_user) {
             echo 'by ' . $modifier->title_as_link() . ' - ';
         }
         echo $obj->time_modified->format();
     }
     ?>
 </p>
 <div class="text-flow">
   <p>
     <?php 
     $menu = $this->context->make_menu();
     $menu->renderer->separator_class = $this->app->display_options->object_class;
     if ($this->show_folder) {
         $folder = $obj->parent_folder();
         $menu->append($folder->title_as_link());
     }
     $branch = $obj->branch();
     if ($this->show_branch && isset($branch)) {
         $menu->append($branch->title_as_link());
     }
     $menu->display();
     ?>
   </p>
   <?php 
     $status = $obj->status();
     echo $status->as_html();
     ?>
   <?php 
     echo $obj->description_as_html();
     ?>
 </div>
 <?php 
     $this->_display_finish_minimal_commands_block();
 }
Пример #2
0
    /**
     * Draw a release in the list.
     * If the job and changes counts are 0, then assume that the entries for
     * that release weren't in the list and retrieve the counts.
     * @param RELEASE $release
     * @param integer $num_jobs Number of jobs in this release. Can be empty.
     * @param integer $num_changes Number of changes in this release. Can be empty.
     * @access private
     */
    protected function _draw_release($release, $num_jobs, $num_changes)
    {
        if (!$num_changes) {
            $chng_query = $release->change_query();
            $num_changes = $chng_query->size();
        }
        if (!$num_jobs) {
            $job_query = $release->job_query();
            $num_jobs = $job_query->size();
        }
        $t = $release->title_formatter();
        $t->set_name('view_release_change_log.php');
        ?>
  <h2>
    <?php 
        echo $release->title_as_link($t);
        ?>
  </h2>
    <table class="basic columns left-labels">
      <tr>
        <th>Jobs</th>
        <td><?php 
        echo $num_jobs;
        ?>
</td>
      </tr>
      <tr>
        <th>Changes</th>
        <td><?php 
        echo $num_changes;
        ?>
</td>
      </tr>
      <tr>
        <th></th>
        <td>
          <?php 
        $status = $release->status();
        echo $status->as_html();
        ?>
        </td>
      </tr>
    </table>
<?php 
        if ($this->show_description) {
            $munger = $release->html_formatter();
            $desc = $release->description_as_html($munger);
            if ($desc) {
                ?>
      <div class="text-flow">
        <?php 
                echo $desc;
                ?>
      </div>
      <?php 
            }
        }
        if ($this->show_user || $this->show_date) {
            $t = $release->time_created->formatter();
            $t->type = Date_time_format_date_and_time;
            $creator = $release->creator();
            ?>
    <p class="info-box-bottom">
      Created
    <?php 
            if ($this->show_user) {
                ?>
      by <?php 
                echo $creator->title_as_link();
                ?>
    <?php 
            }
            if ($this->show_date) {
                ?>
        on
        <?php 
                echo $release->time_created->format($t);
            }
            ?>
    </p>
<?php 
        }
    }