Submission_Manager::render_status_select( int|null $id, awsmug\Torro_Forms\DB_Objects\Submissions\Submission $submission )

Renders a status select field.

Description

Parameters

$id

(int|null) (Required) Current submission ID, or null if new submission.

$submission

(awsmug\Torro_Forms\DB_Objects\Submissions\Submission) (Required) Current submission object.

Source

File: src/db-objects/submissions/submission-manager.php

	public function render_status_select( $id, $submission ) {
		$current_status = $submission->status;

		$timestamp = ! empty( $submission->timestamp ) ? $submission->timestamp : current_time( 'timestamp', 'mysql' );

		?>
		<div class="misc-pub-section">
			<div id="date-information">
				<?php _e( 'Date:', 'torro-forms' ); ?>
				<?php echo date_i18n( get_option( 'date_format' ), $timestamp ); ?>
			</div>
		</div>
		<div class="misc-pub-section">
			<div id="post-status-select">
				<label for="post-status"><?php echo $this->get_message( 'edit_page_status_label' ); ?></label>
				<select id="post-status" name="status">
					<option value="completed"<?php selected( $current_status, 'completed' ); ?>><?php _ex( 'Completed', 'submission status label', 'torro-forms' ); ?></option>
					<option value="progressing"<?php selected( $current_status, 'progressing' ); ?>><?php _ex( 'In Progress', 'submission status label', 'torro-forms' ); ?></option>
				</select>
			</div>
		</div>
		<?php
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.