Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/storage/PhabricatorProjectTransaction.php
Show First 20 Lines • Show All 172 Lines • ▼ Show 20 Lines | switch ($this->getTransactionType()) { | ||||
break; | break; | ||||
case self::TYPE_SLUGS: | case self::TYPE_SLUGS: | ||||
$add = array_diff($new, $old); | $add = array_diff($new, $old); | ||||
$rem = array_diff($old, $new); | $rem = array_diff($old, $new); | ||||
if ($add && $rem) { | if ($add && $rem) { | ||||
return pht( | return pht( | ||||
'%s changed project hashtag(s), added %d: %s; removed %d: %s.', | '%s changed project hashtag(s), added %s: %s; removed %s: %s.', | ||||
$author_handle, | $author_handle, | ||||
count($add), | phutil_count($add), | ||||
$this->renderSlugList($add), | $this->renderSlugList($add), | ||||
count($rem), | phutil_count($rem), | ||||
$this->renderSlugList($rem)); | $this->renderSlugList($rem)); | ||||
} else if ($add) { | } else if ($add) { | ||||
return pht( | return pht( | ||||
'%s added %d project hashtag(s): %s.', | '%s added %s project hashtag(s): %s.', | ||||
$author_handle, | $author_handle, | ||||
count($add), | phutil_count($add), | ||||
$this->renderSlugList($add)); | $this->renderSlugList($add)); | ||||
} else if ($rem) { | } else if ($rem) { | ||||
return pht( | return pht( | ||||
'%s removed %d project hashtag(s): %s.', | '%s removed %s project hashtag(s): %s.', | ||||
$author_handle, | $author_handle, | ||||
count($rem), | phutil_count($rem), | ||||
$this->renderSlugList($rem)); | $this->renderSlugList($rem)); | ||||
} | } | ||||
break; | break; | ||||
case self::TYPE_MEMBERS: | case self::TYPE_MEMBERS: | ||||
$add = array_diff($new, $old); | $add = array_diff($new, $old); | ||||
$rem = array_diff($old, $new); | $rem = array_diff($old, $new); | ||||
if ($add && $rem) { | if ($add && $rem) { | ||||
return pht( | return pht( | ||||
'%s changed project member(s), added %d: %s; removed %d: %s.', | '%s changed project member(s), added %s: %s; removed %s: %s.', | ||||
$author_handle, | $author_handle, | ||||
count($add), | phutil_count($add), | ||||
$this->renderHandleList($add), | $this->renderHandleList($add), | ||||
count($rem), | phutil_count($rem), | ||||
$this->renderHandleList($rem)); | $this->renderHandleList($rem)); | ||||
} else if ($add) { | } else if ($add) { | ||||
if (count($add) == 1 && (head($add) == $this->getAuthorPHID())) { | if (count($add) == 1 && (head($add) == $this->getAuthorPHID())) { | ||||
return pht( | return pht( | ||||
'%s joined this project.', | '%s joined this project.', | ||||
$author_handle); | $author_handle); | ||||
} else { | } else { | ||||
return pht( | return pht( | ||||
'%s added %d project member(s): %s.', | '%s added %s project member(s): %s.', | ||||
$author_handle, | $author_handle, | ||||
count($add), | phutil_count($add), | ||||
$this->renderHandleList($add)); | $this->renderHandleList($add)); | ||||
} | } | ||||
} else if ($rem) { | } else if ($rem) { | ||||
if (count($rem) == 1 && (head($rem) == $this->getAuthorPHID())) { | if (count($rem) == 1 && (head($rem) == $this->getAuthorPHID())) { | ||||
return pht( | return pht( | ||||
'%s left this project.', | '%s left this project.', | ||||
$author_handle); | $author_handle); | ||||
} else { | } else { | ||||
return pht( | return pht( | ||||
'%s removed %d project member(s): %s.', | '%s removed %s project member(s): %s.', | ||||
$author_handle, | $author_handle, | ||||
count($rem), | phutil_count($rem), | ||||
$this->renderHandleList($rem)); | $this->renderHandleList($rem)); | ||||
} | } | ||||
} | } | ||||
break; | break; | ||||
} | } | ||||
return parent::getTitle(); | return parent::getTitle(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | switch ($this->getTransactionType()) { | ||||
} | } | ||||
case self::TYPE_SLUGS: | case self::TYPE_SLUGS: | ||||
$add = array_diff($new, $old); | $add = array_diff($new, $old); | ||||
$rem = array_diff($old, $new); | $rem = array_diff($old, $new); | ||||
if ($add && $rem) { | if ($add && $rem) { | ||||
return pht( | return pht( | ||||
'%s changed %s hashtag(s), added %d: %s; removed %d: %s.', | '%s changed %s hashtag(s), added %s: %s; removed %s: %s.', | ||||
$author_handle, | $author_handle, | ||||
$object_handle, | $object_handle, | ||||
count($add), | phutil_count($add), | ||||
$this->renderSlugList($add), | $this->renderSlugList($add), | ||||
count($rem), | phutil_count($rem), | ||||
$this->renderSlugList($rem)); | $this->renderSlugList($rem)); | ||||
} else if ($add) { | } else if ($add) { | ||||
return pht( | return pht( | ||||
'%s added %d %s hashtag(s): %s.', | '%s added %s %s hashtag(s): %s.', | ||||
$author_handle, | $author_handle, | ||||
count($add), | phutil_count($add), | ||||
$object_handle, | $object_handle, | ||||
$this->renderSlugList($add)); | $this->renderSlugList($add)); | ||||
} else if ($rem) { | } else if ($rem) { | ||||
return pht( | return pht( | ||||
'%s removed %d %s hashtag(s): %s.', | '%s removed %d %s hashtag(s): %s.', | ||||
$author_handle, | $author_handle, | ||||
count($rem), | phutil_count($rem), | ||||
$object_handle, | $object_handle, | ||||
$this->renderSlugList($rem)); | $this->renderSlugList($rem)); | ||||
} | } | ||||
} | } | ||||
return parent::getTitleForFeed(); | return parent::getTitleForFeed(); | ||||
} | } | ||||
Show All 40 Lines |