Plugin Directory

Changeset 2452635


Ignore:
Timestamp:
01/08/2021 01:09:33 PM (5 years ago)
Author:
hostbliss
Message:

tagging 1.03

Location:
swiss-qr-bill
Files:
26 edited
1 copied

Legend:

Unmodified
Added
Removed
  • swiss-qr-bill/tags/1.0.3/admin/class-settings-wsqb-product-cat.php

    r2332919 r2452635  
    3030                <?php _e('Activate Swiss QR bill payments', 'swiss-qr-bill'); ?>
    3131                <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'); ?>
    3233            </label>
    3334        </div>
     
    5253            <input type="checkbox" id="wsqb_activate_gateway" name="wsqb_activate_gateway"
    5354                   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'); ?>
    5456        </td>
     57
    5558        </tr><?php
    5659    }
     
    6265     */
    6366    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        }
    6472        if ( isset($_POST['wsqb_activate_gateway']) ) {
    6573            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  
    7070        $(this).detach();
    7171    })
     72
     73    $('#woocommerce_wc_swiss_qr_bill_footer_text').prop('maxlength', 160)
    7274});
  • swiss-qr-bill/tags/1.0.3/includes/class-wc-swiss-qr-bill.php

    r2379592 r2452635  
    5555            $this->version = WC_SWISS_QR_BILL_VER;
    5656        } else {
    57             $this->version = '1.0.2';
     57            $this->version = '1.0.3';
    5858        }
    5959        $this->plugin_name = 'swiss-qr-bill';
  • swiss-qr-bill/tags/1.0.3/includes/gateway/class-wc-gateway-swiss-qr-bill.php

    r2379592 r2452635  
    142142    public function is_available() {
    143143
    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();
    152152    }
    153153
  • swiss-qr-bill/tags/1.0.3/includes/gateway/class-wc-swiss-qr-bill-generate.php

    r2332919 r2452635  
    274274        // set document information
    275275        $pdf->SetCreator(PDF_CREATOR);
    276         $pdf->SetTitle('Invoice ' . $order->get_id());
     276        $pdf->SetTitle('Invoice ' . $order->get_order_number());
    277277
    278278        // set default header data
     
    356356        }
    357357        //Close and output PDF document
    358         $pdf_name = $order->get_id() . '.pdf'; // To be changed later
     358        $pdf_name = $order->get_order_number() . '.pdf'; // To be changed later
    359359        try {
    360360            $invoice_pdf = WC_SWISS_QR_BILL_UPLOAD_DIR . $pdf_name;
     
    388388
    389389    /**
    390      * Helper function to generate the German formatted date
     390     * Helper function to generate the German / French formatted date
    391391     * @param $date
    392392     * @return String
    393393     */
    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        }
    396400
    397401        return datefmt_format($fmt, $date);
  • swiss-qr-bill/tags/1.0.3/includes/tcpdf/class-custom-tcpdf.php

    r2330597 r2452635  
    3535    // Page footer
    3636    public function Footer() {
    37 
    3837        // Position at 15 mm from bottom
    39         $this->SetY(-19);
     38        $this->SetY(-18);
    4039        // Set font
    4140        $this->SetFont('helvetica', '', 7);
    4241        // 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');
    4443    }
    4544}
  • swiss-qr-bill/tags/1.0.3/includes/tcpdf/templates/parts/additional-info.php

    r2332919 r2452635  
    11<?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())
    43?><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  
    11<?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())
    33?>
    44<style>
  • swiss-qr-bill/tags/1.0.3/includes/tcpdf/templates/parts/order-items-header.php

    r2332919 r2452635  
    77?>
    88<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  
    5757        </td>
    5858        <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"/>
    6060        </td>
    6161        <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  
    1212    <?php if ( $gateway_options['shop_logo'] ): ?>
    1313        <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">
    1616            </td>
    1717        </tr>
  • swiss-qr-bill/tags/1.0.3/readme.txt

    r2379592 r2452635  
    44Tags: woocommerce, swiss, switzerland, qr, qr bill, qr invoice, qr code, bill, billing, invoice, invoicing
    55Requires at least: 4.6
    6 Tested up to: 5.5
     6Tested up to: 5.6
    77Requires PHP: 7.0
    8 Stable tag: 1.0.2
     8Stable tag: 1.0.3
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    104104
    105105== 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
    106112= 1.0.2 =
    107113* fix: customer session check in backend.
    108114* fix: store location country update.
     115
    109116= 1.0.1 =
    110117* Text domain fixes.
     118
    111119= 1.0.0 =
    112120* Initial push.
  • swiss-qr-bill/tags/1.0.3/swiss-qr-bill.php

    r2379592 r2452635  
    77 * Plugin Name:       Swiss QR Bill
    88 * Description:       Swiss QR Bill
    9  * Version:           1.0.2
     9 * Version:           1.0.3
    1010 * Author:            HostBliss
    1111 * Author URI:        https://hostbliss.ch/
     
    1515 * Domain Path:       /languages
    1616 * WC requires at least: 2.6
    17  * WC tested up to: 4.5.1
     17 * WC tested up to: 4.8.0
    1818 */
    1919
     
    2626 * Currently plugin version.
    2727 */
    28 define('WC_SWISS_QR_BILL_VER', '1.0.2');
     28define('WC_SWISS_QR_BILL_VER', '1.0.3');
    2929/**
    3030 * Root level plugin file
  • swiss-qr-bill/trunk/admin/class-settings-wsqb-product-cat.php

    r2332919 r2452635  
    3030                <?php _e('Activate Swiss QR bill payments', 'swiss-qr-bill'); ?>
    3131                <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'); ?>
    3233            </label>
    3334        </div>
     
    5253            <input type="checkbox" id="wsqb_activate_gateway" name="wsqb_activate_gateway"
    5354                   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'); ?>
    5456        </td>
     57
    5558        </tr><?php
    5659    }
     
    6265     */
    6366    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        }
    6472        if ( isset($_POST['wsqb_activate_gateway']) ) {
    6573            update_term_meta($term_id, 'wsqb_activate_gateway', 'yes');
  • swiss-qr-bill/trunk/admin/js/wc-swiss-qr-bill-admin.js

    r2330597 r2452635  
    7070        $(this).detach();
    7171    })
     72
     73    $('#woocommerce_wc_swiss_qr_bill_footer_text').prop('maxlength', 160)
    7274});
  • swiss-qr-bill/trunk/includes/class-wc-swiss-qr-bill.php

    r2379592 r2452635  
    5555            $this->version = WC_SWISS_QR_BILL_VER;
    5656        } else {
    57             $this->version = '1.0.2';
     57            $this->version = '1.0.3';
    5858        }
    5959        $this->plugin_name = 'swiss-qr-bill';
  • swiss-qr-bill/trunk/includes/gateway/class-wc-gateway-swiss-qr-bill.php

    r2379592 r2452635  
    142142    public function is_available() {
    143143
    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();
    152152    }
    153153
  • swiss-qr-bill/trunk/includes/gateway/class-wc-swiss-qr-bill-generate.php

    r2332919 r2452635  
    274274        // set document information
    275275        $pdf->SetCreator(PDF_CREATOR);
    276         $pdf->SetTitle('Invoice ' . $order->get_id());
     276        $pdf->SetTitle('Invoice ' . $order->get_order_number());
    277277
    278278        // set default header data
     
    356356        }
    357357        //Close and output PDF document
    358         $pdf_name = $order->get_id() . '.pdf'; // To be changed later
     358        $pdf_name = $order->get_order_number() . '.pdf'; // To be changed later
    359359        try {
    360360            $invoice_pdf = WC_SWISS_QR_BILL_UPLOAD_DIR . $pdf_name;
     
    388388
    389389    /**
    390      * Helper function to generate the German formatted date
     390     * Helper function to generate the German / French formatted date
    391391     * @param $date
    392392     * @return String
    393393     */
    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        }
    396400
    397401        return datefmt_format($fmt, $date);
  • swiss-qr-bill/trunk/includes/tcpdf/class-custom-tcpdf.php

    r2330597 r2452635  
    3535    // Page footer
    3636    public function Footer() {
    37 
    3837        // Position at 15 mm from bottom
    39         $this->SetY(-19);
     38        $this->SetY(-18);
    4039        // Set font
    4140        $this->SetFont('helvetica', '', 7);
    4241        // 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');
    4443    }
    4544}
  • swiss-qr-bill/trunk/includes/tcpdf/templates/parts/additional-info.php

    r2332919 r2452635  
    11<?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())
    43?><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  
    11<?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())
    33?>
    44<style>
  • swiss-qr-bill/trunk/includes/tcpdf/templates/parts/order-items-header.php

    r2332919 r2452635  
    77?>
    88<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  
    5757        </td>
    5858        <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"/>
    6060        </td>
    6161        <td class="three-col f-larger"><?php echo $payable_to; ?>
  • swiss-qr-bill/trunk/includes/tcpdf/templates/parts/shop-header.php

    r2332919 r2452635  
    1212    <?php if ( $gateway_options['shop_logo'] ): ?>
    1313        <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">
    1616            </td>
    1717        </tr>
  • swiss-qr-bill/trunk/readme.txt

    r2379592 r2452635  
    44Tags: woocommerce, swiss, switzerland, qr, qr bill, qr invoice, qr code, bill, billing, invoice, invoicing
    55Requires at least: 4.6
    6 Tested up to: 5.5
     6Tested up to: 5.6
    77Requires PHP: 7.0
    8 Stable tag: 1.0.2
     8Stable tag: 1.0.3
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    104104
    105105== 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
    106112= 1.0.2 =
    107113* fix: customer session check in backend.
    108114* fix: store location country update.
     115
    109116= 1.0.1 =
    110117* Text domain fixes.
     118
    111119= 1.0.0 =
    112120* Initial push.
  • swiss-qr-bill/trunk/swiss-qr-bill.php

    r2379592 r2452635  
    77 * Plugin Name:       Swiss QR Bill
    88 * Description:       Swiss QR Bill
    9  * Version:           1.0.2
     9 * Version:           1.0.3
    1010 * Author:            HostBliss
    1111 * Author URI:        https://hostbliss.ch/
     
    1515 * Domain Path:       /languages
    1616 * WC requires at least: 2.6
    17  * WC tested up to: 4.5.1
     17 * WC tested up to: 4.8.0
    1818 */
    1919
     
    2626 * Currently plugin version.
    2727 */
    28 define('WC_SWISS_QR_BILL_VER', '1.0.2');
     28define('WC_SWISS_QR_BILL_VER', '1.0.3');
    2929/**
    3030 * Root level plugin file
Note: See TracChangeset for help on using the changeset viewer.