function si_redirect_if_expired() { if (current_user_can('edit_sprout_invoices')) { return; } $expiration = 'invoice' === si_get_doc_context() ? si_get_invoice_due_date() : si_get_estimate_expiration_date(); if (!$expiration) { return; } if ($expiration < current_time('timestamp')) { $redirect_url = home_url(); wp_redirect($redirect_url); exit; } }
<b><?php self::_e('Expired & Pending'); ?> </b> <ul> <?php foreach ($estimates->posts as $estimate_id) { ?> <li><a href="<?php echo get_edit_post_link($estimate_id); ?> "><?php echo get_the_title($estimate_id); ?> </a> — <?php printf(self::__('Expired: %s'), date_i18n(get_option('date_format'), si_get_estimate_expiration_date($estimate_id))); ?> </li> <?php } ?> </ul> <?php } else { ?> <p> <b><?php self::_e('Expired & Pending'); ?> </b><br/> <?php
<dl class="estimate_po_number"> <dt><span class="dt_heading"><?php si_e('PO Number'); ?> </span></dt> <dd><?php si_estimate_po_number(); ?> </dd> </dl> <?php } ?> <?php if (si_get_estimate_expiration_date()) { ?> <dl class="date"> <dt><span class="dt_heading"><?php si_e('Expiration Date'); ?> </span></dt> <dd><?php si_estimate_expiration_date(); ?> </dd> </dl> <?php } ?>
<b><?php _e('Expired & Pending', 'sprout-invoices'); ?> </b> <ul> <?php foreach ($estimates->posts as $estimate_id) { ?> <li><a href="<?php echo get_edit_post_link($estimate_id); ?> "><?php echo get_the_title($estimate_id); ?> </a> — <?php printf(__('Expired: %s', 'sprout-invoices'), date(get_option('date_format'), si_get_estimate_expiration_date($estimate_id))); ?> </li> <?php } ?> </ul> <?php } else { ?> <p> <b><?php _e('Expired & Pending', 'sprout-invoices'); ?> </b><br/> <?php
<a href="<?php echo esc_url(add_query_arg(array('dashboard' => 'pay'), get_permalink($estimate_id))); ?> " class="est_action_link"><span class="button label"><?php _e('Accept/Decline', 'sprout-invoices'); ?> </span></a> <br/> <?php if (si_get_estimate_expiration_date($estimate_id)) { ?> <small><time datetime="<?php si_estimate_expiration_date($estimate_id); ?> "><?php printf(__('<b>Expiration:</b> %s', 'sprout-invoices'), date_i18n(apply_filters('si_client_dash_date_format', 'M. jS'), si_get_estimate_expiration_date($estimate_id))); ?> </time></small> <?php } ?> </td> <?php } else { ?> <!-- Estimate is in review --> <td> <small><?php _e('<b>Pending</b> Review', 'sprout-invoices'); ?> </small>
/** * Echo the estimate expiration_date * @param integer $id * @return string */ function si_estimate_expiration_date($id = 0) { if (!$id) { $id = get_the_ID(); } echo apply_filters('si_estimate_expiration_date', date_i18n(get_option('date_format'), si_get_estimate_expiration_date($id)), $id); }
/** * Echo the estimate expiration_date * @param integer $id * @return string */ function si_estimate_expiration_date($id = 0) { if (!$id) { global $post; $id = $post->ID; } echo apply_filters('si_estimate_expiration_date', date_i18n(get_option('date_format'), si_get_estimate_expiration_date($id)), $id); }
public static function due_date($atts = array()) { $time = time() * 60 * 60 * 24 * 7; if (si_get_doc_context() == 'estimate') { $time = si_get_estimate_expiration_date(); } else { $time = si_get_invoice_due_date(); } return date_i18n('Y', $time); }