WordPress.org

Plugin Directory

Changeset 1789165


Ignore:
Timestamp:
12/18/17 22:43:36 (5 weeks ago)
Author:
dancameron
Message:

Deploy version 16.6

Location:
sprout-invoices
Files:
688 added
24 edited

Legend:

Unmodified
Added
Removed
  • sprout-invoices/trunk/Sprout_Invoices.class.php

    r1782156 r1789165  
    3333     * Current version. Should match sprout-invoices.php plugin version. 
    3434     */ 
    35     const SI_VERSION = '16.5.7'; 
     35    const SI_VERSION = '16.6'; 
    3636    /** 
    3737     * DB Version 
  • sprout-invoices/trunk/bundles/Addons.php

    r1782156 r1789165  
    1212 
    1313    public static function init() { 
    14         self::$active_addons = get_option( self::ADDON_OPTION, self::default_active_addons() ); 
    15         if ( ! is_array( self::$active_addons ) ) { 
     14        self::$active_addons = get_option( self::ADDON_OPTION, false ); 
     15        if ( ! self::$active_addons || empty( self::$active_addons ) ) { 
    1616            self::$active_addons = self::default_active_addons(); 
     17            update_option( self::ADDON_OPTION, self::$active_addons ); 
    1718        } 
    1819        self::register_addons_admin(); 
  • sprout-invoices/trunk/changelog.txt

    r1782156 r1789165  
     1= 16.6 = 
     2 
     3* Update: Reverting GMT offset changes from last release. Needs more testing. 
     4* Update: Offsite payment processor update 
     5* New: Filtering for checkboxes 
     6* Update: Line items totals display updated for the admin. 
     7* New: Save a default list of add-ons to be active on setup. 
     8* Update/Fix: WooCommerce exclusive/inclusive tax updates 
     9* Update: WooCommerce compatibility update 
     10 
    111= 16.5.7 = 
    212 
    3 * Udpate: Point of Contact add-on will no longer force itself if unused. 
    4 * Udpate: Use GMT offset everywhere 
     13* Update: Point of Contact add-on will no longer force itself if unused. 
     14* Update: Use GMT offset everywhere 
    515* Fix: Signature add-on errors for default theme 
    616 
  • sprout-invoices/trunk/controllers/estimates/Estimates_Edit.php

    r1782156 r1789165  
    352352        $estimate = SI_Estimate::get_instance( $post->ID ); 
    353353        $status = ( is_a( $estimate, 'SI_Estimate' ) && $estimate->get_status() != 'auto-draft' ) ? $estimate->get_status() : SI_Estimate::STATUS_TEMP ; 
    354         $expiration_date = ( is_a( $estimate, 'SI_Estimate' ) ) ? $estimate->get_expiration_date() : current_time( 'timestamp', true ) + (DAY_IN_SECONDS * 30); 
     354        $expiration_date = ( is_a( $estimate, 'SI_Estimate' ) ) ? $estimate->get_expiration_date() : current_time( 'timestamp' ) + (DAY_IN_SECONDS * 30); 
    355355        $issue_date = ( is_a( $estimate, 'SI_Estimate' ) ) ? $estimate->get_issue_date() : strtotime( $post->post_date ); 
    356356        $invoice_id = ( is_a( $estimate, 'SI_Estimate' ) ) ? $estimate->get_invoice_id() : 0 ; 
  • sprout-invoices/trunk/controllers/invoices/Invoices_Edit.php

    r1782156 r1789165  
    359359        $invoice = SI_Invoice::get_instance( $post->ID ); 
    360360        $status = ( is_a( $invoice, 'SI_Invoice' ) && $invoice->get_status() !== 'auto-draft' ) ? $invoice->get_status() : SI_Invoice::STATUS_TEMP ; 
    361         $due_date = ( is_a( $invoice, 'SI_Invoice' ) ) ? $invoice->get_due_date() : current_time( 'timestamp', true ) + (DAY_IN_SECONDS * 30); 
    362         $expiration_date = ( is_a( $invoice, 'SI_Invoice' ) ) ? $invoice->get_expiration_date() : current_time( 'timestamp', true ) + (DAY_IN_SECONDS * 30); 
     361        $due_date = ( is_a( $invoice, 'SI_Invoice' ) ) ? $invoice->get_due_date() : current_time( 'timestamp' ) + (DAY_IN_SECONDS * 30); 
     362        $expiration_date = ( is_a( $invoice, 'SI_Invoice' ) ) ? $invoice->get_expiration_date() : current_time( 'timestamp' ) + (DAY_IN_SECONDS * 30); 
    363363        $issue_date = ( is_a( $invoice, 'SI_Invoice' ) ) ? $invoice->get_issue_date() : strtotime( $post->post_date ); 
    364364        $estimate_id = ( is_a( $invoice, 'SI_Invoice' ) ) ? $invoice->get_estimate_id() : 0 ; 
  • sprout-invoices/trunk/controllers/notifications/Notifications.php

    r1782156 r1789165  
    552552    public static function shortcode_date( $atts, $content, $code, $data ) { 
    553553        $atts = shortcode_atts( array( 'format' => get_option( 'date_format' ) ), $atts ); 
    554         $date = date_i18n( $atts['format'], current_time( 'timestamp', true ) ); 
     554        $date = date_i18n( $atts['format'], current_time( 'timestamp' ) ); 
    555555        return apply_filters( 'shortcode_date', $date, $data ); 
    556556    } 
     
    966966        if ( isset( $data['invoice'] ) && is_a( $data['invoice'], 'SI_Invoice' ) ) { 
    967967            $due_date = $data['invoice']->get_due_date(); 
    968             $pastdue = current_time( 'timestamp', true ) -$due_date; 
     968            $pastdue = current_time( 'timestamp' ) -$due_date; 
    969969            $days = floor( $pastdue / (DAY_IN_SECONDS) ); 
    970970        } 
  • sprout-invoices/trunk/controllers/records/Internal_Records.php

    r1782156 r1789165  
    6565 
    6666        $status = ( isset( $data['status'] ) && '' !== $data['status'] ) ? $data['status'] : 'publish' ; 
    67         $post_date = ( isset( $data['post_date'] ) && $data['post_date'] ) ? (int) $data['post_date'] : current_time( 'timestamp', true ); 
     67        $post_date = ( isset( $data['post_date'] ) && $data['post_date'] ) ? (int) $data['post_date'] : current_time( 'timestamp' ); 
    6868 
    6969        $post = array( 
  • sprout-invoices/trunk/controllers/reporting/Reporting.php

    r1782156 r1789165  
    558558                    ), 
    559559                ); 
    560                 $expire = strtotime( 'tomorrow' ) -current_time( 'timestamp', true ); 
     560                $expire = strtotime( 'tomorrow' ) -current_time( 'timestamp' ); 
    561561                break; 
    562562            case 'lastweek': 
     
    568568                    ), 
    569569                ); 
    570                 $expire = strtotime( 'next week' ) -current_time( 'timestamp', true ); 
     570                $expire = strtotime( 'next week' ) -current_time( 'timestamp' ); 
    571571                break; 
    572572            case 'month': 
     
    574574                    array( 
    575575                        'month' => date( 'm', strtotime( 'first day of this month' ) ), 
    576                         'year' => date( 'o', current_time( 'timestamp', true ) ), 
     576                        'year' => date( 'o', current_time( 'timestamp' ) ), 
    577577                        'inclusive' => true, 
    578578                    ), 
    579579                ); 
    580                 $expire = strtotime( 'tomorrow' ) -current_time( 'timestamp', true ); 
     580                $expire = strtotime( 'tomorrow' ) -current_time( 'timestamp' ); 
    581581                break; 
    582582            case 'lastmonth': 
     
    588588                    ), 
    589589                ); 
    590                 $expire = strtotime( 'first day of next month' ) -current_time( 'timestamp', true ); 
     590                $expire = strtotime( 'first day of next month' ) -current_time( 'timestamp' ); 
    591591                break; 
    592592            case 'year': 
    593593                $args['date_query'] = array( 
    594594                    array( 
    595                         'year' => date( 'Y', current_time( 'timestamp', true ) ), 
     595                        'year' => date( 'Y', current_time( 'timestamp' ) ), 
    596596                        'inclusive' => true, 
    597597                    ), 
    598598                ); 
    599                 $expire = strtotime( 'tomorrow' ) -current_time( 'timestamp', true ); 
     599                $expire = strtotime( 'tomorrow' ) -current_time( 'timestamp' ); 
    600600                break; 
    601601            case 'lastyear': 
     
    606606                    ), 
    607607                ); 
    608                 $expire = strtotime( 'last day of year' ) -current_time( 'timestamp', true ); 
     608                $expire = strtotime( 'last day of year' ) -current_time( 'timestamp' ); 
    609609                break; 
    610610            default: 
  • sprout-invoices/trunk/models/Client.php

    r1782156 r1789165  
    8989    public static function new_client( $passed_args ) { 
    9090        $defaults = array( 
    91             'company_name' => sprintf( __( 'New Client: %s', 'sprout-invoices' ), date_i18n( get_option( 'date_format' ).' @ '.get_option( 'time_format' ), current_time( 'timestamp', true ) ) ), 
     91            'company_name' => sprintf( __( 'New Client: %s', 'sprout-invoices' ), date_i18n( get_option( 'date_format' ).' @ '.get_option( 'time_format' ), current_time( 'timestamp' ) ) ), 
    9292            'website' => '', 
    9393            'phone' => '', 
  • sprout-invoices/trunk/models/Estimate.php

    r1782156 r1789165  
    169169    public static function create_estimate( $passed_args, $status = '' ) { 
    170170        $defaults = array( 
    171             'subject' => sprintf( __( 'New Estimate: %s', 'sprout-invoices' ), date_i18n( get_option( 'date_format' ).' @ '.get_option( 'time_format' ), current_time( 'timestamp', true ) ) ), 
     171            'subject' => sprintf( __( 'New Estimate: %s', 'sprout-invoices' ), date_i18n( get_option( 'date_format' ).' @ '.get_option( 'time_format' ), current_time( 'timestamp' ) ) ), 
    172172            'user_id' => '', 
    173173            'estimate_id' => '', 
  • sprout-invoices/trunk/models/Invoice.php

    r1782156 r1789165  
    1515    const STATUS_TEMP = 'temp'; // invoice is in a draft state, can't use 'draft' otherwise a url will not be created 
    1616    const STATUS_PENDING = 'publish'; // invoice pending payment 
    17     const STATUS_FUTURE = 'future'; // invoice pending payment 
     17    const STATUS_FUTURE = 'future'; // invoice pending publish 
    1818    const STATUS_PARTIAL = 'partial'; // invoice is partially paid for 
    1919    const STATUS_PAID = 'complete'; // invoice is complete 
     
    160160    public static function create_invoice( $passed_args, $status = '' ) { 
    161161        $defaults = array( 
    162             'subject' => sprintf( __( 'New Invoice: %s', 'sprout-invoices' ), date_i18n( get_option( 'date_format' ).' @ '.get_option( 'time_format' ), current_time( 'timestamp', true ) ) ), 
     162            'subject' => sprintf( __( 'New Invoice: %s', 'sprout-invoices' ), date_i18n( get_option( 'date_format' ).' @ '.get_option( 'time_format' ), current_time( 'timestamp' ) ) ), 
    163163            'user_id' => '', 
    164164            'invoice_id' => '', 
     
    914914    public static function get_overdue_invoices( $after = 0, $before = 0 ) { 
    915915        if ( ! $after ) { 
    916             $after = apply_filters( 'si_get_overdue_yesterday_timestamp', strtotime( 'Yesterday',  current_time( 'timestamp', true ) ) ); 
     916            $after = apply_filters( 'si_get_overdue_yesterday_timestamp', strtotime( 'Yesterday',  current_time( 'timestamp' ) ) ); 
    917917        } 
    918918 
  • sprout-invoices/trunk/models/Project.php

    r1782156 r1789165  
    8080    public static function new_project( $args ) { 
    8181        $defaults = array( 
    82             'project_name' => sprintf( __( 'New Project: %s', 'sprout-invoices' ), date_i18n( get_option( 'date_format' ).' @ '.get_option( 'time_format' ), current_time( 'timestamp', true ) ) ), 
     82            'project_name' => sprintf( __( 'New Project: %s', 'sprout-invoices' ), date_i18n( get_option( 'date_format' ).' @ '.get_option( 'time_format' ), current_time( 'timestamp' ) ) ), 
    8383            'associated_clients' => array(), 
    8484            'project_description' => '', 
  • sprout-invoices/trunk/readme.txt

    r1782156 r1789165  
    55Requires at least: 3.8 
    66Tested up to: 4.9 
    7 Stable tag: 16.5.7 
     7Stable tag: 16.6 
    88License: GPLv2 or later 
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html 
     
    126126== Changelog == 
    127127 
     128= 16.6 = 
     129 
     130* Update: Reverting GMT offset changes from last release. Needs more testing. 
     131* Update: Offsite payment processor update 
     132* New: Filtering for checkboxes 
     133* Update: Line items totals display updated for the admin. 
     134* New: Save a default list of add-ons to be active on setup. 
     135* Update/Fix: WooCommerce exclusive/inclusive tax updates 
     136* Update: WooCommerce compatibility update 
     137 
    128138= 16.5.7 = 
    129139 
    130 * Udpate: Point of Contact add-on will no longer force itself if unused. 
    131 * Udpate: Use GMT offset everywhere 
     140* Update: Point of Contact add-on will no longer force itself if unused. 
     141* Update: Use GMT offset everywhere 
    132142* Fix: Signature add-on errors for default theme 
    133143 
  • sprout-invoices/trunk/resources/admin/css/sprout-invoice.css

    r1782156 r1789165  
    11191119 
    11201120#line_items_totals { 
    1121     text-align: right 
     1121    text-align: right; 
     1122} 
     1123#line_items_totals > div { 
     1124    margin-top: 10px; 
    11221125} 
    11231126 
     
    11261129    float: left; 
    11271130    text-align: right; 
    1128     width: 10em 
     1131    width: 15em; 
     1132    white-space: nowrap; 
     1133} 
     1134#line_items_totals b.helptip:after { 
     1135    margin-right: -5px; 
    11291136} 
    11301137 
  • sprout-invoices/trunk/sprout-invoices.php

    r1782156 r1789165  
    33/** 
    44 * @package Sprout_Invoices 
    5  * @version 16.5.7 
     5 * @version 16.6 
    66 */ 
    77 
     
    1111 * Description: App allows for any WordPress site to accept estimates, create invoices and receive invoice payments. Learn more at <a href="https://sproutapps.co">Sprout Apps</a>. 
    1212 * Author: Sprout Apps 
    13  * Version: 16.5.7 
     13 * Version: 16.6 
    1414 * Author URI: https://sproutapps.co 
    1515 * Text Domain: sprout-invoices 
  • sprout-invoices/trunk/template-tags/invoices.php

    r1782156 r1789165  
    7070            case SI_Invoice::STATUS_PENDING: 
    7171                $status = __( 'pending', 'sprout-invoices' ); 
    72                 if ( si_get_invoice_due_date( $id ) < current_time( 'timestamp', true ) ) { 
     72                if ( si_get_invoice_due_date( $id ) < current_time( 'timestamp' ) ) { 
    7373                    $status = __( 'past-due', 'sprout-invoices' ); 
    7474                } 
  • sprout-invoices/trunk/template-tags/utility.php

    r1782156 r1789165  
    270270     */ 
    271271    function si_get_days_ago( $last_updated = 0 ) { 
    272         $time_between_update = current_time( 'timestamp', true ) - $last_updated; 
     272        $time_between_update = current_time( 'timestamp' ) - $last_updated; 
    273273        $days_since = round( (($time_between_update / 24) / 60) / 60 ); 
    274274        return apply_filters( 'si_get_days_ago', $days_since ); 
  • sprout-invoices/trunk/views/admin/dashboards/estimates.php

    r1782156 r1789165  
    8383                        array( 
    8484                            'meta_key' => '_expiration_date', 
    85                             'value' => array( 0, current_time( 'timestamp', true ) ), 
     85                            'value' => array( 0, current_time( 'timestamp' ) ), 
    8686                            'compare' => 'BETWEEN', 
    8787                            ), 
     
    9595                <?php foreach ( $estimates->posts as $estimate_id ) : ?> 
    9696                    <li><a href="<?php echo get_edit_post_link( $estimate_id ) ?>"><?php 
    97                         $expired_or_pending = ( si_get_estimate_expiration_date( $estimate_id ) > current_time( 'timestamp', true ) ) ? __( 'Expired', 'sprout-invoices' ) : __( 'Pending', 'sprout-invoices' ); 
     97                        $expired_or_pending = ( si_get_estimate_expiration_date( $estimate_id ) > current_time( 'timestamp' ) ) ? __( 'Expired', 'sprout-invoices' ) : __( 'Pending', 'sprout-invoices' ); 
    9898                        echo get_the_title( $estimate_id ) ?></a> &mdash; <?php printf( __( '%s: %s', $expired_or_pending, date_i18n( get_option( 'date_format' ), si_get_estimate_expiration_date( $estimate_id ) ) ) ) ?></li> 
    9999                <?php endforeach ?> 
  • sprout-invoices/trunk/views/admin/dashboards/invoices.php

    r1782156 r1789165  
    5353 
    5454        <?php 
    55             $invoices = SI_Invoice::get_overdue_invoices( apply_filters( 'si_dashboard_get_overdue_invoices_from', current_time( 'timestamp', true ) - ( DAY_IN_SECONDS * 14 ) ), apply_filters( 'si_dashboard_get_overdue_invoices_to', current_time( 'timestamp', true ) ) ); ?> 
     55            $invoices = SI_Invoice::get_overdue_invoices( apply_filters( 'si_dashboard_get_overdue_invoices_from', current_time( 'timestamp' ) - ( DAY_IN_SECONDS * 14 ) ), apply_filters( 'si_dashboard_get_overdue_invoices_to', current_time( 'timestamp' ) ) ); ?> 
    5656 
    5757        <?php if ( ! empty( $invoices ) ) : ?> 
  • sprout-invoices/trunk/views/admin/dashboards/premium/estimates.php

    r1782156 r1789165  
    8181                        array( 
    8282                            'meta_key' => '_expiration_date', 
    83                             'value' => array( 0, current_time( 'timestamp', true ) ), 
     83                            'value' => array( 0, current_time( 'timestamp' ) ), 
    8484                            'compare' => 'BETWEEN', 
    8585                            ), 
     
    9393                <?php foreach ( $estimates->posts as $estimate_id ) :  ?> 
    9494                    <li><a href="<?php echo get_edit_post_link( $estimate_id ) ?>"><?php 
    95                         $expired_or_pending = ( si_get_estimate_expiration_date( $estimate_id ) > current_time( 'timestamp', true ) ) ? __( 'Expired', 'sprout-invoices' ) : __( 'Pending', 'sprout-invoices' ); 
     95                        $expired_or_pending = ( si_get_estimate_expiration_date( $estimate_id ) > current_time( 'timestamp' ) ) ? __( 'Expired', 'sprout-invoices' ) : __( 'Pending', 'sprout-invoices' ); 
    9696                        echo get_the_title( $estimate_id ) ?></a> &mdash; <?php printf( '<b>%s<b/>: %s', $expired_or_pending, date_i18n( get_option( 'date_format' ), si_get_estimate_expiration_date( $estimate_id ) ) ) ?></li> 
    9797                <?php endforeach ?> 
  • sprout-invoices/trunk/views/admin/dashboards/premium/invoices.php

    r1782156 r1789165  
    6060 
    6161        <?php 
    62             $invoices = SI_Invoice::get_overdue_invoices( apply_filters( 'si_dashboard_get_overdue_invoices_from', current_time( 'timestamp', true ) - ( DAY_IN_SECONDS * 14 ) ), apply_filters( 'si_dashboard_get_overdue_invoices_to', current_time( 'timestamp', true ) ) ); ?> 
     62            $invoices = SI_Invoice::get_overdue_invoices( apply_filters( 'si_dashboard_get_overdue_invoices_from', current_time( 'timestamp' ) - ( DAY_IN_SECONDS * 14 ) ), apply_filters( 'si_dashboard_get_overdue_invoices_to', current_time( 'timestamp' ) ) ); ?> 
    6363 
    6464        <?php if ( ! empty( $invoices ) ) : ?> 
  • sprout-invoices/trunk/views/admin/sections/line-item-options.php

    r1266169 r1789165  
    6060                        break; 
    6161                    case 'checkbox': 
     62 
     63                        $checked = checked( $value, $val, false ); 
     64                        if ( isset( $column['check_by_default'] ) && ! isset( $item_data[ $column_slug ] ) ) { 
     65                            $checked = ( $column['check_by_default'] ) ? checked( true, true, false ) : checked( false, true, false ); 
     66                        } 
    6267                        $option .= sprintf( '<input class="sa_option_checkbox" type="hidden" name="line_item_%2$s[]" value="%1$s">', $value, $column_slug ); 
    63                         $option .= sprintf( '<input class="%2$s_decoy_checkbox sa_option_checkbox" type="checkbox" name="line_item_%2$s_decoy_checkbox" value="%1$s" %3$s>', $val, $column_slug, checked( $value, $val, false ) ); 
     68 
     69                        $option .= sprintf( '<input class="%2$s_decoy_checkbox sa_option_checkbox" type="checkbox" name="line_item_%2$s_decoy_checkbox" value="%1$s" %3$s>', $val, $column_slug, $checked ); 
    6470                        break; 
    6571                    case 'money': 
     
    7884                if ( $wrap ) { 
    7985                    printf( '<div class="column %3$s column_%2$s">%1$s</div><!-- / column_%2$s -->', $option, $column_slug, $hide_if_parent, $column['label'] ); 
    80                 } 
    81                 else { 
     86                } else { 
    8287                    print $option; 
    8388                } 
  • sprout-invoices/trunk/views/templates/theme/default/estimate/estimate.php

    r1782156 r1789165  
    132132            <div class="inner"> 
    133133                <?php 
    134                     $time_left = si_get_estimate_expiration_date() - current_time( 'timestamp', true ); 
     134                    $time_left = si_get_estimate_expiration_date() - current_time( 'timestamp' ); 
    135135                    $days_left = round( (($time_left / 24) / 60) / 60 ); 
    136136                        ?> 
  • sprout-invoices/trunk/views/templates/theme/default/invoice/payment-options.php

    r1782156 r1789165  
    44         
    55        <?php 
    6             $time_left = si_get_invoice_due_date() - current_time( 'timestamp', true ); 
     6            $time_left = si_get_invoice_due_date() - current_time( 'timestamp' ); 
    77            $days_left = round( (($time_left / 24) / 60) / 60 ); 
    88                ?> 
Note: See TracChangeset for help on using the changeset viewer.