Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2369062
HarbormasterPlanOrderController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
HarbormasterPlanOrderController.php
View Options
<?php
final
class
HarbormasterPlanOrderController
extends
HarbormasterController
{
private
$id
;
public
function
willProcessRequest
(
array
$data
)
{
$this
->
id
=
idx
(
$data
,
'id'
);
}
public
function
processRequest
()
{
$request
=
$this
->
getRequest
();
$user
=
$request
->
getUser
();
$request
->
validateCSRF
();
$this
->
requireApplicationCapability
(
HarbormasterManagePlansCapability
::
CAPABILITY
);
$plan
=
id
(
new
HarbormasterBuildPlanQuery
())
->
setViewer
(
$user
)
->
withIDs
(
array
(
$this
->
id
))
->
executeOne
();
if
(!
$plan
)
{
return
new
Aphront404Response
();
}
// Load all steps.
$order
=
$request
->
getStrList
(
'order'
);
$steps
=
id
(
new
HarbormasterBuildStepQuery
())
->
setViewer
(
$user
)
->
withIDs
(
$order
)
->
execute
();
$steps
=
array_select_keys
(
$steps
,
$order
);
$reordered_steps
=
array
();
// Apply sequences.
$sequence
=
1
;
foreach
(
$steps
as
$step
)
{
$step
->
setSequence
(
$sequence
++);
$step
->
save
();
$reordered_steps
[]
=
$step
;
}
// NOTE: Reordering steps may invalidate artifacts. This is fine; the UI
// will show that there are ordering issues.
// Force the page to re-render.
return
id
(
new
AphrontRedirectResponse
());
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Sep 16, 6:47 PM (1 d, 23 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
447694
Default Alt Text
HarbormasterPlanOrderController.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment