false, 'parent' => 0 ) ), array( 'taxonomy' => 'management_key_date_type' ) ) ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. $recurrence_rules = get_option( 'propertyhive_key_date_type', array() ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. $recurrence_rules = is_array( $recurrence_rules ) ? $recurrence_rules : array(); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. $parent_post_type = get_post_type( $post_id ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. $meta_query = array(); switch ( $parent_post_type ) { case 'property' : { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. $meta_query = array( array( 'key' => '_property_id', 'value' => $post_id, ), array( 'key' => '_tenancy_id', 'compare' => 'NOT EXISTS', ), ); break; } case 'tenancy' : { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. $parent_property_id = get_post_meta( $post_id, '_property_id', true ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. $meta_query = array( array( 'relation' => 'OR', array( 'key' => '_tenancy_id', 'value' => $post_id, ), array( 'key' => '_property_id', 'value' => $parent_property_id, ), ), ); break; } } if ( isset($selected_status) && !empty($selected_status) ) { switch ( $selected_status ) { case 'upcoming_and_overdue': { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. $meta_query[] = array( 'key' => '_key_date_status', 'value' => array('pending', 'booked'), 'compare' => 'IN' ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. $upcoming_threshold = new DateTime('+ ' . apply_filters( 'propertyhive_key_date_upcoming_days', 7 ) . ' DAYS'); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. $meta_query[] = array( 'key' => '_date_due', 'value' => $upcoming_threshold->format('Y-m-d'), 'type' => 'date', 'compare' => '<=', ); break; } case 'overdue': { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. $meta_query[] = array( 'key' => '_key_date_status', 'value' => array('pending', 'booked'), 'compare' => 'IN' ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. $meta_query[] = array( 'key' => '_date_due', 'value' => gmdate('Y-m-d'), 'type' => 'date', 'compare' => '<', ); break; } default: { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. $meta_query[] = array( 'key' => '_key_date_status', 'value' => $selected_status, ); break; } } } if ( isset($selected_type_id) && !empty($selected_type_id) ) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. $meta_query[] = array( 'key' => '_key_date_type_id', 'value' => $selected_type_id, ); } // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope. $key_dates = get_posts(array ( 'post_type' => 'key_date', 'nopaging' => true, // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query -- The complete management-date grid selects records by existing property/tenancy relationships and date/status metadata. 'meta_query' => $meta_query, 'orderby' => 'meta_value', // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_key -- Management dates are ordered by their stored due date to preserve the grid's chronological behavior. 'meta_key' => '_date_due', 'order' => 'DESC', )); ?>
| Description | Notes | Tenants | Date Due | Status |
|---|---|---|---|---|
|
description() ); ?>
|
notes()) ? nl2br( esc_html($key_date->notes()) ) : '-'; ?>
|
tenancy_id) )
{
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope.
$tenancy = $key_date->tenancy();
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope.
$tenants = $tenancy->get_tenants(false, true);
}
echo !empty($tenants) ? wp_kses_post( $tenants ) : '-';
?>
|
date_due()->format( 'H:i' ) == '00:00' )
{
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope.
$date_format = 'jS F Y';
}
else
{
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable in an admin view; PHPCS analyzes the view file standalone even though WordPress includes it inside a method/function scope.
$date_format = 'H:i jS F Y';
}
?>
date_due()->format( $date_format )); ?>
|
status() ) )); ?>
|
| No key dates found | ||||
| Description | Notes | Tenants | Date Due | Status |