Differential D19625 Diff 46912 src/applications/phriction/controller/PhrictionDocumentController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phriction/controller/PhrictionDocumentController.php
Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | if (!$document) { | ||||
$core_content = id(new PHUIBigInfoView()) | $core_content = id(new PHUIBigInfoView()) | ||||
->setIcon('fa-book') | ->setIcon('fa-book') | ||||
->setTitle($title) | ->setTitle($title) | ||||
->setDescription($subtitle) | ->setDescription($subtitle) | ||||
->addAction($create_button); | ->addAction($create_button); | ||||
} else { | } else { | ||||
$draft_content = id(new PhrictionContentQuery()) | $max_version = (int)$document->getMaxVersion(); | ||||
->setViewer($viewer) | |||||
->withDocumentPHIDs(array($document->getPHID())) | |||||
->setLimit(1) | |||||
->executeOne(); | |||||
$max_version = (int)$draft_content->getVersion(); | |||||
$version = $request->getInt('v'); | $version = $request->getInt('v'); | ||||
if ($version) { | if ($version) { | ||||
$content = id(new PhrictionContentQuery()) | $content = id(new PhrictionContentQuery()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->withDocumentPHIDs(array($document->getPHID())) | ->withDocumentPHIDs(array($document->getPHID())) | ||||
->withVersions(array($version)) | ->withVersions(array($version)) | ||||
->executeOne(); | ->executeOne(); | ||||
▲ Show 20 Lines • Show All 559 Lines • Show Last 20 Lines |