Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F80233529
ManiphestTaskOpenStatusDatasource.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Aug 30, 14:47
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Sep 1, 14:47 (2 d)
Engine
blob
Format
Raw Data
Handle
20328061
Attached To
rPH Phabricator
ManiphestTaskOpenStatusDatasource.php
View Options
<?php
final
class
ManiphestTaskOpenStatusDatasource
extends
PhabricatorTypeaheadDatasource
{
const
FUNCTION_TOKEN
=
'open()'
;
public
function
getBrowseTitle
()
{
return
pht
(
'Browse Any Open Status'
);
}
public
function
getPlaceholderText
()
{
return
pht
(
'Type open()...'
);
}
public
function
getDatasourceApplicationClass
()
{
return
'PhabricatorManiphestApplication'
;
}
public
function
getDatasourceFunctions
()
{
return
array
(
'open'
=>
array
(
'name'
=>
pht
(
'Any Open Status'
),
'summary'
=>
pht
(
'Find results with any open status.'
),
'description'
=>
pht
(
'This function includes results which have any open status.'
),
),
);
}
public
function
loadResults
()
{
$results
=
array
(
$this
->
buildOpenResult
(),
);
return
$this
->
filterResultsAgainstTokens
(
$results
);
}
protected
function
evaluateFunction
(
$function
,
array
$argv_list
)
{
$results
=
array
();
$map
=
ManiphestTaskStatus
::
getTaskStatusMap
();
foreach
(
$argv_list
as
$argv
)
{
foreach
(
$map
as
$status
=>
$name
)
{
if
(
ManiphestTaskStatus
::
isOpenStatus
(
$status
))
{
$results
[]
=
$status
;
}
}
}
return
$results
;
}
public
function
renderFunctionTokens
(
$function
,
array
$argv_list
)
{
$results
=
array
();
foreach
(
$argv_list
as
$argv
)
{
$results
[]
=
PhabricatorTypeaheadTokenView
::
newFromTypeaheadResult
(
$this
->
buildOpenResult
());
}
return
$results
;
}
private
function
buildOpenResult
()
{
$name
=
pht
(
'Any Open Status'
);
return
$this
->
newFunctionResult
()
->
setName
(
$name
.
' open'
)
->
setDisplayName
(
$name
)
->
setPHID
(
self
::
FUNCTION_TOKEN
)
->
setUnique
(
true
)
->
addAttribute
(
pht
(
'Select any open status.'
));
}
}
Event Timeline
Log In to Comment