Changeset View
Changeset View
Standalone View
Standalone View
src/applications/maniphest/storage/ManiphestTransaction.php
Show First 20 Lines • Show All 540 Lines • ▼ Show 20 Lines | switch ($this->getTransactionType()) { | ||||
$new = nonempty($new, array()); | $new = nonempty($new, array()); | ||||
$new = array_keys(idx($new, 'FILE', array())); | $new = array_keys(idx($new, 'FILE', array())); | ||||
$old = array_keys(idx($old, 'FILE', array())); | $old = array_keys(idx($old, 'FILE', array())); | ||||
$added = array_diff($new, $old); | $added = array_diff($new, $old); | ||||
$removed = array_diff($old, $new); | $removed = array_diff($old, $new); | ||||
if ($added && !$removed) { | if ($added && !$removed) { | ||||
return pht( | return pht( | ||||
'%s attached %d file(s): %s.', | '%s attached %s file(s): %s.', | ||||
$this->renderHandleLink($author_phid), | $this->renderHandleLink($author_phid), | ||||
count($added), | phutil_count($added), | ||||
$this->renderHandleList($added)); | $this->renderHandleList($added)); | ||||
} else if ($removed && !$added) { | } else if ($removed && !$added) { | ||||
return pht( | return pht( | ||||
'%s detached %d file(s): %s.', | '%s detached %s file(s): %s.', | ||||
$this->renderHandleLink($author_phid), | $this->renderHandleLink($author_phid), | ||||
count($removed), | phutil_count($removed), | ||||
$this->renderHandleList($removed)); | $this->renderHandleList($removed)); | ||||
} else { | } else { | ||||
return pht( | return pht( | ||||
'%s changed file(s), attached %d: %s; detached %d: %s.', | '%s changed file(s), attached %s: %s; detached %s: %s.', | ||||
$this->renderHandleLink($author_phid), | $this->renderHandleLink($author_phid), | ||||
count($added), | phutil_count($added), | ||||
$this->renderHandleList($added), | $this->renderHandleList($added), | ||||
count($removed), | phutil_count($removed), | ||||
$this->renderHandleList($removed)); | $this->renderHandleList($removed)); | ||||
} | } | ||||
case self::TYPE_PROJECT_COLUMN: | case self::TYPE_PROJECT_COLUMN: | ||||
$project_phid = $new['projectPHID']; | $project_phid = $new['projectPHID']; | ||||
$column_phid = head($new['columnPHIDs']); | $column_phid = head($new['columnPHIDs']); | ||||
return pht( | return pht( | ||||
'%s moved this task to %s on the %s workboard.', | '%s moved this task to %s on the %s workboard.', | ||||
$this->renderHandleLink($author_phid), | $this->renderHandleLink($author_phid), | ||||
$this->renderHandleLink($column_phid), | $this->renderHandleLink($column_phid), | ||||
$this->renderHandleLink($project_phid)); | $this->renderHandleLink($project_phid)); | ||||
break; | break; | ||||
case self::TYPE_MERGED_INTO: | case self::TYPE_MERGED_INTO: | ||||
return pht( | return pht( | ||||
'%s closed this task as a duplicate of %s.', | '%s closed this task as a duplicate of %s.', | ||||
$this->renderHandleLink($author_phid), | $this->renderHandleLink($author_phid), | ||||
$this->renderHandleLink($new)); | $this->renderHandleLink($new)); | ||||
break; | break; | ||||
case self::TYPE_MERGED_FROM: | case self::TYPE_MERGED_FROM: | ||||
return pht( | return pht( | ||||
'%s merged %d task(s): %s.', | '%s merged %s task(s): %s.', | ||||
$this->renderHandleLink($author_phid), | $this->renderHandleLink($author_phid), | ||||
count($new), | phutil_count($new), | ||||
$this->renderHandleList($new)); | $this->renderHandleList($new)); | ||||
break; | break; | ||||
} | } | ||||
return parent::getTitle(); | return parent::getTitle(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 326 Lines • Show Last 20 Lines |