public function getColor()
 {
     switch ($this->getTransactionType()) {
         case self::TYPE_DIFF_CREATE:
             return PhabricatorTransactions::COLOR_SKY;
     }
     return parent::getColor();
 }
 public function getColor()
 {
     $old = $this->getOldValue();
     $new = $this->getNewValue();
     switch ($this->getTransactionType()) {
         case self::TYPE_NAME:
             return PhabricatorTransactions::COLOR_BLUE;
     }
     return parent::getColor();
 }
 public function getColor()
 {
     $author_phid = $this->getAuthorPHID();
     $old = $this->getOldValue();
     $new = $this->getNewValue();
     switch ($this->getTransactionType()) {
         case self::TYPE_CREATE:
             return 'green';
     }
     return parent::getColor();
 }
 public function getColor()
 {
     $old = $this->getOldValue();
     $new = $this->getNewValue();
     switch ($this->getTransactionType()) {
         case self::TYPE_NAME:
             if (!strlen($old)) {
                 return PhabricatorTransactions::COLOR_GREEN;
             }
             break;
     }
     return parent::getColor();
 }
 public function getColor()
 {
     $type = $this->getTransactionType();
     switch ($type) {
         case PhabricatorAuditActionConstants::ACTION:
             switch ($this->getNewValue()) {
                 case PhabricatorAuditActionConstants::CONCERN:
                     return 'red';
                 case PhabricatorAuditActionConstants::ACCEPT:
                     return 'green';
             }
     }
     return parent::getColor();
 }
 public function getColor()
 {
     $old = $this->getOldValue();
     $new = $this->getNewValue();
     switch ($this->getTransactionType()) {
         case self::TYPE_ENABLE:
             if ($new) {
                 return 'green';
             } else {
                 return 'indigo';
             }
     }
     return parent::getColor();
 }
 public function getColor()
 {
     $old = $this->getOldValue();
     $new = $this->getNewValue();
     switch ($this->getTransactionType()) {
         case self::TYPE_STATUS:
             if ($old == 0) {
                 return 'red';
             } else {
                 return 'green';
             }
     }
     return parent::getColor();
 }
 public function getColor()
 {
     $old = $this->getOldValue();
     $new = $this->getNewValue();
     switch ($this->getTransactionType()) {
         case self::TYPE_ACTIVE:
             if ($new) {
                 return 'green';
             } else {
                 return 'black';
             }
             break;
     }
     return parent::getColor();
 }
 public function getColor()
 {
     $author_phid = $this->getAuthorPHID();
     $old = $this->getOldValue();
     $new = $this->getNewValue();
     switch ($this->getTransactionType()) {
         case self::TYPE_CREATE:
             return 'green';
         case self::TYPE_COMMAND:
             switch ($new) {
                 case HarbormasterBuildCommand::COMMAND_STOP:
                     return 'red';
             }
     }
     return parent::getColor();
 }
Пример #10
0
 public function getColor()
 {
     $old = $this->getOldValue();
     switch ($this->getTransactionType()) {
         case self::TYPE_TITLE:
             if ($old === null) {
                 return PhabricatorTransactions::COLOR_GREEN;
             }
             break;
     }
     return parent::getColor();
 }
Пример #11
0
 public function getColor()
 {
     $old = $this->getOldValue();
     $new = $this->getNewValue();
     switch ($this->getTransactionType()) {
         case self::TYPE_STATUS:
             if ($new == PholioMock::STATUS_CLOSED) {
                 return PhabricatorTransactions::COLOR_INDIGO;
             } else {
                 return PhabricatorTransactions::COLOR_GREEN;
             }
         case self::TYPE_NAME:
             if ($old === null) {
                 return PhabricatorTransactions::COLOR_GREEN;
             }
         case self::TYPE_IMAGE_REPLACE:
             return PhabricatorTransactions::COLOR_YELLOW;
         case self::TYPE_IMAGE_FILE:
             $add = array_diff($new, $old);
             $rem = array_diff($old, $new);
             if ($add && $rem) {
                 return PhabricatorTransactions::COLOR_YELLOW;
             } else {
                 if ($add) {
                     return PhabricatorTransactions::COLOR_GREEN;
                 } else {
                     return PhabricatorTransactions::COLOR_RED;
                 }
             }
     }
     return parent::getColor();
 }
Пример #12
0
 public function getColor()
 {
     $old = $this->getOldValue();
     $new = $this->getNewValue();
     switch ($this->getTransactionType()) {
         case PholioTransactionType::TYPE_NAME:
             if ($old === null) {
                 return PhabricatorTransactions::COLOR_GREEN;
             }
         case PholioTransactionType::TYPE_DESCRIPTION:
         case PholioTransactionType::TYPE_STATUS:
         case PholioTransactionType::TYPE_IMAGE_NAME:
         case PholioTransactionType::TYPE_IMAGE_DESCRIPTION:
         case PholioTransactionType::TYPE_IMAGE_SEQUENCE:
             return PhabricatorTransactions::COLOR_BLUE;
         case PholioTransactionType::TYPE_IMAGE_REPLACE:
             return PhabricatorTransactions::COLOR_YELLOW;
         case PholioTransactionType::TYPE_IMAGE_FILE:
             $add = array_diff($new, $old);
             $rem = array_diff($old, $new);
             if ($add && $rem) {
                 return PhabricatorTransactions::COLOR_YELLOW;
             } else {
                 if ($add) {
                     return PhabricatorTransactions::COLOR_GREEN;
                 } else {
                     return PhabricatorTransactions::COLOR_RED;
                 }
             }
     }
     return parent::getColor();
 }
 public function getColor()
 {
     $new = $this->getNewValue();
     switch ($this->getTransactionType()) {
         case self::TYPE_USER_INTENT:
             switch ($new) {
                 case ReleephRequest::INTENT_WANT:
                     return PhabricatorTransactions::COLOR_GREEN;
                 case ReleephRequest::INTENT_PASS:
                     return PhabricatorTransactions::COLOR_RED;
             }
     }
     return parent::getColor();
 }
Пример #14
0
 public function getColor()
 {
     $old = $this->getOldValue();
     $new = $this->getNewValue();
     switch ($this->getTransactionType()) {
         case self::TYPE_OWNER:
             if ($this->getAuthorPHID() == $new) {
                 return 'green';
             } else {
                 if (!$new) {
                     return 'black';
                 } else {
                     if (!$old) {
                         return 'green';
                     } else {
                         return 'green';
                     }
                 }
             }
         case self::TYPE_STATUS:
             $color = ManiphestTaskStatus::getStatusColor($new);
             if ($color !== null) {
                 return $color;
             }
             if (ManiphestTaskStatus::isOpenStatus($new)) {
                 return 'green';
             } else {
                 return 'black';
             }
         case self::TYPE_PRIORITY:
             if ($old == ManiphestTaskPriority::getDefaultPriority()) {
                 return 'green';
             } else {
                 if ($old > $new) {
                     return 'grey';
                 } else {
                     return 'yellow';
                 }
             }
     }
     return parent::getColor();
 }
 public function getColor()
 {
     $old = $this->getOldValue();
     $new = $this->getNewValue();
     switch ($this->getTransactionType()) {
         case self::TYPE_CONTENT:
             return PhabricatorTransactions::COLOR_GREEN;
         case self::TYPE_STATUS:
             switch ($new) {
                 case PhabricatorPaste::STATUS_ACTIVE:
                     return 'green';
                 case PhabricatorPaste::STATUS_ARCHIVED:
                     return 'indigo';
             }
             break;
     }
     return parent::getColor();
 }
 public function getColor()
 {
     $old = $this->getOldValue();
     $new = $this->getNewValue();
     switch ($this->getTransactionType()) {
         case self::TYPE_NAME:
         case self::TYPE_START_DATE:
         case self::TYPE_END_DATE:
         case self::TYPE_DESCRIPTION:
         case self::TYPE_CANCEL:
         case self::TYPE_INVITE:
             return PhabricatorTransactions::COLOR_GREEN;
     }
     return parent::getColor();
 }
 private function renderEvent(PhabricatorApplicationTransaction $xaction, array $group)
 {
     $viewer = $this->getUser();
     $event = id(new PHUITimelineEventView())->setUser($viewer)->setAuthorPHID($xaction->getAuthorPHID())->setTransactionPHID($xaction->getPHID())->setUserHandle($xaction->getHandle($xaction->getAuthorPHID()))->setIcon($xaction->getIcon())->setColor($xaction->getColor())->setHideCommentOptions($this->getHideCommentOptions());
     list($token, $token_removed) = $xaction->getToken();
     if ($token) {
         $event->setToken($token, $token_removed);
     }
     if (!$this->shouldSuppressTitle($xaction, $group)) {
         if ($this->renderAsFeed) {
             $title = $xaction->getTitleForFeed();
         } else {
             $title = $xaction->getTitle();
         }
         if ($xaction->hasChangeDetails()) {
             if (!$this->isPreview) {
                 $details = $this->buildChangeDetailsLink($xaction);
                 $title = array($title, ' ', $details);
             }
         }
         if (!$this->isPreview) {
             $more = $this->buildExtraInformationLink($xaction);
             if ($more) {
                 $title = array($title, ' ', $more);
             }
         }
         $event->setTitle($title);
     }
     if ($this->isPreview) {
         $event->setIsPreview(true);
     } else {
         $event->setDateCreated($xaction->getDateCreated())->setContentSource($xaction->getContentSource())->setAnchor($xaction->getID());
     }
     $transaction_type = $xaction->getTransactionType();
     $comment_type = PhabricatorTransactions::TYPE_COMMENT;
     $is_normal_comment = $transaction_type == $comment_type;
     if ($this->getShowEditActions() && !$this->isPreview && $is_normal_comment) {
         $has_deleted_comment = $xaction->getComment() && $xaction->getComment()->getIsDeleted();
         $has_removed_comment = $xaction->getComment() && $xaction->getComment()->getIsRemoved();
         if ($xaction->getCommentVersion() > 1 && !$has_removed_comment) {
             $event->setIsEdited(true);
         }
         if (!$has_removed_comment) {
             $event->setIsNormalComment(true);
         }
         // If we have a place for quoted text to go and this is a quotable
         // comment, pass the quote target ID to the event view.
         if ($this->getQuoteTargetID()) {
             if ($xaction->hasComment()) {
                 if (!$has_removed_comment && !$has_deleted_comment) {
                     $event->setQuoteTargetID($this->getQuoteTargetID());
                     $event->setQuoteRef($this->getQuoteRef());
                 }
             }
         }
         $can_edit = PhabricatorPolicyCapability::CAN_EDIT;
         if ($xaction->hasComment() || $has_deleted_comment) {
             $has_edit_capability = PhabricatorPolicyFilter::hasCapability($viewer, $xaction, $can_edit);
             if ($has_edit_capability && !$has_removed_comment) {
                 $event->setIsEditable(true);
             }
             if ($has_edit_capability || $viewer->getIsAdmin()) {
                 if (!$has_removed_comment) {
                     $event->setIsRemovable(true);
                 }
             }
         }
     }
     $comment = $this->renderTransactionContent($xaction);
     if ($comment) {
         $event->appendChild($comment);
     }
     return $event;
 }
Пример #18
0
 public function getColor()
 {
     switch ($this->getTransactionType()) {
         case self::TYPE_UPDATE:
             return PhabricatorTransactions::COLOR_SKY;
         case self::TYPE_STATUS:
             switch ($this->getNewValue()) {
                 case ArcanistDifferentialRevisionStatus::ACCEPTED:
                     return PhabricatorTransactions::COLOR_GREEN;
                 case ArcanistDifferentialRevisionStatus::NEEDS_REVISION:
                     return PhabricatorTransactions::COLOR_RED;
                 case ArcanistDifferentialRevisionStatus::NEEDS_REVIEW:
                     return PhabricatorTransactions::COLOR_ORANGE;
             }
             break;
         case self::TYPE_ACTION:
             switch ($this->getNewValue()) {
                 case DifferentialAction::ACTION_CLOSE:
                     return PhabricatorTransactions::COLOR_INDIGO;
                 case DifferentialAction::ACTION_ACCEPT:
                     return PhabricatorTransactions::COLOR_GREEN;
                 case DifferentialAction::ACTION_REJECT:
                     return PhabricatorTransactions::COLOR_RED;
                 case DifferentialAction::ACTION_ABANDON:
                     return PhabricatorTransactions::COLOR_INDIGO;
                 case DifferentialAction::ACTION_RETHINK:
                     return PhabricatorTransactions::COLOR_RED;
                 case DifferentialAction::ACTION_REQUEST:
                     return PhabricatorTransactions::COLOR_SKY;
                 case DifferentialAction::ACTION_RECLAIM:
                     return PhabricatorTransactions::COLOR_SKY;
                 case DifferentialAction::ACTION_REOPEN:
                     return PhabricatorTransactions::COLOR_SKY;
                 case DifferentialAction::ACTION_RESIGN:
                     return PhabricatorTransactions::COLOR_ORANGE;
                 case DifferentialAction::ACTION_CLAIM:
                     return PhabricatorTransactions::COLOR_YELLOW;
             }
     }
     return parent::getColor();
 }
 public function getColor()
 {
     $author_phid = $this->getAuthorPHID();
     $old = $this->getOldValue();
     $new = $this->getNewValue();
     $type = $this->getTransactionType();
     switch ($type) {
         case PhabricatorTransactions::TYPE_CREATE:
             return 'green';
         case self::TYPE_DISABLE:
             if ($new) {
                 return 'indigo';
             } else {
                 return 'green';
             }
     }
     return parent::getColor();
 }
 public function getColor()
 {
     $old = $this->getOldValue();
     $new = $this->getNewValue();
     switch ($this->getTransactionType()) {
         case PhabricatorMacroTransactionType::TYPE_NAME:
             return PhabricatorTransactions::COLOR_BLUE;
         case PhabricatorMacroTransactionType::TYPE_FILE:
             if ($old === null) {
                 return PhabricatorTransactions::COLOR_GREEN;
             } else {
                 return PhabricatorTransactions::COLOR_BLUE;
             }
         case PhabricatorMacroTransactionType::TYPE_DISABLED:
             if ($new) {
                 return PhabricatorTransactions::COLOR_BLACK;
             } else {
                 return PhabricatorTransactions::COLOR_SKY;
             }
     }
     return parent::getColor();
 }
 public function getColor()
 {
     $old = $this->getOldValue();
     $new = $this->getNewValue();
     switch ($this->getTransactionType()) {
         case self::TYPE_NAME:
         case self::TYPE_URL:
         case self::TYPE_ALIAS:
         case self::TYPE_DESCRIPTION:
             return PhabricatorTransactions::COLOR_GREEN;
     }
     return parent::getColor();
 }
 public final function getColor()
 {
     $color = $this->getTransactionImplementation()->getColor();
     if ($color !== null) {
         return $color;
     }
     return parent::getColor();
 }
Пример #23
0
 public function getColor()
 {
     $old = $this->getOldValue();
     $new = $this->getNewValue();
     switch ($this->getTransactionType()) {
         case self::TYPE_STATUS:
             if ($new == PhameBlog::STATUS_ARCHIVED) {
                 return 'violet';
             } else {
                 return 'green';
             }
     }
     return parent::getColor();
 }
 public function getColor()
 {
     $old = $this->getOldValue();
     $new = $this->getNewValue();
     switch ($this->getTransactionType()) {
         case self::TYPE_QUESTION:
         case self::TYPE_DESCRIPTION:
         case self::TYPE_RESPONSES:
         case self::TYPE_SHUFFLE:
         case self::TYPE_CLOSE:
             return PhabricatorTransactions::COLOR_BLUE;
     }
     return parent::getColor();
 }
 public function getColor()
 {
     $old = $this->getOldValue();
     $new = $this->getNewValue();
     switch ($this->getTransactionType()) {
         case self::TYPE_NAME:
             if (!strlen($old)) {
                 return PhabricatorTransactions::COLOR_GREEN;
             }
             break;
         case self::TYPE_STATUS:
             if ($new == PhabricatorDashboard::STATUS_ACTIVE) {
                 return PhabricatorTransactions::COLOR_GREEN;
             } else {
                 return PhabricatorTransactions::COLOR_INDIGO;
             }
             break;
     }
     return parent::getColor();
 }