Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90942343
PhabricatorAuthInviteSearchEngine.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
Wed, Nov 6, 06:22
Size
2 KB
Mime Type
text/x-php
Expires
Fri, Nov 8, 06:22 (2 d)
Engine
blob
Format
Raw Data
Handle
22164464
Attached To
rPH Phabricator
PhabricatorAuthInviteSearchEngine.php
View Options
<?php
final
class
PhabricatorAuthInviteSearchEngine
extends
PhabricatorApplicationSearchEngine
{
public
function
getResultTypeDescription
()
{
return
pht
(
'Email Invites'
);
}
public
function
getApplicationClassName
()
{
return
'PhabricatorAuthApplication'
;
}
public
function
buildSavedQueryFromRequest
(
AphrontRequest
$request
)
{
$saved
=
new
PhabricatorSavedQuery
();
return
$saved
;
}
public
function
buildQueryFromSavedQuery
(
PhabricatorSavedQuery
$saved
)
{
$query
=
id
(
new
PhabricatorAuthInviteQuery
());
return
$query
;
}
public
function
buildSearchForm
(
AphrontFormView
$form
,
PhabricatorSavedQuery
$saved
)
{}
protected
function
getURI
(
$path
)
{
return
'/people/invite/'
.
$path
;
}
protected
function
getBuiltinQueryNames
()
{
$names
=
array
(
'all'
=>
pht
(
'All'
),
);
return
$names
;
}
public
function
buildSavedQueryFromBuiltin
(
$query_key
)
{
$query
=
$this
->
newSavedQuery
();
$query
->
setQueryKey
(
$query_key
);
switch
(
$query_key
)
{
case
'all'
:
return
$query
;
}
return
parent
::
buildSavedQueryFromBuiltin
(
$query_key
);
}
protected
function
getRequiredHandlePHIDsForResultList
(
array
$invites
,
PhabricatorSavedQuery
$query
)
{
$phids
=
array
();
foreach
(
$invites
as
$invite
)
{
$phids
[
$invite
->
getAuthorPHID
()]
=
true
;
if
(
$invite
->
getAcceptedByPHID
())
{
$phids
[
$invite
->
getAcceptedByPHID
()]
=
true
;
}
}
return
array_keys
(
$phids
);
}
protected
function
renderResultList
(
array
$invites
,
PhabricatorSavedQuery
$query
,
array
$handles
)
{
assert_instances_of
(
$invites
,
'PhabricatorAuthInvite'
);
$viewer
=
$this
->
requireViewer
();
$rows
=
array
();
foreach
(
$invites
as
$invite
)
{
$rows
[]
=
array
(
$invite
->
getEmailAddress
(),
$handles
[
$invite
->
getAuthorPHID
()]->
renderLink
(),
(
$invite
->
getAcceptedByPHID
()
?
$handles
[
$invite
->
getAcceptedByPHID
()]->
renderLink
()
:
null
),
phabricator_datetime
(
$invite
->
getDateCreated
(),
$viewer
),
);
}
$table
=
new
AphrontTableView
(
$rows
);
return
id
(
new
PHUIObjectBoxView
())
->
setHeaderText
(
pht
(
'Email Invitations'
))
->
appendChild
(
$table
);
}
}
Event Timeline
Log In to Comment