Changeset View
Changeset View
Standalone View
Standalone View
src/applications/macro/xaction/PhabricatorMacroNameTransaction.php
Show All 17 Lines | return pht( | ||||
'%s renamed this macro from %s to %s.', | '%s renamed this macro from %s to %s.', | ||||
$this->renderAuthor(), | $this->renderAuthor(), | ||||
$this->renderOldValue(), | $this->renderOldValue(), | ||||
$this->renderNewValue()); | $this->renderNewValue()); | ||||
} | } | ||||
public function getTitleForFeed() { | public function getTitleForFeed() { | ||||
return pht( | return pht( | ||||
'%s renamed %s macro %s to %s.', | '%s renamed %s from %s to %s.', | ||||
$this->renderAuthor(), | $this->renderAuthor(), | ||||
$this->renderObject(), | $this->renderObject(), | ||||
$this->renderOldValue(), | $this->renderOldValue(), | ||||
$this->renderNewValue()); | $this->renderNewValue()); | ||||
} | } | ||||
public function validateTransactions($object, array $xactions) { | public function validateTransactions($object, array $xactions) { | ||||
$errors = array(); | $errors = array(); | ||||
$viewer = $this->getActor(); | $viewer = $this->getActor(); | ||||
if ($this->isEmptyTextTransaction($object->getName(), $xactions)) { | if ($this->isEmptyTextTransaction($object->getName(), $xactions)) { | ||||
$errors[] = $this->newRequiredError( | $errors[] = $this->newRequiredError( | ||||
pht('Macros must have a name.')); | pht('Macros must have a name.')); | ||||
return $errors; | |||||
} | } | ||||
$max_length = $object->getColumnMaximumByteLength('name'); | $max_length = $object->getColumnMaximumByteLength('name'); | ||||
foreach ($xactions as $xaction) { | foreach ($xactions as $xaction) { | ||||
$old_value = $this->generateOldValue($object); | $old_value = $this->generateOldValue($object); | ||||
$new_value = $xaction->getNewValue(); | $new_value = $xaction->getNewValue(); | ||||
$new_length = strlen($new_value); | $new_length = strlen($new_value); | ||||
Show All 33 Lines |