public function getErrorMessage()
 {
     $backlog_item_name = $this->artifact->getTitle();
     $tracker_name = $this->artifact->getTracker()->getName();
     $uri = $this->artifact->getUri();
     return $GLOBALS['Language']->getText('plugin_cardwall', 'cells_not_displayed', array($backlog_item_name, $tracker_name, $uri));
 }
 private function sendResponse(Codendi_Request $request, $feedback_level, $message, $unsubscribe)
 {
     if ($request->isAjax()) {
         $this->sendAjaxResponse($unsubscribe, $message);
         return;
     }
     $GLOBALS['Response']->addFeedback($feedback_level, $message);
     $GLOBALS['Response']->redirect($this->artifact->getUri());
 }
示例#3
0
 public function __construct(Tracker_Artifact $artifact)
 {
     $this->id = $artifact->getId();
     $this->title = $artifact->getTitle();
     $this->url = $artifact->getUri();
     $this->artifact = $artifact;
     $this->color = $this->artifact->getTracker()->getColor();
     $this->type = $this->artifact->getTracker()->getName();
     $this->short_type = $this->artifact->getTracker()->getItemName();
 }
 /**
  * @param Tracker_Artifact        $artifact The child
  * @param Tracker_Artifact        $parent   The parent
  * @param Tracker_Semantic_Status $semantic The status semantic used by the corresponding tracker
  */
 public function __construct(Tracker_Artifact $artifact, Tracker_Artifact $parent, Tracker_Semantic_Status $semantic)
 {
     $base_url = get_server_url();
     $this->xref = $artifact->getXRef();
     $this->title = $artifact->getTitle();
     $this->id = $artifact->getId();
     $this->url = $base_url . $artifact->getUri();
     $this->status = $semantic->getStatus($artifact);
     $this->parent_id = $parent->getId();
     $this->has_children = $artifact->hasChildren();
 }
 public function __construct($follow_ups, $artifact_links, $form_elements, Tracker_Artifact $artifact, PFUser $user)
 {
     $this->follow_ups = $follow_ups;
     $this->artifact_links = $artifact_links;
     $this->artifact = $artifact;
     $this->artifact_id = $artifact->getId();
     $this->artifact_title = $artifact->getTitle();
     $this->artifact_uri = $artifact->getUri();
     $this->last_changeset_id = $artifact->getLastChangeset()->getId();
     $this->form_elements = $form_elements;
     $this->user = $user;
 }
 public function parent_url()
 {
     if ($this->parent) {
         return $this->getUrlWithRedirect($this->parent->getUri());
     }
 }
示例#7
0
 /**
  * @see Tracker_CardPresenter
  */
 public function getUrl()
 {
     return $this->artifact->getUri();
 }
 /**
  * Send a notification
  *
  * @param Array  $recipients the list of recipients
  * @param Array  $headers    the additional headers
  * @param String $subject    the subject of the message
  * @param String $htmlBody   the html content of the message
  * @param String $txtBody    the text content of the message
  *
  * @return Void
  */
 protected function sendReminder(Tracker_Artifact $artifact, $recipients, $headers, $subject, $htmlBody, $txtBody)
 {
     $hp = Codendi_HTMLPurifier::instance();
     $breadcrumbs = array();
     $project = $this->getTracker()->getProject();
     $trackerId = $this->getTracker()->getID();
     $artifactId = $artifact->getID();
     $mail_enhancer = new MailEnhancer();
     $breadcrumbs[] = '<a href="' . get_server_url() . '/projects/' . $project->getUnixName(true) . '" />' . $project->getPublicName() . '</a>';
     $breadcrumbs[] = '<a href="' . get_server_url() . '/plugins/tracker/?tracker=' . (int) $trackerId . '" />' . $hp->purify($this->getTracker()->getName()) . '</a>';
     $breadcrumbs[] = '<a href="' . get_server_url() . '/plugins/tracker/?aid=' . (int) $artifactId . '" />' . $hp->purify($this->getTracker()->getName() . ' #' . $artifactId) . '</a>';
     $mail_enhancer->addPropertiesToLookAndFeel('breadcrumbs', $breadcrumbs);
     $mail_enhancer->addPropertiesToLookAndFeel('title', $hp->purify($subject));
     $mail_enhancer->addHeader("X-Codendi-Project", $this->getTracker()->getProject()->getUnixName());
     $mail_enhancer->addHeader("X-Codendi-Tracker", $this->getTracker()->getItemName());
     $mail_enhancer->addHeader("X-Codendi-Artifact-ID", $artifact->getId());
     foreach ($headers as $header) {
         $mail_enhancer->addHeader($header['name'], $header['value']);
     }
     $mail_notification_builder = new MailNotificationBuilder(new MailBuilder(TemplateRendererFactory::build()));
     $mail_notification_builder->buildAndSendEmail($project, $recipients, $subject, $htmlBody, $txtBody, get_server_url() . $artifact->getUri(), trackerPlugin::TRUNCATED_SERVICE_NAME, $mail_enhancer);
 }