Changeset 2452635
- Timestamp:
- 01/08/2021 01:09:33 PM (5 years ago)
- Location:
- swiss-qr-bill
- Files:
-
- 26 edited
- 1 copied
-
tags/1.0.3 (copied) (copied from swiss-qr-bill/trunk)
-
tags/1.0.3/admin/class-settings-wsqb-product-cat.php (modified) (3 diffs)
-
tags/1.0.3/admin/js/wc-swiss-qr-bill-admin.js (modified) (1 diff)
-
tags/1.0.3/includes/class-wc-swiss-qr-bill.php (modified) (1 diff)
-
tags/1.0.3/includes/gateway/class-wc-gateway-swiss-qr-bill.php (modified) (1 diff)
-
tags/1.0.3/includes/gateway/class-wc-swiss-qr-bill-generate.php (modified) (3 diffs)
-
tags/1.0.3/includes/tcpdf/class-custom-tcpdf.php (modified) (1 diff)
-
tags/1.0.3/includes/tcpdf/templates/parts/additional-info.php (modified) (1 diff)
-
tags/1.0.3/includes/tcpdf/templates/parts/customer-address.php (modified) (1 diff)
-
tags/1.0.3/includes/tcpdf/templates/parts/order-items-header.php (modified) (1 diff)
-
tags/1.0.3/includes/tcpdf/templates/parts/payable-qr.php (modified) (1 diff)
-
tags/1.0.3/includes/tcpdf/templates/parts/shop-header.php (modified) (1 diff)
-
tags/1.0.3/readme.txt (modified) (2 diffs)
-
tags/1.0.3/swiss-qr-bill.php (modified) (3 diffs)
-
trunk/admin/class-settings-wsqb-product-cat.php (modified) (3 diffs)
-
trunk/admin/js/wc-swiss-qr-bill-admin.js (modified) (1 diff)
-
trunk/includes/class-wc-swiss-qr-bill.php (modified) (1 diff)
-
trunk/includes/gateway/class-wc-gateway-swiss-qr-bill.php (modified) (1 diff)
-
trunk/includes/gateway/class-wc-swiss-qr-bill-generate.php (modified) (3 diffs)
-
trunk/includes/tcpdf/class-custom-tcpdf.php (modified) (1 diff)
-
trunk/includes/tcpdf/templates/parts/additional-info.php (modified) (1 diff)
-
trunk/includes/tcpdf/templates/parts/customer-address.php (modified) (1 diff)
-
trunk/includes/tcpdf/templates/parts/order-items-header.php (modified) (1 diff)
-
trunk/includes/tcpdf/templates/parts/payable-qr.php (modified) (1 diff)
-
trunk/includes/tcpdf/templates/parts/shop-header.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/swiss-qr-bill.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
swiss-qr-bill/tags/1.0.3/admin/class-settings-wsqb-product-cat.php
r2332919 r2452635 30 30 <?php _e('Activate Swiss QR bill payments', 'swiss-qr-bill'); ?> 31 31 <input type="checkbox" id="wsqb_activate_gateway" name="wsqb_activate_gateway" checked value="yes"/> 32 <?php wp_nonce_field('wsqb_activate_gateway_nonce', 'wsqb_activate_gateway_nonce'); ?> 32 33 </label> 33 34 </div> … … 52 53 <input type="checkbox" id="wsqb_activate_gateway" name="wsqb_activate_gateway" 53 54 value="yes" <?php echo $show_category == '' ? 'checked' : ($show_category ? checked($show_category, 'yes') : ''); ?>/> 55 <?php wp_nonce_field('wsqb_activate_gateway_nonce', 'wsqb_activate_gateway_nonce'); ?> 54 56 </td> 57 55 58 </tr><?php 56 59 } … … 62 65 */ 63 66 function save_settings( $term_id, $tag_id ) { 67 if ( !isset($_POST['wsqb_activate_gateway_nonce']) 68 || !wp_verify_nonce($_POST['wsqb_activate_gateway_nonce'], 'wsqb_activate_gateway_nonce') 69 ) { 70 return false; 71 } 64 72 if ( isset($_POST['wsqb_activate_gateway']) ) { 65 73 update_term_meta($term_id, 'wsqb_activate_gateway', 'yes'); -
swiss-qr-bill/tags/1.0.3/admin/js/wc-swiss-qr-bill-admin.js
r2330597 r2452635 70 70 $(this).detach(); 71 71 }) 72 73 $('#woocommerce_wc_swiss_qr_bill_footer_text').prop('maxlength', 160) 72 74 }); -
swiss-qr-bill/tags/1.0.3/includes/class-wc-swiss-qr-bill.php
r2379592 r2452635 55 55 $this->version = WC_SWISS_QR_BILL_VER; 56 56 } else { 57 $this->version = '1.0. 2';57 $this->version = '1.0.3'; 58 58 } 59 59 $this->plugin_name = 'swiss-qr-bill'; -
swiss-qr-bill/tags/1.0.3/includes/gateway/class-wc-gateway-swiss-qr-bill.php
r2379592 r2452635 142 142 public function is_available() { 143 143 144 return self::check_currency_validation() &&145 $this->is_valid_billing_country() &&146 empty($this->invoiceGenerate->gateway_field_empty_validation()) &&147 $this->get_option('enabled') === 'yes' &&148 $this->check_logged_in_restriction() &&149 $this->check_order_restriction() &&150 $this->check_product_cats_restriction() &&151 $this->invoiceGenerate->is_data_valid_for_qr_bill();144 return self::check_currency_validation() 145 && $this->is_valid_billing_country() 146 && empty($this->invoiceGenerate->gateway_field_empty_validation()) 147 && $this->get_option('enabled') === 'yes' 148 && $this->check_logged_in_restriction() 149 && $this->check_order_restriction() 150 && $this->check_product_cats_restriction() 151 && $this->invoiceGenerate->is_data_valid_for_qr_bill(); 152 152 } 153 153 -
swiss-qr-bill/tags/1.0.3/includes/gateway/class-wc-swiss-qr-bill-generate.php
r2332919 r2452635 274 274 // set document information 275 275 $pdf->SetCreator(PDF_CREATOR); 276 $pdf->SetTitle('Invoice ' . $order->get_ id());276 $pdf->SetTitle('Invoice ' . $order->get_order_number()); 277 277 278 278 // set default header data … … 356 356 } 357 357 //Close and output PDF document 358 $pdf_name = $order->get_ id() . '.pdf'; // To be changed later358 $pdf_name = $order->get_order_number() . '.pdf'; // To be changed later 359 359 try { 360 360 $invoice_pdf = WC_SWISS_QR_BILL_UPLOAD_DIR . $pdf_name; … … 388 388 389 389 /** 390 * Helper function to generate the German formatted date390 * Helper function to generate the German / French formatted date 391 391 * @param $date 392 392 * @return String 393 393 */ 394 public static function get_german_formatted_date( $date ) { 395 $fmt = datefmt_create("de_DE", IntlDateFormatter::LONG, IntlDateFormatter::NONE, 'Europe/Berlin', IntlDateFormatter::GREGORIAN); 394 public static function get_formatted_date( $date ) { 395 if ( in_array(get_locale(), array('fr_FR', 'fr_BE', 'fr_CA')) ) { 396 $fmt = datefmt_create("fr_BE", IntlDateFormatter::LONG, IntlDateFormatter::NONE, 'Europe/Paris', IntlDateFormatter::GREGORIAN); 397 } else { 398 $fmt = datefmt_create("de_DE", IntlDateFormatter::LONG, IntlDateFormatter::NONE, 'Europe/Berlin', IntlDateFormatter::GREGORIAN); 399 } 396 400 397 401 return datefmt_format($fmt, $date); -
swiss-qr-bill/tags/1.0.3/includes/tcpdf/class-custom-tcpdf.php
r2330597 r2452635 35 35 // Page footer 36 36 public function Footer() { 37 38 37 // Position at 15 mm from bottom 39 $this->SetY(-1 9);38 $this->SetY(-18); 40 39 // Set font 41 40 $this->SetFont('helvetica', '', 7); 42 41 // Page number 43 $this->Cell(0, 10, $this->footer_text, 0, false, 'C', 0, '', 0, false, 'T', 'M');42 $this->Cell(0, 10, substr($this->footer_text, 0, 160), 0, false, 'C', 0, '', 0, false, 'T', 'M'); 44 43 } 45 44 } -
swiss-qr-bill/tags/1.0.3/includes/tcpdf/templates/parts/additional-info.php
r2332919 r2452635 1 1 <?php 2 $invoice_num = $order->get_id(); 3 $invoice_date = WC_Swiss_Qr_Bill_Generate::get_german_formatted_date($order->get_date_created()) 2 $invoice_date = WC_Swiss_Qr_Bill_Generate::get_formatted_date($order->get_date_created()) 4 3 ?><b><?php _e('Additional information', 'swiss-qr-bill'); ?></b> 5 <br><?php echo __('Invoice', 'swiss-qr-bill') . ' [ #' . $order->get_ id() . ' ]' . '[ ' . $invoice_date . ' ]'; ?>4 <br><?php echo __('Invoice', 'swiss-qr-bill') . ' [ #' . $order->get_order_number() . ' ]' . '[ ' . $invoice_date . ' ]'; ?> -
swiss-qr-bill/tags/1.0.3/includes/tcpdf/templates/parts/customer-address.php
r2330597 r2452635 1 1 <?php 2 $invoice_date = WC_Swiss_Qr_Bill_Generate::get_ german_formatted_date($order->get_date_created())2 $invoice_date = WC_Swiss_Qr_Bill_Generate::get_formatted_date($order->get_date_created()) 3 3 ?> 4 4 <style> -
swiss-qr-bill/tags/1.0.3/includes/tcpdf/templates/parts/order-items-header.php
r2332919 r2452635 7 7 ?> 8 8 <h5 id="order-header" style="font-size: 18px"><?php _e('Invoice', 'swiss-qr-bill'); ?> 9 #<?php echo $order->get_ id() . $page_number_title; ?></h5>9 #<?php echo $order->get_order_number() . $page_number_title; ?></h5> -
swiss-qr-bill/tags/1.0.3/includes/tcpdf/templates/parts/payable-qr.php
r2332919 r2452635 57 57 </td> 58 58 <td class="blank"></td> 59 <td class="two-col f-small"><br><br><br><img src="<?php echo WC_SWISS_QR_BILL_UPLOAD_DIR . $order->get_ id().'.png'; ?>" height="160" width="160"/>59 <td class="two-col f-small"><br><br><br><img src="<?php echo WC_SWISS_QR_BILL_UPLOAD_DIR . $order->get_order_number().'.png'; ?>" height="160" width="160"/> 60 60 </td> 61 61 <td class="three-col f-larger"><?php echo $payable_to; ?> -
swiss-qr-bill/tags/1.0.3/includes/tcpdf/templates/parts/shop-header.php
r2332919 r2452635 12 12 <?php if ( $gateway_options['shop_logo'] ): ?> 13 13 <tr> 14 <td><img src="<?php echo wp_get_attachment_image($gateway_options['shop_logo'], array(100, 100)) ?>"15 width=" 80" height="80">14 <td><img src="<?php echo wp_get_attachment_image($gateway_options['shop_logo'], 'full') ?>" 15 width="auto" height="80"> 16 16 </td> 17 17 </tr> -
swiss-qr-bill/tags/1.0.3/readme.txt
r2379592 r2452635 4 4 Tags: woocommerce, swiss, switzerland, qr, qr bill, qr invoice, qr code, bill, billing, invoice, invoicing 5 5 Requires at least: 4.6 6 Tested up to: 5. 56 Tested up to: 5.6 7 7 Requires PHP: 7.0 8 Stable tag: 1.0. 28 Stable tag: 1.0.3 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 104 104 105 105 == Changelog == 106 = 1.0.3 = 107 * fix: invoice logo resize cutoff. 108 * add: french date format in invoice. 109 * add: compatibility with sequential order number. 110 * fix: product category gateway restriction. 111 106 112 = 1.0.2 = 107 113 * fix: customer session check in backend. 108 114 * fix: store location country update. 115 109 116 = 1.0.1 = 110 117 * Text domain fixes. 118 111 119 = 1.0.0 = 112 120 * Initial push. -
swiss-qr-bill/tags/1.0.3/swiss-qr-bill.php
r2379592 r2452635 7 7 * Plugin Name: Swiss QR Bill 8 8 * Description: Swiss QR Bill 9 * Version: 1.0. 29 * Version: 1.0.3 10 10 * Author: HostBliss 11 11 * Author URI: https://hostbliss.ch/ … … 15 15 * Domain Path: /languages 16 16 * WC requires at least: 2.6 17 * WC tested up to: 4. 5.117 * WC tested up to: 4.8.0 18 18 */ 19 19 … … 26 26 * Currently plugin version. 27 27 */ 28 define('WC_SWISS_QR_BILL_VER', '1.0. 2');28 define('WC_SWISS_QR_BILL_VER', '1.0.3'); 29 29 /** 30 30 * Root level plugin file -
swiss-qr-bill/trunk/admin/class-settings-wsqb-product-cat.php
r2332919 r2452635 30 30 <?php _e('Activate Swiss QR bill payments', 'swiss-qr-bill'); ?> 31 31 <input type="checkbox" id="wsqb_activate_gateway" name="wsqb_activate_gateway" checked value="yes"/> 32 <?php wp_nonce_field('wsqb_activate_gateway_nonce', 'wsqb_activate_gateway_nonce'); ?> 32 33 </label> 33 34 </div> … … 52 53 <input type="checkbox" id="wsqb_activate_gateway" name="wsqb_activate_gateway" 53 54 value="yes" <?php echo $show_category == '' ? 'checked' : ($show_category ? checked($show_category, 'yes') : ''); ?>/> 55 <?php wp_nonce_field('wsqb_activate_gateway_nonce', 'wsqb_activate_gateway_nonce'); ?> 54 56 </td> 57 55 58 </tr><?php 56 59 } … … 62 65 */ 63 66 function save_settings( $term_id, $tag_id ) { 67 if ( !isset($_POST['wsqb_activate_gateway_nonce']) 68 || !wp_verify_nonce($_POST['wsqb_activate_gateway_nonce'], 'wsqb_activate_gateway_nonce') 69 ) { 70 return false; 71 } 64 72 if ( isset($_POST['wsqb_activate_gateway']) ) { 65 73 update_term_meta($term_id, 'wsqb_activate_gateway', 'yes'); -
swiss-qr-bill/trunk/admin/js/wc-swiss-qr-bill-admin.js
r2330597 r2452635 70 70 $(this).detach(); 71 71 }) 72 73 $('#woocommerce_wc_swiss_qr_bill_footer_text').prop('maxlength', 160) 72 74 }); -
swiss-qr-bill/trunk/includes/class-wc-swiss-qr-bill.php
r2379592 r2452635 55 55 $this->version = WC_SWISS_QR_BILL_VER; 56 56 } else { 57 $this->version = '1.0. 2';57 $this->version = '1.0.3'; 58 58 } 59 59 $this->plugin_name = 'swiss-qr-bill'; -
swiss-qr-bill/trunk/includes/gateway/class-wc-gateway-swiss-qr-bill.php
r2379592 r2452635 142 142 public function is_available() { 143 143 144 return self::check_currency_validation() &&145 $this->is_valid_billing_country() &&146 empty($this->invoiceGenerate->gateway_field_empty_validation()) &&147 $this->get_option('enabled') === 'yes' &&148 $this->check_logged_in_restriction() &&149 $this->check_order_restriction() &&150 $this->check_product_cats_restriction() &&151 $this->invoiceGenerate->is_data_valid_for_qr_bill();144 return self::check_currency_validation() 145 && $this->is_valid_billing_country() 146 && empty($this->invoiceGenerate->gateway_field_empty_validation()) 147 && $this->get_option('enabled') === 'yes' 148 && $this->check_logged_in_restriction() 149 && $this->check_order_restriction() 150 && $this->check_product_cats_restriction() 151 && $this->invoiceGenerate->is_data_valid_for_qr_bill(); 152 152 } 153 153 -
swiss-qr-bill/trunk/includes/gateway/class-wc-swiss-qr-bill-generate.php
r2332919 r2452635 274 274 // set document information 275 275 $pdf->SetCreator(PDF_CREATOR); 276 $pdf->SetTitle('Invoice ' . $order->get_ id());276 $pdf->SetTitle('Invoice ' . $order->get_order_number()); 277 277 278 278 // set default header data … … 356 356 } 357 357 //Close and output PDF document 358 $pdf_name = $order->get_ id() . '.pdf'; // To be changed later358 $pdf_name = $order->get_order_number() . '.pdf'; // To be changed later 359 359 try { 360 360 $invoice_pdf = WC_SWISS_QR_BILL_UPLOAD_DIR . $pdf_name; … … 388 388 389 389 /** 390 * Helper function to generate the German formatted date390 * Helper function to generate the German / French formatted date 391 391 * @param $date 392 392 * @return String 393 393 */ 394 public static function get_german_formatted_date( $date ) { 395 $fmt = datefmt_create("de_DE", IntlDateFormatter::LONG, IntlDateFormatter::NONE, 'Europe/Berlin', IntlDateFormatter::GREGORIAN); 394 public static function get_formatted_date( $date ) { 395 if ( in_array(get_locale(), array('fr_FR', 'fr_BE', 'fr_CA')) ) { 396 $fmt = datefmt_create("fr_BE", IntlDateFormatter::LONG, IntlDateFormatter::NONE, 'Europe/Paris', IntlDateFormatter::GREGORIAN); 397 } else { 398 $fmt = datefmt_create("de_DE", IntlDateFormatter::LONG, IntlDateFormatter::NONE, 'Europe/Berlin', IntlDateFormatter::GREGORIAN); 399 } 396 400 397 401 return datefmt_format($fmt, $date); -
swiss-qr-bill/trunk/includes/tcpdf/class-custom-tcpdf.php
r2330597 r2452635 35 35 // Page footer 36 36 public function Footer() { 37 38 37 // Position at 15 mm from bottom 39 $this->SetY(-1 9);38 $this->SetY(-18); 40 39 // Set font 41 40 $this->SetFont('helvetica', '', 7); 42 41 // Page number 43 $this->Cell(0, 10, $this->footer_text, 0, false, 'C', 0, '', 0, false, 'T', 'M');42 $this->Cell(0, 10, substr($this->footer_text, 0, 160), 0, false, 'C', 0, '', 0, false, 'T', 'M'); 44 43 } 45 44 } -
swiss-qr-bill/trunk/includes/tcpdf/templates/parts/additional-info.php
r2332919 r2452635 1 1 <?php 2 $invoice_num = $order->get_id(); 3 $invoice_date = WC_Swiss_Qr_Bill_Generate::get_german_formatted_date($order->get_date_created()) 2 $invoice_date = WC_Swiss_Qr_Bill_Generate::get_formatted_date($order->get_date_created()) 4 3 ?><b><?php _e('Additional information', 'swiss-qr-bill'); ?></b> 5 <br><?php echo __('Invoice', 'swiss-qr-bill') . ' [ #' . $order->get_ id() . ' ]' . '[ ' . $invoice_date . ' ]'; ?>4 <br><?php echo __('Invoice', 'swiss-qr-bill') . ' [ #' . $order->get_order_number() . ' ]' . '[ ' . $invoice_date . ' ]'; ?> -
swiss-qr-bill/trunk/includes/tcpdf/templates/parts/customer-address.php
r2330597 r2452635 1 1 <?php 2 $invoice_date = WC_Swiss_Qr_Bill_Generate::get_ german_formatted_date($order->get_date_created())2 $invoice_date = WC_Swiss_Qr_Bill_Generate::get_formatted_date($order->get_date_created()) 3 3 ?> 4 4 <style> -
swiss-qr-bill/trunk/includes/tcpdf/templates/parts/order-items-header.php
r2332919 r2452635 7 7 ?> 8 8 <h5 id="order-header" style="font-size: 18px"><?php _e('Invoice', 'swiss-qr-bill'); ?> 9 #<?php echo $order->get_ id() . $page_number_title; ?></h5>9 #<?php echo $order->get_order_number() . $page_number_title; ?></h5> -
swiss-qr-bill/trunk/includes/tcpdf/templates/parts/payable-qr.php
r2332919 r2452635 57 57 </td> 58 58 <td class="blank"></td> 59 <td class="two-col f-small"><br><br><br><img src="<?php echo WC_SWISS_QR_BILL_UPLOAD_DIR . $order->get_ id().'.png'; ?>" height="160" width="160"/>59 <td class="two-col f-small"><br><br><br><img src="<?php echo WC_SWISS_QR_BILL_UPLOAD_DIR . $order->get_order_number().'.png'; ?>" height="160" width="160"/> 60 60 </td> 61 61 <td class="three-col f-larger"><?php echo $payable_to; ?> -
swiss-qr-bill/trunk/includes/tcpdf/templates/parts/shop-header.php
r2332919 r2452635 12 12 <?php if ( $gateway_options['shop_logo'] ): ?> 13 13 <tr> 14 <td><img src="<?php echo wp_get_attachment_image($gateway_options['shop_logo'], array(100, 100)) ?>"15 width=" 80" height="80">14 <td><img src="<?php echo wp_get_attachment_image($gateway_options['shop_logo'], 'full') ?>" 15 width="auto" height="80"> 16 16 </td> 17 17 </tr> -
swiss-qr-bill/trunk/readme.txt
r2379592 r2452635 4 4 Tags: woocommerce, swiss, switzerland, qr, qr bill, qr invoice, qr code, bill, billing, invoice, invoicing 5 5 Requires at least: 4.6 6 Tested up to: 5. 56 Tested up to: 5.6 7 7 Requires PHP: 7.0 8 Stable tag: 1.0. 28 Stable tag: 1.0.3 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 104 104 105 105 == Changelog == 106 = 1.0.3 = 107 * fix: invoice logo resize cutoff. 108 * add: french date format in invoice. 109 * add: compatibility with sequential order number. 110 * fix: product category gateway restriction. 111 106 112 = 1.0.2 = 107 113 * fix: customer session check in backend. 108 114 * fix: store location country update. 115 109 116 = 1.0.1 = 110 117 * Text domain fixes. 118 111 119 = 1.0.0 = 112 120 * Initial push. -
swiss-qr-bill/trunk/swiss-qr-bill.php
r2379592 r2452635 7 7 * Plugin Name: Swiss QR Bill 8 8 * Description: Swiss QR Bill 9 * Version: 1.0. 29 * Version: 1.0.3 10 10 * Author: HostBliss 11 11 * Author URI: https://hostbliss.ch/ … … 15 15 * Domain Path: /languages 16 16 * WC requires at least: 2.6 17 * WC tested up to: 4. 5.117 * WC tested up to: 4.8.0 18 18 */ 19 19 … … 26 26 * Currently plugin version. 27 27 */ 28 define('WC_SWISS_QR_BILL_VER', '1.0. 2');28 define('WC_SWISS_QR_BILL_VER', '1.0.3'); 29 29 /** 30 30 * Root level plugin file
Note: See TracChangeset
for help on using the changeset viewer.