Exemplo n.º 1
0
    /**
     * Returns the timeline fragment for the file.
     *
     *
     * @param Pluf_HTTP_Request
     * @return Pluf_Template_SafeString
     */
    public function timelineFragment($request)
    {
        $url = Pluf_HTTP_URL_urlForView('IDF_Views_Download::view', array($request->project->shortname, $this->id));
        $out = '<tr class="log"><td><a href="' . $url . '">' . Pluf_esc(Pluf_Template_dateAgo($this->creation_dtime, 'without')) . '</a></td><td>';
        $stag = new IDF_Template_ShowUser();
        $user = $stag->start($this->get_submitter(), $request, '', false);
        $out .= sprintf(__('<a href="%1$s" title="View download">Download %2$d</a>, %3$s'), $url, $this->id, Pluf_esc($this->summary)) . '</td>';
        $out .= '</tr>';
        $out .= "\n" . '<tr class="extra"><td colspan="2">
<div class="helptext right">' . sprintf(__('Addition of <a href="%s">download&nbsp;%d</a>, by %s'), $url, $this->id, $user) . '</div></td></tr>';
        return Pluf_Template::markSafe($out);
    }
Exemplo n.º 2
0
    public function timelineFragment($request)
    {
        $review = $this->get_patch()->get_review();
        $url = Pluf_HTTP_URL_urlForView('IDF_Views_Review::view', array($request->project->shortname, $review->id));
        $out = '<tr class="log"><td><a href="' . $url . '">' . Pluf_esc(Pluf_Template_dateAgo($this->creation_dtime, 'without')) . '</a></td><td>';
        $stag = new IDF_Template_ShowUser();
        $user = $stag->start($this->get_submitter(), $request, '', false);
        $ic = in_array($review->status, $request->project->getTagIdsByStatus('closed')) ? 'issue-c' : 'issue-o';
        $out .= sprintf(__('<a href="%1$s" class="%2$s" title="View review">Review %3$d</a>, %4$s'), $url, $ic, $review->id, Pluf_esc($review->summary)) . '</td>';
        $out .= "\n" . '<tr class="extra"><td colspan="2">
<div class="helptext right">' . sprintf(__('Update of <a href="%s" class="%s">review&nbsp;%d</a>, by %s'), $url, $ic, $review->id, $user) . '</div></td></tr>';
        return Pluf_Template::markSafe($out);
    }
Exemplo n.º 3
0
    public function timelineFragment($request)
    {
        $issue = $this->get_issue();
        $url = Pluf_HTTP_URL_urlForView('IDF_Views_Issue::view', array($request->project->shortname, $issue->id));
        $url .= '#ic' . $this->id;
        $out = "\n" . '<tr class="log"><td><a href="' . $url . '">' . Pluf_esc(Pluf_Template_dateAgo($this->creation_dtime, 'without')) . '</a></td><td>';
        $stag = new IDF_Template_ShowUser();
        $user = $stag->start($this->get_submitter(), $request, '', false);
        $ic = in_array($issue->status, $request->project->getTagIdsByStatus('closed')) ? 'issue-c' : 'issue-o';
        $out .= sprintf(__('<a href="%1$s" class="%2$s" title="View issue">Issue %3$d</a>, %4$s'), $url, $ic, $issue->id, Pluf_esc($issue->summary));
        if ($this->changedIssue()) {
            $out .= '<div class="issue-changes-timeline">';
            foreach ($this->changes as $w => $v) {
                $out .= '<strong>';
                switch ($w) {
                    case 'su':
                        $out .= __('Summary:');
                        break;
                    case 'st':
                        $out .= __('Status:');
                        break;
                    case 'ow':
                        $out .= __('Owner:');
                        break;
                    case 'lb':
                        $out .= __('Labels:');
                        break;
                }
                $out .= '</strong>&nbsp;';
                if ($w == 'lb') {
                    $out .= Pluf_esc(implode(', ', $v));
                } else {
                    $out .= Pluf_esc($v);
                }
                $out .= ' ';
            }
            $out .= '</div>';
        }
        $out .= '</td></tr>';
        $out .= "\n" . '<tr class="extra"><td colspan="2">
<div class="helptext right">' . sprintf(__('Comment on <a href="%s" class="%s">issue&nbsp;%d</a>, by %s'), $url, $ic, $issue->id, $user) . '</div></td></tr>';
        return Pluf_Template::markSafe($out);
    }
Exemplo n.º 4
0
    /**
     * Returns the timeline fragment for the commit.
     *
     *
     * @param Pluf_HTTP_Request 
     * @return Pluf_Template_SafeString
     */
    public function timelineFragment($request)
    {
        $url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::commit', array($request->project->shortname, $this->scm_id));
        $out = '<tr class="log"><td><a href="' . $url . '">' . Pluf_esc(Pluf_Template_dateAgo($this->creation_dtime, 'without')) . '</a></td><td>';
        $stag = new IDF_Template_ShowUser();
        $user = $stag->start($this->get_author(), $request, $this->origauthor, false);
        $tag = new IDF_Template_IssueComment();
        $out .= $tag->start($this->summary, $request, false);
        if (0 && $this->fullmessage) {
            $out .= '<br /><br />' . $tag->start($this->fullmessage, $request, false);
        }
        $out .= '</td>
</tr>
<tr class="extra">
<td colspan="2">
<div class="helptext right">' . sprintf(__('Commit&nbsp;%s, by %s'), '<a href="' . $url . '" class="mono">' . $this->scm_id . '</a>', $user) . '</div></td></tr>';
        return Pluf_Template::markSafe($out);
    }
Exemplo n.º 5
0
 /**
  * We need the user object and the request.
  *
  * If the user object is null (for example a non associated
  * commit), we can use the $text value for an alternative display.
  *
  * @param string Which variable to assign
  * @param Pluf_User
  * @param Pluf_HTTP_Request
  * @param string Alternate text ('')
  */
 function start($var, $user, $request, $text = '')
 {
     $t = new IDF_Template_ShowUser($this->context);
     $this->context->set($var, Pluf_Template::markSafe($t->start($user, $request, $text, false)));
 }
Exemplo n.º 6
0
    public function timelineFragment($request)
    {
        $page = $this->get_wikipage();
        $url = Pluf_HTTP_URL_urlForView('IDF_Views_Wiki::view', array($request->project->shortname, $page->title));
        $out = "\n" . '<tr class="log"><td><a href="' . $url . '">' . Pluf_esc(Pluf_Template_dateAgo($this->creation_dtime, 'without')) . '</a></td><td>';
        $stag = new IDF_Template_ShowUser();
        $user = $stag->start($this->get_submitter(), $request, '', false);
        $out .= sprintf(__('<a href="%1$s" title="View page">%2$s</a>, %3$s'), $url, Pluf_esc($page->title), Pluf_esc($this->summary));
        if ($this->changedRevision()) {
            $out .= '<div class="issue-changes-timeline">';
            $changes = $this->changes;
            foreach ($changes as $w => $v) {
                $out .= '<strong>';
                switch ($w) {
                    case 'lb':
                        $out .= __('Labels:');
                        break;
                }
                $out .= '</strong>&nbsp;';
                if ($w == 'lb') {
                    $out .= Pluf_esc(implode(', ', $v));
                } else {
                    $out .= Pluf_esc($v);
                }
                $out .= ' ';
            }
            $out .= '</div>';
        }
        $out .= '</td></tr>';
        $out .= "\n" . '<tr class="extra"><td colspan="2">
<div class="helptext right">' . sprintf(__('Change of <a href="%s">%s</a>, by %s'), $url, Pluf_esc($page->title), $user) . '</div></td></tr>';
        return Pluf_Template::markSafe($out);
    }