/**
  * Outputs the object as plain text.
  * @param HISTORY_ITEM $obj
  * @access private
  */
 protected function _display_as_plain_text($obj)
 {
     $creator = $obj->creator();
     echo $this->line(ucfirst($obj->kind_as_text()) . ' by ' . $creator->title_as_plain_text() . ' - ' . $this->time($obj->time_created));
     echo $this->line($this->sep());
     if (!$obj->description && !$obj->system_description) {
         switch ($obj->kind) {
             case History_item_created:
                 echo $this->line('Created.');
                 break;
             case History_item_deleted:
                 echo $this->line('Deleted.');
                 break;
         }
     } else {
         if ($obj->description) {
             echo $this->line($obj->description_as_plain_text());
         }
         echo $obj->system_description_as_plain_text();
     }
 }
예제 #2
0
 /**
  * Should this history item trigger a notification?
  * This uses the {@link $send_own_changes} option.
  * @param HISTORY_ITEM $history_item
  * @return boolean
  */
 public function wants_notification($history_item)
 {
     $Result = $this->send_own_changes;
     if (!$Result) {
         $creator = $history_item->creator();
         $Result = $this->email != $creator->email;
     }
     return $Result;
 }
    /**
     * @param HISTORY_ITEM $obj
     * @access private
     */
    protected function _draw_box($obj)
    {
        $curr_date = $obj->time_created;
        if (!isset($this->last_date) || !$curr_date->equals($this->last_date, Date_time_date_part)) {
            $this->last_date = $curr_date;
            ?>
      <h2>
        <?php 
            $t = $curr_date->formatter();
            $t->type = Date_time_format_date_only;
            echo $curr_date->format($t);
            $now = new DATE_TIME();
            if ($curr_date->equals($now, Date_time_date_part)) {
                echo ' (Today)';
            }
            $now_yesterday = new DATE_TIME(time() - 86400);
            if ($curr_date->equals($now_yesterday, Date_time_date_part)) {
                echo ' (Yesterday)';
            }
            ?>
      </h2>
    <?php 
        }
        $this->_item_number += 1;
        $creator = $obj->creator();
        ?>
  <h3>
    <?php 
        echo $obj->title_as_html();
        ?>
  </h3>
  <?php 
        if ($obj->description || $obj->system_description) {
            echo $obj->description_as_html();
            echo $obj->system_description_as_html();
        }
        ?>
  <table class="basic columns left-labels top">
    <tr>
      <th>Time</th>
      <td>
      <?php 
        $tf = $obj->time_created->formatter();
        $tf->type = Date_time_format_date_and_time;
        echo $obj->time_created->format();
        ?>
      </td>
    </tr>
    <tr>
      <th>User</th>
      <td>
        <?php 
        echo $this->context->get_icon_with_text($creator->icon_url, Sixteen_px, $creator->title_as_link());
        ?>
      </td>
    </tr>
    <tr>
      <th>Kind</th>
      <td>
        <?php 
        echo $this->context->get_icon_with_text($obj->kind_icon_url(), Sixteen_px, $obj->kind);
        ?>
      </td>
    </tr>
    <tr>
      <th>Emails</th>
      <td>
        <?php 
        echo $this->context->get_icon_with_text($obj->publication_state_icon_url(), Sixteen_px, $obj->publication_state_as_text());
        ?>
      </td>
    </tr>
  </table>
  <?php 
        if (isset($this->_time_diffs[$this->_item_number - 1])) {
            ?>
    <p>&dArr; <?php 
            echo $this->_time_diffs[$this->_item_number - 1]->format();
            ?>
 &dArr;</p>
  <?php 
        }
        ?>
  <?php 
    }