@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove ManiphestTransactionDetailView

Summary: Ref T2217. No remaining callsites. Also nukes associated CSS.

Test Plan: `grep`, looked at some tasks.

Reviewers: btrahan

Reviewed By: btrahan

CC: chad, aran

Maniphest Tasks: T2217

Differential Revision: https://secure.phabricator.com/D7076

+5 -879
-1
scripts/celerity_mapper.php
··· 161 161 ), 162 162 'maniphest.pkg.css' => array( 163 163 'maniphest-task-summary-css', 164 - 'maniphest-transaction-detail-css', 165 164 'phabricator-project-tag-css', 166 165 ), 167 166 'maniphest.pkg.js' => array(
+5 -16
src/__celerity_resource_map__.php
··· 2924 2924 ), 2925 2925 'disk' => '/rsrc/css/application/maniphest/task-summary.css', 2926 2926 ), 2927 - 'maniphest-transaction-detail-css' => 2928 - array( 2929 - 'uri' => '/res/f2c9582c/rsrc/css/application/maniphest/transaction-detail.css', 2930 - 'type' => 'css', 2931 - 'requires' => 2932 - array( 2933 - ), 2934 - 'disk' => '/rsrc/css/application/maniphest/transaction-detail.css', 2935 - ), 2936 2927 'multirow-row-manager' => 2937 2928 array( 2938 2929 'uri' => '/res/408fae4f/rsrc/js/core/MultirowRowManager.js', ··· 4380 4371 'uri' => '/res/pkg/9564fa17/javelin.pkg.js', 4381 4372 'type' => 'js', 4382 4373 ), 4383 - '36d5d071' => 4374 + 49898640 => 4384 4375 array( 4385 4376 'name' => 'maniphest.pkg.css', 4386 4377 'symbols' => 4387 4378 array( 4388 4379 0 => 'maniphest-task-summary-css', 4389 - 1 => 'maniphest-transaction-detail-css', 4390 - 2 => 'phabricator-project-tag-css', 4380 + 1 => 'phabricator-project-tag-css', 4391 4381 ), 4392 - 'uri' => '/res/pkg/36d5d071/maniphest.pkg.css', 4382 + 'uri' => '/res/pkg/49898640/maniphest.pkg.css', 4393 4383 'type' => 'css', 4394 4384 ), 4395 4385 '83a3853e' => ··· 4505 4495 'javelin-vector' => '9564fa17', 4506 4496 'javelin-workflow' => '9564fa17', 4507 4497 'lightbox-attachment-css' => 'b1d5e69b', 4508 - 'maniphest-task-summary-css' => '36d5d071', 4509 - 'maniphest-transaction-detail-css' => '36d5d071', 4498 + 'maniphest-task-summary-css' => '49898640', 4510 4499 'phabricator-action-list-view-css' => 'b1d5e69b', 4511 4500 'phabricator-application-launch-view-css' => 'b1d5e69b', 4512 4501 'phabricator-busy' => '8977e356', ··· 4531 4520 'phabricator-object-selector-css' => '44bfe40c', 4532 4521 'phabricator-phtize' => '8977e356', 4533 4522 'phabricator-prefab' => '8977e356', 4534 - 'phabricator-project-tag-css' => '36d5d071', 4523 + 'phabricator-project-tag-css' => '49898640', 4535 4524 'phabricator-property-list-view-css' => 'b1d5e69b', 4536 4525 'phabricator-remarkup-css' => 'b1d5e69b', 4537 4526 'phabricator-shaped-request' => '5e9e5c4e',
-2
src/__phutil_library_map__.php
··· 734 734 'ManiphestTaskSubscriber' => 'applications/maniphest/storage/ManiphestTaskSubscriber.php', 735 735 'ManiphestTransaction' => 'applications/maniphest/storage/ManiphestTransaction.php', 736 736 'ManiphestTransactionComment' => 'applications/maniphest/storage/ManiphestTransactionComment.php', 737 - 'ManiphestTransactionDetailView' => 'applications/maniphest/view/ManiphestTransactionDetailView.php', 738 737 'ManiphestTransactionEditor' => 'applications/maniphest/editor/ManiphestTransactionEditor.php', 739 738 'ManiphestTransactionPreviewController' => 'applications/maniphest/controller/ManiphestTransactionPreviewController.php', 740 739 'ManiphestTransactionPro' => 'applications/maniphest/storage/ManiphestTransactionPro.php', ··· 2826 2825 'ManiphestTaskSubscriber' => 'ManiphestDAO', 2827 2826 'ManiphestTransaction' => 'PhabricatorMarkupInterface', 2828 2827 'ManiphestTransactionComment' => 'PhabricatorApplicationTransactionComment', 2829 - 'ManiphestTransactionDetailView' => 'ManiphestView', 2830 2828 'ManiphestTransactionEditor' => 'PhabricatorEditor', 2831 2829 'ManiphestTransactionPreviewController' => 'ManiphestController', 2832 2830 'ManiphestTransactionPro' => 'PhabricatorApplicationTransaction',
-789
src/applications/maniphest/view/ManiphestTransactionDetailView.php
··· 1 - <?php 2 - 3 - /** 4 - * @group maniphest 5 - */ 6 - final class ManiphestTransactionDetailView extends ManiphestView { 7 - 8 - private $transactions; 9 - private $handles; 10 - private $markupEngine; 11 - private $forEmail; 12 - private $preview; 13 - private $commentNumber; 14 - 15 - private $auxiliaryFields; 16 - 17 - public function setAuxiliaryFields(array $fields) { 18 - assert_instances_of($fields, 'ManiphestCustomField'); 19 - $this->auxiliaryFields = mpull($fields, null, 'getFieldKey'); 20 - return $this; 21 - } 22 - 23 - public function getAuxiliaryField($key) { 24 - return idx($this->auxiliaryFields, $key); 25 - } 26 - 27 - public function setTransactionGroup(array $transactions) { 28 - assert_instances_of($transactions, 'ManiphestTransaction'); 29 - $this->transactions = $transactions; 30 - return $this; 31 - } 32 - 33 - public function setHandles(array $handles) { 34 - assert_instances_of($handles, 'PhabricatorObjectHandle'); 35 - $this->handles = $handles; 36 - return $this; 37 - } 38 - 39 - public function setMarkupEngine(PhabricatorMarkupEngine $engine) { 40 - $this->markupEngine = $engine; 41 - return $this; 42 - } 43 - 44 - public function setPreview($preview) { 45 - $this->preview = $preview; 46 - return $this; 47 - } 48 - 49 - public function setCommentNumber($comment_number) { 50 - $this->commentNumber = $comment_number; 51 - return $this; 52 - } 53 - 54 - public function renderForEmail($with_date) { 55 - $this->forEmail = true; 56 - 57 - $transaction = reset($this->transactions); 58 - $author = $this->renderHandles(array($transaction->getAuthorPHID())); 59 - 60 - $action = null; 61 - $descs = array(); 62 - $comments = null; 63 - foreach ($this->transactions as $transaction) { 64 - list($verb, $desc, $classes, $full) = $this->describeAction($transaction); 65 - 66 - if ($full) { 67 - $desc = $full; 68 - } else { 69 - if ($desc === null) { 70 - continue; 71 - } else { 72 - $desc = $author.' '.$desc.'.'; 73 - } 74 - } 75 - 76 - if ($action === null) { 77 - $action = $verb; 78 - } 79 - 80 - if ($with_date) { 81 - // NOTE: This is going into a (potentially multi-recipient) email so 82 - // we can't use a single user's timezone preferences. Use the server's 83 - // instead, but make the timezone explicit. 84 - $datetime = date('M jS \a\t g:i A T', $transaction->getDateCreated()); 85 - $desc = "On {$datetime}, {$desc}"; 86 - } 87 - $descs[] = $desc; 88 - if ($transaction->hasComments()) { 89 - $comments = $transaction->getComments(); 90 - } 91 - } 92 - 93 - $descs = implode("\n", $descs); 94 - 95 - if ($comments) { 96 - $descs .= "\n".$comments; 97 - } 98 - 99 - foreach ($this->transactions as $transaction) { 100 - $supplemental = $this->renderSupplementalInfoForEmail($transaction); 101 - if ($supplemental) { 102 - $descs .= "\n\n".$supplemental; 103 - } 104 - } 105 - 106 - $this->forEmail = false; 107 - return array($action, $descs); 108 - } 109 - 110 - public function render() { 111 - 112 - if (!$this->user) { 113 - throw new Exception("Call setUser() before render()!"); 114 - } 115 - 116 - $handles = $this->handles; 117 - $transactions = $this->transactions; 118 - 119 - require_celerity_resource('maniphest-transaction-detail-css'); 120 - 121 - $comment_transaction = null; 122 - foreach ($this->transactions as $transaction) { 123 - if ($transaction->hasComments()) { 124 - $comment_transaction = $transaction; 125 - break; 126 - } 127 - } 128 - $any_transaction = reset($transactions); 129 - 130 - $author = $this->handles[$any_transaction->getAuthorPHID()]; 131 - 132 - $more_classes = array(); 133 - $descs = array(); 134 - foreach ($transactions as $transaction) { 135 - list($verb, $desc, $classes, $full) = $this->describeAction($transaction); 136 - if ($full) { 137 - $descs[] = javelin_tag( 138 - 'div', 139 - array( 140 - 'sigil' => 'maniphest-transaction-description', 141 - ), 142 - $full); 143 - continue; 144 - } 145 - 146 - if ($desc === null) { 147 - continue; 148 - } 149 - $more_classes = array_merge($more_classes, $classes); 150 - $full_summary = null; 151 - $descs[] = javelin_tag( 152 - 'div', 153 - array( 154 - 'sigil' => 'maniphest-transaction-description', 155 - ), 156 - array( 157 - $author->renderLink(), 158 - ' ', 159 - $desc, 160 - '.', 161 - $full_summary, 162 - )); 163 - } 164 - 165 - if ($comment_transaction && $comment_transaction->hasComments()) { 166 - $comment_block = $this->markupEngine->getOutput( 167 - $comment_transaction, 168 - ManiphestTransaction::MARKUP_FIELD_BODY); 169 - $comment_block = phutil_tag( 170 - 'div', 171 - array('class' => 'maniphest-transaction-comments phabricator-remarkup'), 172 - $comment_block); 173 - } else { 174 - $comment_block = null; 175 - } 176 - 177 - $source_transaction = nonempty($comment_transaction, $any_transaction); 178 - 179 - $xaction_view = id(new PhabricatorTransactionView()) 180 - ->setUser($this->user) 181 - ->setImageURI($author->getImageURI()) 182 - ->setContentSource($source_transaction->getContentSource()) 183 - ->setActions($descs); 184 - 185 - foreach ($more_classes as $class) { 186 - $xaction_view->addClass($class); 187 - } 188 - 189 - if ($this->preview) { 190 - $xaction_view->setIsPreview($this->preview); 191 - } else { 192 - $xaction_view->setEpoch($any_transaction->getDateCreated()); 193 - if ($this->commentNumber) { 194 - $anchor_name = 'comment-'.$this->commentNumber; 195 - $anchor_text = 196 - '#'.$this->commentNumber; 197 - 198 - $xaction_view->setAnchor($anchor_name, $anchor_text); 199 - } 200 - } 201 - 202 - $xaction_view->appendChild($comment_block); 203 - 204 - return $xaction_view->render(); 205 - } 206 - 207 - private function renderSupplementalInfoForEmail($transaction) { 208 - $handles = $this->handles; 209 - 210 - $type = $transaction->getTransactionType(); 211 - $new = $transaction->getNewValue(); 212 - $old = $transaction->getOldValue(); 213 - 214 - switch ($type) { 215 - case ManiphestTransactionType::TYPE_DESCRIPTION: 216 - return "NEW DESCRIPTION\n ".trim($new)."\n\n". 217 - "PREVIOUS DESCRIPTION\n ".trim($old); 218 - case ManiphestTransactionType::TYPE_ATTACH: 219 - $old_raw = nonempty($old, array()); 220 - $new_raw = nonempty($new, array()); 221 - 222 - $attach_types = array( 223 - DifferentialPHIDTypeRevision::TYPECONST, 224 - PhabricatorFilePHIDTypeFile::TYPECONST, 225 - ); 226 - 227 - foreach ($attach_types as $attach_type) { 228 - $old = array_keys(idx($old_raw, $attach_type, array())); 229 - $new = array_keys(idx($new_raw, $attach_type, array())); 230 - if ($old != $new) { 231 - break; 232 - } 233 - } 234 - 235 - $added = array_diff($new, $old); 236 - if (!$added) { 237 - break; 238 - } 239 - 240 - $links = array(); 241 - foreach (array_select_keys($handles, $added) as $handle) { 242 - $links[] = ' '.PhabricatorEnv::getProductionURI($handle->getURI()); 243 - } 244 - $links = implode("\n", $links); 245 - 246 - switch ($attach_type) { 247 - case DifferentialPHIDTypeRevision::TYPECONST: 248 - $title = 'ATTACHED REVISIONS'; 249 - break; 250 - case PhabricatorFilePHIDTypeFile::TYPECONST: 251 - $title = 'ATTACHED FILES'; 252 - break; 253 - } 254 - 255 - return $title."\n".$links; 256 - case ManiphestTransactionType::TYPE_EDGE: 257 - $add = array_diff_key($new, $old); 258 - if (!$add) { 259 - break; 260 - } 261 - 262 - $links = array(); 263 - foreach ($add as $phid => $ignored) { 264 - $handle = $handles[$phid]; 265 - $links[] = ' '.PhabricatorEnv::getProductionURI($handle->getURI()); 266 - } 267 - $links = implode("\n", $links); 268 - 269 - $edge_type = $transaction->getMetadataValue('edge:type'); 270 - $title = $this->getEdgeEmailTitle($edge_type, $add); 271 - 272 - return $title."\n".$links; 273 - default: 274 - break; 275 - } 276 - 277 - return null; 278 - } 279 - 280 - private function describeAction($transaction) { 281 - $verb = null; 282 - $desc = null; 283 - $full = null; 284 - $classes = array(); 285 - 286 - $handles = $this->handles; 287 - 288 - $type = $transaction->getTransactionType(); 289 - $author_phid = $transaction->getAuthorPHID(); 290 - $new = $transaction->getNewValue(); 291 - $old = $transaction->getOldValue(); 292 - switch ($type) { 293 - case ManiphestTransactionType::TYPE_TITLE: 294 - $verb = 'Retitled'; 295 - $desc = 'changed the title from '.$this->renderString($old). 296 - ' to '.$this->renderString($new); 297 - break; 298 - case ManiphestTransactionType::TYPE_DESCRIPTION: 299 - $verb = 'Edited'; 300 - $desc = 'updated the task description'; 301 - break; 302 - case PhabricatorTransactions::TYPE_COMMENT: 303 - $verb = 'Commented On'; 304 - $desc = 'added a comment'; 305 - break; 306 - case ManiphestTransactionType::TYPE_OWNER: 307 - if ($transaction->getAuthorPHID() == $new) { 308 - $verb = 'Claimed'; 309 - $desc = 'claimed this task'; 310 - $classes[] = 'claimed'; 311 - } else if (!$new) { 312 - $verb = 'Up For Grabs'; 313 - $desc = 'placed this task up for grabs'; 314 - $classes[] = 'upforgrab'; 315 - } else if (!$old) { 316 - $verb = 'Assigned'; 317 - $desc = 'assigned this task to '.$this->renderHandles(array($new)); 318 - $classes[] = 'assigned'; 319 - } else { 320 - $verb = 'Reassigned'; 321 - $desc = 'reassigned this task from '. 322 - $this->renderHandles(array($old)). 323 - ' to '. 324 - $this->renderHandles(array($new)); 325 - $classes[] = 'reassigned'; 326 - } 327 - break; 328 - case ManiphestTransactionType::TYPE_CCS: 329 - $added = array_diff($new, $old); 330 - $removed = array_diff($old, $new); 331 - // can only add in preview so just show placeholder if nothing to add 332 - if ($this->preview && empty($added)) { 333 - $verb = 'Changed CC'; 334 - $desc = 'changed CCs..'; 335 - break; 336 - } 337 - if ($added && !$removed) { 338 - $verb = 'Added CC'; 339 - if (count($added) == 1) { 340 - $desc = 'added '.$this->renderHandles($added).' to CC'; 341 - } else { 342 - $desc = 'added CCs: '.$this->renderHandles($added); 343 - } 344 - } else if ($removed && !$added) { 345 - $verb = 'Removed CC'; 346 - if (count($removed) == 1) { 347 - $desc = 'removed '.$this->renderHandles($removed).' from CC'; 348 - } else { 349 - $desc = 'removed CCs: '.$this->renderHandles($removed); 350 - } 351 - } else { 352 - $verb = 'Changed CC'; 353 - $desc = 'changed CCs, added: '.$this->renderHandles($added).'; '. 354 - 'removed: '.$this->renderHandles($removed); 355 - } 356 - break; 357 - case ManiphestTransactionType::TYPE_EDGE: 358 - $edge_type = $transaction->getMetadataValue('edge:type'); 359 - 360 - $add = array_diff_key($new, $old); 361 - $rem = array_diff_key($old, $new); 362 - 363 - if ($add && !$rem) { 364 - $verb = $this->getEdgeAddVerb($edge_type); 365 - $desc = $this->getEdgeAddList($edge_type, $add); 366 - } else if ($rem && !$add) { 367 - $verb = $this->getEdgeRemVerb($edge_type); 368 - $desc = $this->getEdgeRemList($edge_type, $rem); 369 - } else { 370 - $verb = $this->getEdgeEditVerb($edge_type); 371 - $desc = $this->getEdgeEditList($edge_type, $add, $rem); 372 - } 373 - break; 374 - case ManiphestTransactionType::TYPE_PROJECTS: 375 - $added = array_diff($new, $old); 376 - $removed = array_diff($old, $new); 377 - // can only add in preview so just show placeholder if nothing to add 378 - if ($this->preview && empty($added)) { 379 - $verb = 'Changed Projects'; 380 - $desc = 'changed projects..'; 381 - break; 382 - } 383 - if ($added && !$removed) { 384 - $verb = 'Added Project'; 385 - if (count($added) == 1) { 386 - $desc = 'added project '.$this->renderHandles($added); 387 - } else { 388 - $desc = 'added projects: '.$this->renderHandles($added); 389 - } 390 - } else if ($removed && !$added) { 391 - $verb = 'Removed Project'; 392 - if (count($removed) == 1) { 393 - $desc = 'removed project '.$this->renderHandles($removed); 394 - } else { 395 - $desc = 'removed projects: '.$this->renderHandles($removed); 396 - } 397 - } else { 398 - $verb = 'Changed Projects'; 399 - $desc = 'changed projects, added: '.$this->renderHandles($added).'; '. 400 - 'removed: '.$this->renderHandles($removed); 401 - } 402 - break; 403 - case ManiphestTransactionType::TYPE_STATUS: 404 - if ($new == ManiphestTaskStatus::STATUS_OPEN) { 405 - if ($old) { 406 - $verb = 'Reopened'; 407 - $desc = 'reopened this task'; 408 - $classes[] = 'reopened'; 409 - } else { 410 - $verb = 'Created'; 411 - $desc = 'created this task'; 412 - $classes[] = 'created'; 413 - } 414 - } else if ($new == ManiphestTaskStatus::STATUS_CLOSED_SPITE) { 415 - $verb = 'Spited'; 416 - $desc = 'closed this task out of spite'; 417 - $classes[] = 'spited'; 418 - } else if ($new == ManiphestTaskStatus::STATUS_CLOSED_DUPLICATE) { 419 - $verb = 'Merged'; 420 - $desc = 'closed this task as a duplicate'; 421 - $classes[] = 'duplicate'; 422 - } else { 423 - $verb = 'Closed'; 424 - $full = idx(ManiphestTaskStatus::getTaskStatusMap(), $new, '???'); 425 - $desc = 'closed this task as "'.$full.'"'; 426 - $classes[] = 'closed'; 427 - } 428 - break; 429 - case ManiphestTransactionType::TYPE_PRIORITY: 430 - $old_name = ManiphestTaskPriority::getTaskPriorityName($old); 431 - $new_name = ManiphestTaskPriority::getTaskPriorityName($new); 432 - 433 - if ($old == ManiphestTaskPriority::getDefaultPriority()) { 434 - $verb = 'Triaged'; 435 - $desc = 'triaged this task as "'.$new_name.'" priority'; 436 - } else if ($old > $new) { 437 - $verb = 'Lowered Priority'; 438 - $desc = 'lowered the priority of this task from "'.$old_name.'" to '. 439 - '"'.$new_name.'"'; 440 - } else { 441 - $verb = 'Raised Priority'; 442 - $desc = 'raised the priority of this task from "'.$old_name.'" to '. 443 - '"'.$new_name.'"'; 444 - } 445 - break; 446 - case ManiphestTransactionType::TYPE_ATTACH: 447 - if ($this->preview) { 448 - $verb = 'Changed Attached'; 449 - $desc = 'changed attachments..'; 450 - break; 451 - } 452 - 453 - $old_raw = nonempty($old, array()); 454 - $new_raw = nonempty($new, array()); 455 - 456 - foreach (array( 457 - DifferentialPHIDTypeRevision::TYPECONST, 458 - ManiphestPHIDTypeTask::TYPECONST, 459 - PhabricatorFilePHIDTypeFile::TYPECONST) as $attach_type) { 460 - $old = array_keys(idx($old_raw, $attach_type, array())); 461 - $new = array_keys(idx($new_raw, $attach_type, array())); 462 - if ($old != $new) { 463 - break; 464 - } 465 - } 466 - 467 - $added = array_diff($new, $old); 468 - $removed = array_diff($old, $new); 469 - 470 - $add_desc = $this->renderHandles($added); 471 - $rem_desc = $this->renderHandles($removed); 472 - 473 - if ($added && !$removed) { 474 - $verb = 'Attached'; 475 - $desc = 476 - 'attached '. 477 - $this->getAttachName($attach_type, count($added)).': '. 478 - $add_desc; 479 - } else if ($removed && !$added) { 480 - $verb = 'Detached'; 481 - $desc = 482 - 'detached '. 483 - $this->getAttachName($attach_type, count($removed)).': '. 484 - $rem_desc; 485 - } else { 486 - $verb = 'Changed Attached'; 487 - $desc = 488 - 'changed attached '. 489 - $this->getAttachName($attach_type, count($added) + count($removed)). 490 - ', added: '.$add_desc.'; '. 491 - 'removed: '.$rem_desc; 492 - } 493 - break; 494 - case PhabricatorTransactions::TYPE_CUSTOMFIELD: 495 - $aux_key = $transaction->getMetadataValue('customfield:key'); 496 - $aux_field = idx($this->auxiliaryFields, $aux_key); 497 - 498 - if ($old === null) { 499 - $verb = "Set Field"; 500 - } else if ($new === null) { 501 - $verb = "Removed Field"; 502 - } else { 503 - $verb = "Updated Field"; 504 - } 505 - 506 - $desc = null; 507 - if ($aux_field) { 508 - $proxy_transaction = new ManiphestTransactionPro(); 509 - $proxy_transaction->setOldValue($transaction->getOldValue()); 510 - $proxy_transaction->setNewValue($transaction->getNewValue()); 511 - $proxy_transaction->setAuthorPHID($transaction->getAuthorPHID()); 512 - $proxy_transaction->setHandles($this->handles); 513 - 514 - $full = $aux_field->getApplicationTransactionTitle( 515 - $proxy_transaction); 516 - } else { 517 - $desc = 'updated a field'; 518 - } 519 - 520 - break; 521 - default: 522 - return array($type, ' brazenly '.$type."'d", $classes, null); 523 - } 524 - 525 - // TODO: [HTML] This code will all be rewritten when we switch to using 526 - // ApplicationTransactions. It does not handle HTML or translations 527 - // correctly right now. 528 - $desc = phutil_safe_html($desc); 529 - 530 - return array($verb, $desc, $classes, $full); 531 - } 532 - 533 - private function renderExpandLink($transaction) { 534 - $id = $transaction->getID(); 535 - 536 - Javelin::initBehavior('maniphest-transaction-expand'); 537 - 538 - return javelin_tag( 539 - 'a', 540 - array( 541 - 'href' => '/maniphest/task/descriptionchange/'.$id.'/', 542 - 'sigil' => 'maniphest-expand-transaction', 543 - 'mustcapture' => true, 544 - ), 545 - 'show details'); 546 - } 547 - 548 - private function renderHandles($phids, $full = false) { 549 - $links = array(); 550 - foreach ($phids as $phid) { 551 - if ($this->forEmail) { 552 - if ($full) { 553 - $links[] = $this->handles[$phid]->getFullName(); 554 - } else { 555 - $links[] = $this->handles[$phid]->getName(); 556 - } 557 - } else { 558 - $links[] = $this->handles[$phid]->renderLink(); 559 - } 560 - } 561 - if ($this->forEmail) { 562 - return implode(', ', $links); 563 - } else { 564 - return phutil_implode_html(', ', $links); 565 - } 566 - } 567 - 568 - private function renderString($string) { 569 - if ($this->forEmail) { 570 - return '"'.$string.'"'; 571 - } else { 572 - return '"'.phutil_escape_html($string).'"'; 573 - } 574 - } 575 - 576 - 577 - /* -( Strings )------------------------------------------------------------ */ 578 - 579 - 580 - /** 581 - * @task strings 582 - */ 583 - private function getAttachName($attach_type, $count) { 584 - switch ($attach_type) { 585 - case DifferentialPHIDTypeRevision::TYPECONST: 586 - return pht('Differential Revision(s)', $count); 587 - case PhabricatorFilePHIDTypeFile::TYPECONST: 588 - return pht('file(s)', $count); 589 - case ManiphestPHIDTypeTask::TYPECONST: 590 - return pht('Maniphest Task(s)', $count); 591 - } 592 - } 593 - 594 - 595 - /** 596 - * @task strings 597 - */ 598 - private function getEdgeEmailTitle($type, array $list) { 599 - $count = count($list); 600 - switch ($type) { 601 - case PhabricatorEdgeConfig::TYPE_TASK_HAS_RELATED_DREV: 602 - return pht('DIFFERENTIAL %d REVISION(S)', $count); 603 - case PhabricatorEdgeConfig::TYPE_TASK_DEPENDS_ON_TASK: 604 - return pht('DEPENDS ON %d TASK(S)', $count); 605 - case PhabricatorEdgeConfig::TYPE_TASK_DEPENDED_ON_BY_TASK: 606 - return pht('DEPENDENT %d TASK(s)', $count); 607 - case PhabricatorEdgeConfig::TYPE_TASK_HAS_COMMIT: 608 - return pht('ATTACHED %d COMMIT(S)', $count); 609 - case PhabricatorEdgeConfig::TYPE_TASK_HAS_MOCK: 610 - return pht('ATTACHED %d MOCK(S)', $count); 611 - default: 612 - return pht('ATTACHED %d OBJECT(S)', $count); 613 - } 614 - } 615 - 616 - 617 - /** 618 - * @task strings 619 - */ 620 - private function getEdgeAddVerb($type) { 621 - switch ($type) { 622 - case PhabricatorEdgeConfig::TYPE_TASK_HAS_RELATED_DREV: 623 - return pht('Added Revision'); 624 - case PhabricatorEdgeConfig::TYPE_TASK_DEPENDS_ON_TASK: 625 - return pht('Added Dependency'); 626 - case PhabricatorEdgeConfig::TYPE_TASK_DEPENDED_ON_BY_TASK: 627 - return pht('Added Dependent Task'); 628 - case PhabricatorEdgeConfig::TYPE_TASK_HAS_COMMIT: 629 - return pht('Added Commit'); 630 - case PhabricatorEdgeConfig::TYPE_TASK_HAS_MOCK: 631 - return pht('Added Mock'); 632 - default: 633 - return pht('Added Object'); 634 - } 635 - } 636 - 637 - 638 - /** 639 - * @task strings 640 - */ 641 - private function getEdgeRemVerb($type) { 642 - switch ($type) { 643 - case PhabricatorEdgeConfig::TYPE_TASK_HAS_RELATED_DREV: 644 - return pht('Removed Revision'); 645 - case PhabricatorEdgeConfig::TYPE_TASK_DEPENDS_ON_TASK: 646 - return pht('Removed Dependency'); 647 - case PhabricatorEdgeConfig::TYPE_TASK_DEPENDED_ON_BY_TASK: 648 - return pht('Removed Dependent Task'); 649 - case PhabricatorEdgeConfig::TYPE_TASK_HAS_COMMIT: 650 - return pht('Removed Commit'); 651 - case PhabricatorEdgeConfig::TYPE_TASK_HAS_MOCK: 652 - return pht('Removed Mock'); 653 - default: 654 - return pht('Removed Object'); 655 - } 656 - } 657 - 658 - 659 - /** 660 - * @task strings 661 - */ 662 - private function getEdgeEditVerb($type) { 663 - switch ($type) { 664 - case PhabricatorEdgeConfig::TYPE_TASK_HAS_RELATED_DREV: 665 - return pht('Changed Revisions'); 666 - case PhabricatorEdgeConfig::TYPE_TASK_DEPENDS_ON_TASK: 667 - return pht('Changed Dependencies'); 668 - case PhabricatorEdgeConfig::TYPE_TASK_DEPENDED_ON_BY_TASK: 669 - return pht('Changed Dependent Tasks'); 670 - case PhabricatorEdgeConfig::TYPE_TASK_HAS_COMMIT: 671 - return pht('Changed Commits'); 672 - case PhabricatorEdgeConfig::TYPE_TASK_HAS_MOCK: 673 - return pht('Changed Mocks'); 674 - default: 675 - return pht('Changed Objects'); 676 - } 677 - } 678 - 679 - 680 - /** 681 - * @task strings 682 - */ 683 - private function getEdgeAddList($type, array $add) { 684 - $list = $this->renderHandles(array_keys($add), $full = true); 685 - $count = count($add); 686 - 687 - switch ($type) { 688 - case PhabricatorEdgeConfig::TYPE_TASK_HAS_RELATED_DREV: 689 - return pht('added %d revision(s): %s', $count, $list); 690 - case PhabricatorEdgeConfig::TYPE_TASK_DEPENDS_ON_TASK: 691 - return pht('added %d dependencie(s): %s', $count, $list); 692 - case PhabricatorEdgeConfig::TYPE_TASK_DEPENDED_ON_BY_TASK: 693 - return pht('added %d dependent task(s): %s', $count, $list); 694 - case PhabricatorEdgeConfig::TYPE_TASK_HAS_COMMIT: 695 - return pht('added %d commit(s): %s', $count, $list); 696 - case PhabricatorEdgeConfig::TYPE_TASK_HAS_MOCK: 697 - return pht('added %d mock(s): %s', $count, $list); 698 - default: 699 - return pht('added %d object(s): %s', $count, $list); 700 - } 701 - } 702 - 703 - 704 - /** 705 - * @task strings 706 - */ 707 - private function getEdgeRemList($type, array $rem) { 708 - $list = $this->renderHandles(array_keys($rem), $full = true); 709 - $count = count($rem); 710 - 711 - switch ($type) { 712 - case PhabricatorEdgeConfig::TYPE_TASK_HAS_RELATED_DREV: 713 - return pht('removed %d revision(s): %s', $count, $list); 714 - case PhabricatorEdgeConfig::TYPE_TASK_DEPENDS_ON_TASK: 715 - return pht('removed %d dependencie(s): %s', $count, $list); 716 - case PhabricatorEdgeConfig::TYPE_TASK_DEPENDED_ON_BY_TASK: 717 - return pht('removed %d dependent task(s): %s', $count, $list); 718 - case PhabricatorEdgeConfig::TYPE_TASK_HAS_COMMIT: 719 - return pht('removed %d commit(s): %s', $count, $list); 720 - case PhabricatorEdgeConfig::TYPE_TASK_HAS_MOCK: 721 - return pht('removed %d mock(s): %s', $count, $list); 722 - default: 723 - return pht('removed %d object(s): %s', $count, $list); 724 - } 725 - } 726 - 727 - 728 - /** 729 - * @task strings 730 - */ 731 - private function getEdgeEditList($type, array $add, array $rem) { 732 - $add_list = $this->renderHandles(array_keys($add), $full = true); 733 - $rem_list = $this->renderHandles(array_keys($rem), $full = true); 734 - $add_count = count($add_list); 735 - $rem_count = count($rem_list); 736 - 737 - switch ($type) { 738 - case PhabricatorEdgeConfig::TYPE_TASK_HAS_RELATED_DREV: 739 - return pht( 740 - 'changed %d revision(s), added %d: %s; removed %d: %s', 741 - $add_count + $rem_count, 742 - $add_count, 743 - $add_list, 744 - $rem_count, 745 - $rem_list); 746 - case PhabricatorEdgeConfig::TYPE_TASK_DEPENDS_ON_TASK: 747 - return pht( 748 - 'changed %d dependencie(s), added %d: %s; removed %d: %s', 749 - $add_count + $rem_count, 750 - $add_count, 751 - $add_list, 752 - $rem_count, 753 - $rem_list); 754 - case PhabricatorEdgeConfig::TYPE_TASK_DEPENDED_ON_BY_TASK: 755 - return pht( 756 - 'changed %d dependent task(s), added %d: %s; removed %d: %s', 757 - $add_count + $rem_count, 758 - $add_count, 759 - $add_list, 760 - $rem_count, 761 - $rem_list); 762 - case PhabricatorEdgeConfig::TYPE_TASK_HAS_COMMIT: 763 - return pht( 764 - 'changed %d commit(s), added %d: %s; removed %d: %s', 765 - $add_count + $rem_count, 766 - $add_count, 767 - $add_list, 768 - $rem_count, 769 - $rem_list); 770 - case PhabricatorEdgeConfig::TYPE_TASK_HAS_MOCK: 771 - return pht( 772 - 'changed %d mock(s), added %d: %s; removed %d: %s', 773 - $add_count + $rem_count, 774 - $add_count, 775 - $add_list, 776 - $rem_count, 777 - $rem_list); 778 - default: 779 - return pht( 780 - 'changed %d object(s), added %d: %s; removed %d: %s', 781 - $add_count + $rem_count, 782 - $add_count, 783 - $add_list, 784 - $rem_count, 785 - $rem_list); 786 - } 787 - } 788 - 789 - }
-71
webroot/rsrc/css/application/maniphest/transaction-detail.css
··· 1 - /** 2 - * @provides maniphest-transaction-detail-css 3 - */ 4 - 5 - .maniphest-transaction-list-view { 6 - padding: 0 20px; 7 - } 8 - 9 - .device-phone .maniphest-transaction-list-view { 10 - padding: 0 10px; 11 - } 12 - 13 - .maniphest-transaction-list-view .anchor-target { 14 - background-color: #ffffdd; 15 - border-color: #ffff00; 16 - } 17 - 18 - .phabricator-transaction-view .upforgrab { 19 - border-color: #cc9966; 20 - } 21 - 22 - .phabricator-transaction-view .reassigned { 23 - border-color: #0099aa; 24 - } 25 - 26 - .phabricator-transaction-view .assigned { 27 - border-color: #0099aa; 28 - } 29 - 30 - .phabricator-transaction-view .claimed { 31 - border-color: #0099aa; 32 - } 33 - 34 - .phabricator-transaction-view .created { 35 - border-color: #660099; 36 - } 37 - 38 - .phabricator-transaction-view .closed { 39 - border-color: #006699; 40 - } 41 - 42 - .phabricator-transaction-view .spited { 43 - border-color: #006699; 44 - } 45 - 46 - .phabricator-transaction-view .reopened { 47 - border-color: #660099; 48 - } 49 - 50 - .phabricator-transaction-view .duplicate { 51 - border-color: #333333; 52 - } 53 - 54 - .maniphest-change-table { 55 - width: 100%; 56 - margin: .5em 0em; 57 - border-collapse: separate; 58 - border-spacing: 4px 0px; 59 - } 60 - 61 - .maniphest-change-table td { 62 - width: 50%; 63 - padding: 0.25em 1em; 64 - background: #f9f9f9; 65 - } 66 - 67 - .maniphest-change-table th { 68 - font-weight: bold; 69 - padding: 0.25em; 70 - border-bottom: 1px solid #cccccc; 71 - }