Changeset 2542351
- Timestamp:
- 06/04/2021 03:46:04 AM (5 years ago)
- Location:
- saber-commerce/trunk
- Files:
-
- 1 added
- 7 edited
-
components/Account/AccountUserModel.php (modified) (1 diff)
-
components/Invoice/InvoiceEditor.php (modified) (2 diffs)
-
components/Invoice/InvoicePdf.php (modified) (1 diff)
-
components/Invoice/InvoiceSend.php (modified) (1 diff)
-
components/Invoice/js/InvoiceEditor.js (modified) (1 diff)
-
components/Invoice/templates/bluewave/invoice-email.php (added)
-
readme.txt (modified) (2 diffs)
-
saber-commerce.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
saber-commerce/trunk/components/Account/AccountUserModel.php
r2537356 r2542351 90 90 $userData = get_userdata( $model->wpUserId ); 91 91 $model->wpUserLabel = $userData->display_name . " (" . $userData->user_email . ")"; 92 $model->wpUserEmail = $userData->user_email; 92 93 93 94 return $model; -
saber-commerce/trunk/components/Invoice/InvoiceEditor.php
r2542324 r2542351 164 164 $invoiceId = $invoiceData['invoiceId']; 165 165 166 $invoicePdf = new InvoicePdf( $invoiceId);167 $response->pdfUrl = $invoicePdf->generate( );166 $invoicePdf = new InvoicePdf(); 167 $response->pdfUrl = $invoicePdf->generate( $invoiceId ); 168 168 169 169 $response->code = 200; … … 183 183 $response = new \stdClass(); 184 184 $post = sanitize_post( $_POST ); 185 $invoiceId = $post['invoiceId']; 185 186 186 187 $invoiceSend = new InvoiceSend(); -
saber-commerce/trunk/components/Invoice/InvoicePdf.php
r2542324 r2542351 105 105 public function getSavePath( $invoiceId ) { 106 106 107 return WP_CONTENT_DIR . '/ sacom/invoices/invoice-' . $invoiceId . '.pdf';107 return WP_CONTENT_DIR . '/uploads/sacom/invoices/invoice-' . $invoiceId . '.pdf'; 108 108 109 109 } -
saber-commerce/trunk/components/Invoice/InvoiceSend.php
r2537356 r2542351 14 14 public function send( $invoiceId ) { 15 15 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.'; 19 20 $headers = 'Content-Type: text/html; charset=UTF-8'; 20 21 $attachments = []; 21 22 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(). 22 36 $result = wp_mail( 23 37 $to, -
saber-commerce/trunk/components/Invoice/js/InvoiceEditor.js
r2542324 r2542351 864 864 865 865 let data = { 866 invoiceId: EditorBase.data.currentObjects.parent. invoiceId866 invoiceId: EditorBase.data.currentObjects.parent.model.invoiceId 867 867 }; 868 868 -
saber-commerce/trunk/readme.txt
r2542325 r2542351 6 6 Tested up to: 5.7 7 7 Requires PHP: 7.3 8 Stable tag: 1.1. 38 Stable tag: 1.1.4 9 9 License: GPLv3 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 71 71 == Changelog == 72 72 73 = 1.1.4 = 74 75 Fixes email send invoice params. 76 73 77 = 1.1.3 = 74 78 -
saber-commerce/trunk/saber-commerce.php
r2542324 r2542351 6 6 * Plugin URI: https://wordpress.org/plugins/saber-commerce/ 7 7 * Description: Time tracking and invoicing software for WordPress sites. 8 * Version: 1.1. 38 * Version: 1.1.4 9 9 * Author: Saber WP 10 10 * Author URI: https://saberwp.com/ … … 18 18 19 19 define( 'SABER_COMMERCE_PLUGIN_NAME', 'Saber Commerce' ); 20 define( 'SABER_COMMERCE_VERSION', '1.1. 3' );20 define( 'SABER_COMMERCE_VERSION', '1.1.4' ); 21 21 define( 'SABER_COMMERCE_PATH', plugin_dir_path(__FILE__) ); 22 22 define( 'SABER_COMMERCE_URL', plugin_dir_url(__FILE__) ); … … 179 179 public static function activation() { 180 180 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 181 191 $c = new Component\Timesheet\TimesheetComponent(); 182 192 $c->activation();
Note: See TracChangeset
for help on using the changeset viewer.