Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phriction/controller/PhrictionEditController.php
Show First 20 Lines • Show All 130 Lines • ▼ Show 20 Lines | if ($request->isFormPost()) { | ||||
$v_cc = $request->getArr('cc'); | $v_cc = $request->getArr('cc'); | ||||
$v_projects = $request->getArr('projects'); | $v_projects = $request->getArr('projects'); | ||||
$xactions = array(); | $xactions = array(); | ||||
$xactions[] = id(new PhrictionTransaction()) | $xactions[] = id(new PhrictionTransaction()) | ||||
->setTransactionType(PhrictionDocumentTitleTransaction::TRANSACTIONTYPE) | ->setTransactionType(PhrictionDocumentTitleTransaction::TRANSACTIONTYPE) | ||||
->setNewValue($title); | ->setNewValue($title); | ||||
$xactions[] = id(new PhrictionTransaction()) | $xactions[] = id(new PhrictionTransaction()) | ||||
->setTransactionType(PhrictionTransaction::TYPE_CONTENT) | ->setTransactionType( | ||||
PhrictionDocumentContentTransaction::TRANSACTIONTYPE) | |||||
->setNewValue($content_text); | ->setNewValue($content_text); | ||||
$xactions[] = id(new PhrictionTransaction()) | $xactions[] = id(new PhrictionTransaction()) | ||||
->setTransactionType(PhabricatorTransactions::TYPE_VIEW_POLICY) | ->setTransactionType(PhabricatorTransactions::TYPE_VIEW_POLICY) | ||||
->setNewValue($v_view); | ->setNewValue($v_view); | ||||
$xactions[] = id(new PhrictionTransaction()) | $xactions[] = id(new PhrictionTransaction()) | ||||
->setTransactionType(PhabricatorTransactions::TYPE_EDIT_POLICY) | ->setTransactionType(PhabricatorTransactions::TYPE_EDIT_POLICY) | ||||
->setNewValue($v_edit); | ->setNewValue($v_edit); | ||||
$xactions[] = id(new PhrictionTransaction()) | $xactions[] = id(new PhrictionTransaction()) | ||||
Show All 25 Lines | if ($request->isFormPost()) { | ||||
return id(new AphrontRedirectResponse())->setURI($uri); | return id(new AphrontRedirectResponse())->setURI($uri); | ||||
} catch (PhabricatorApplicationTransactionValidationException $ex) { | } catch (PhabricatorApplicationTransactionValidationException $ex) { | ||||
$validation_exception = $ex; | $validation_exception = $ex; | ||||
$e_title = nonempty( | $e_title = nonempty( | ||||
$ex->getShortMessage( | $ex->getShortMessage( | ||||
PhrictionDocumentTitleTransaction::TRANSACTIONTYPE), | PhrictionDocumentTitleTransaction::TRANSACTIONTYPE), | ||||
true); | true); | ||||
$e_content = nonempty( | $e_content = nonempty( | ||||
$ex->getShortMessage(PhrictionTransaction::TYPE_CONTENT), | $ex->getShortMessage( | ||||
PhrictionDocumentContentTransaction::TRANSACTIONTYPE), | |||||
true); | true); | ||||
// if we're not supposed to process the content version error, then | // if we're not supposed to process the content version error, then | ||||
// overwrite that content...! | // overwrite that content...! | ||||
if (!$editor->getProcessContentVersionError()) { | if (!$editor->getProcessContentVersionError()) { | ||||
$overwrite = true; | $overwrite = true; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 142 Lines • Show Last 20 Lines |