Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F551809
ManiphestTaskAttachTransaction.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
ManiphestTaskAttachTransaction.php
View Options
<?php
final
class
ManiphestTaskAttachTransaction
extends
ManiphestTaskTransactionType
{
// NOTE: this type is deprecated. Keep it around for legacy installs
// so any transactions render correctly.
const
TRANSACTIONTYPE
=
'attach'
;
public
function
getActionName
()
{
return
pht
(
'Attached'
);
}
public
function
getTitle
()
{
$old
=
$this
->
getOldValue
();
$new
=
$this
->
getNewValue
();
$old
=
nonempty
(
$old
,
array
());
$new
=
nonempty
(
$new
,
array
());
$new
=
array_keys
(
idx
(
$new
,
'FILE'
,
array
()));
$old
=
array_keys
(
idx
(
$old
,
'FILE'
,
array
()));
$added
=
array_diff
(
$new
,
$old
);
$removed
=
array_diff
(
$old
,
$new
);
if
(
$added
&&
!
$removed
)
{
return
pht
(
'%s attached %s file(s): %s.'
,
$this
->
renderAuthor
(),
phutil_count
(
$added
),
$this
->
renderHandleList
(
$added
));
}
else
if
(
$removed
&&
!
$added
)
{
return
pht
(
'%s detached %s file(s): %s.'
,
$this
->
renderAuthor
(),
phutil_count
(
$removed
),
$this
->
renderHandleList
(
$removed
));
}
else
{
return
pht
(
'%s changed file(s), attached %s: %s; detached %s: %s.'
,
$this
->
renderAuthor
(),
phutil_count
(
$added
),
$this
->
renderHandleList
(
$added
),
phutil_count
(
$removed
),
$this
->
renderHandleList
(
$removed
));
}
}
public
function
getTitleForFeed
()
{
$old
=
$this
->
getOldValue
();
$new
=
$this
->
getNewValue
();
$old
=
nonempty
(
$old
,
array
());
$new
=
nonempty
(
$new
,
array
());
$new
=
array_keys
(
idx
(
$new
,
'FILE'
,
array
()));
$old
=
array_keys
(
idx
(
$old
,
'FILE'
,
array
()));
$added
=
array_diff
(
$new
,
$old
);
$removed
=
array_diff
(
$old
,
$new
);
if
(
$added
&&
!
$removed
)
{
return
pht
(
'%s attached %d file(s) of %s: %s'
,
$this
->
renderAuthor
(),
$this
->
renderObject
(),
count
(
$added
),
$this
->
renderHandleList
(
$added
));
}
else
if
(
$removed
&&
!
$added
)
{
return
pht
(
'%s detached %d file(s) of %s: %s'
,
$this
->
renderAuthor
(),
$this
->
renderObject
(),
count
(
$removed
),
$this
->
renderHandleList
(
$removed
));
}
else
{
return
pht
(
'%s changed file(s) for %s, attached %d: %s; detached %d: %s'
,
$this
->
renderAuthor
(),
$this
->
renderObject
(),
count
(
$added
),
$this
->
renderHandleList
(
$added
),
count
(
$removed
),
$this
->
renderHandleList
(
$removed
));
}
}
public
function
getIcon
()
{
return
'fa-thumb-tack'
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 12, 3:55 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
122446
Default Alt Text
ManiphestTaskAttachTransaction.php (2 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment