Code Duplication    Length = 8-9 lines in 2 locations

admin_pages/events/Events_Admin_Page.core.php 2 locations

@@ 611-618 (lines=8) @@
608
		$orig_status = $event->status();
609
		//made it here so it IS active... next check that any of the tickets are sold.
610
		if ( $event->is_sold_out( true ) ) {
611
			if ( $event->status() !== $orig_status && $orig_status !== EEM_Event::sold_out  ) {
612
				EE_Error::add_attention(
613
					sprintf(
614
						__( 'Please note that the Event Status has automatically been changed to %s because there are no more spaces available for this event.  However, this change is not permanent until you update the event.  You can change the status back to something else before updating if you wish.', 'event_espresso' ),
615
						EEH_Template::pretty_status( EEM_Event::sold_out, FALSE, 'sentence' )
616
					)
617
				);
618
			}
619
			return;
620
		} else if ( $orig_status === EEM_Event::sold_out ) {
621
			EE_Error::add_attention(
@@ 620-628 (lines=9) @@
617
				);
618
			}
619
			return;
620
		} else if ( $orig_status === EEM_Event::sold_out ) {
621
			EE_Error::add_attention(
622
				sprintf(
623
					__( 'Please note that the Event Status has automatically been changed to %s because more spaces have become available for this event, most likely due to abandoned transactions freeing up reserved tickets.  However, this change is not permanent until you update the event. If you wish, you can change the status back to something else before updating.',
624
						'event_espresso' ),
625
					EEH_Template::pretty_status( $event->status(), false, 'sentence' )
626
				)
627
			);
628
		}
629
		//now we need to determine if the event has any tickets on sale.  If not then we dont' show the error
630
		if ( ! $event->tickets_on_sale() ) {
631
			return;