Changeset 3610
- Timestamp:
- 07/01/2016 09:12:17 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/trac-notifications/trac-components.php
r3604 r3610 339 339 function generate_component_breakdowns() { 340 340 if ( isset( $this->breakdown_component_type, $this->breakdown_component_milestone_type, $this->breakdown_component_unreplied ) ) { 341 return ;341 return true; 342 342 } 343 343 … … 346 346 if ( ! $rows ) { 347 347 $rows = $this->api->get_tickets_by_component_type_milestone(); 348 if ( ! $rows ) { 349 return false; // API error. 350 } 348 351 wp_cache_add( 'trac_tickets_by_component_type_milestone', $rows, '', 300 ); 349 352 } 350 353 351 354 foreach ( $rows as $row ) { 355 $row = (object) $row; 352 356 if ( empty( $component_type[ $row->component ] ) ) { 353 357 $component_type[ $row->component ] = $type_filled; … … 370 374 $this->breakdown_component_milestone_type = $component_milestone_type; 371 375 $this->breakdown_component_unreplied = $component_unreplied; 372 } 373 374 function ticket_table( $component ) { 375 $this->generate_component_breakdowns(); 376 377 return true; 378 } 379 380 function ticket_table( $component ) { 381 $result = $this->generate_component_breakdowns(); 382 if ( ! $result ) { 383 return; 384 } 385 376 386 $component_type = $this->breakdown_component_type; 377 387 $component_milestone_type = $this->breakdown_component_milestone_type; … … 457 467 if ( $next_milestone ) { 458 468 $count = count( $next_milestone ); 459 echo '<h3>' . sprintf( _n( '%s ticket slated for ' . $next_milestone[0]->milestone, '%s tickets slated for ' . $next_milestone[0]->milestone, $count ), $count ) . '</h3>'; 460 echo $this->trac_query_link( 'View list in Trac', array( 'component' => $component, 'milestone' => $next_milestone[0]->milestone ) ); 469 $next_milestone_object = (object) $next_milestone[0]; 470 echo '<h3>' . sprintf( _n( '%s ticket slated for ' . $next_milestone_object->milestone, '%s tickets slated for ' . $next_milestone_object->milestone, $count ), $count ) . '</h3>'; 471 echo $this->trac_query_link( 'View list in Trac', array( 'component' => $component, 'milestone' => $next_milestone_object->milestone ) ); 461 472 $this->render_tickets( $next_milestone ); 462 473 } … … 555 566 556 567 function component_table_row( $post ) { 568 $result = $this->generate_component_breakdowns(); 569 if ( ! $result ) { 570 return; 571 } 572 557 573 static $once = true; 558 574 if ( $once ) { … … 562 578 563 579 $component = $post->post_title; 564 $this->generate_component_breakdowns();565 580 $history = $this->api->get_component_history( $component ); 566 581
Note: See TracChangeset
for help on using the changeset viewer.