Plugin Directory

Changeset 2542351


Ignore:
Timestamp:
06/04/2021 03:46:04 AM (5 years ago)
Author:
eatbuildplay
Message:

Release v1.1.4.

Location:
saber-commerce/trunk
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • saber-commerce/trunk/components/Account/AccountUserModel.php

    r2537356 r2542351  
    9090        $userData = get_userdata( $model->wpUserId );
    9191        $model->wpUserLabel = $userData->display_name . " (" . $userData->user_email . ")";
     92        $model->wpUserEmail = $userData->user_email;
    9293
    9394        return $model;
  • saber-commerce/trunk/components/Invoice/InvoiceEditor.php

    r2542324 r2542351  
    164164            $invoiceId = $invoiceData['invoiceId'];
    165165
    166             $invoicePdf = new InvoicePdf( $invoiceId );
    167             $response->pdfUrl = $invoicePdf->generate();
     166            $invoicePdf = new InvoicePdf();
     167            $response->pdfUrl = $invoicePdf->generate( $invoiceId );
    168168
    169169            $response->code = 200;
     
    183183            $response = new \stdClass();
    184184            $post = sanitize_post( $_POST );
     185            $invoiceId = $post['invoiceId'];
    185186
    186187            $invoiceSend = new InvoiceSend();
  • saber-commerce/trunk/components/Invoice/InvoicePdf.php

    r2542324 r2542351  
    105105    public function getSavePath( $invoiceId ) {
    106106
    107         return WP_CONTENT_DIR . '/sacom/invoices/invoice-' . $invoiceId . '.pdf';
     107        return WP_CONTENT_DIR . '/uploads/sacom/invoices/invoice-' . $invoiceId . '.pdf';
    108108
    109109    }
  • saber-commerce/trunk/components/Invoice/InvoiceSend.php

    r2537356 r2542351  
    1414    public function send( $invoiceId ) {
    1515
    16         $to          = 'joel+test123@goldhat.ca';
    17         $subject     = 'Invoice from Acme 123';
    18         $message     = 'Invoice is due.';
     16        // Do basic email setup.
     17        $to          = '';
     18        $subject     = 'Invoice';
     19        $message     = 'Your invoice is attached.';
    1920        $headers     = 'Content-Type: text/html; charset=UTF-8';
    2021        $attachments = [];
    2122
     23        // Load invoice.
     24        $m = new InvoiceModel;
     25        $invoice = $m->fetchOne( $invoiceId );
     26
     27        // Attach PDF invoice.
     28        $m = new InvoicePdf();
     29        $pdfPath = $m->getSavePath( $invoiceId );
     30        $attachments[] = $pdfPath;
     31
     32        // Get and verify "to email address", the recipient email.
     33        $to = $invoice->account->users[0]->wpUserEmail;
     34
     35        // Send with wp_mail().
    2236        $result = wp_mail(
    2337            $to,
  • saber-commerce/trunk/components/Invoice/js/InvoiceEditor.js

    r2542324 r2542351  
    864864
    865865            let data = {
    866                 invoiceId: EditorBase.data.currentObjects.parent.invoiceId
     866                invoiceId: EditorBase.data.currentObjects.parent.model.invoiceId
    867867            };
    868868
  • saber-commerce/trunk/readme.txt

    r2542325 r2542351  
    66Tested up to: 5.7
    77Requires PHP: 7.3
    8 Stable tag: 1.1.3
     8Stable tag: 1.1.4
    99License: GPLv3 or later
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    7171== Changelog ==
    7272
     73= 1.1.4 =
     74
     75Fixes email send invoice params.
     76
    7377= 1.1.3 =
    7478
  • saber-commerce/trunk/saber-commerce.php

    r2542324 r2542351  
    66 * Plugin URI: https://wordpress.org/plugins/saber-commerce/
    77 * Description: Time tracking and invoicing software for WordPress sites.
    8  * Version: 1.1.3
     8 * Version: 1.1.4
    99 * Author: Saber WP
    1010 * Author URI: https://saberwp.com/
     
    1818
    1919define( 'SABER_COMMERCE_PLUGIN_NAME', 'Saber Commerce' );
    20 define( 'SABER_COMMERCE_VERSION', '1.1.3' );
     20define( 'SABER_COMMERCE_VERSION', '1.1.4' );
    2121define( 'SABER_COMMERCE_PATH', plugin_dir_path(__FILE__) );
    2222define( 'SABER_COMMERCE_URL', plugin_dir_url(__FILE__) );
     
    179179    public static function activation() {
    180180
     181        // Make SACOM upload directories.
     182
     183        if( !is_dir( WP_CONTENT_DIR . '/uploads/sacom' )) {
     184            mkdir( WP_CONTENT_DIR . '/uploads/sacom', '0755' );
     185        }
     186
     187        if( !is_dir( WP_CONTENT_DIR . '/uploads/sacom/invoices' )) {
     188            mkdir( WP_CONTENT_DIR . '/uploads/sacom/invoices', '0755' );
     189        }
     190
    181191        $c = new Component\Timesheet\TimesheetComponent();
    182192        $c->activation();
Note: See TracChangeset for help on using the changeset viewer.