Plugin Directory

Changeset 2939391


Ignore:
Timestamp:
07/17/2023 11:08:48 AM (3 years ago)
Author:
primersoftware
Message:

Update

Location:
primer-mydata
Files:
3114 added
7 edited

Legend:

Unmodified
Added
Removed
  • primer-mydata/trunk/README.txt

    r2937024 r2939391  
    55Tested up to: 6.2.2
    66Requires PHP: 7.4
    7 Stable tag: 4.0.2
     7Stable tag: 4.0.3
    88License: GPLv2
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    129129= 4.0.0 - 2023-05-16 =
    130130* New beta version
     131= 4.0.3 - 2023-07-17 =
     132* Minor Bug Fixes
  • primer-mydata/trunk/admin/includes/primer-admin-table.php

    r2937024 r2939391  
    55require_once PRIMER_PATH . 'views/get_order_list.php';
    66require_once ABSPATH. 'wp-content/plugins/primer-mydata/admin/includes/my_data_json.php';
     7
    78
    89// reference the Dompdf namespace
     
    830831                            }
    831832                                    $post_url = get_the_permalink($post_id);
    832                                     $post_url = $post_url.'?receipt=view';
    833                                     $arrContextOptions=array(
    834                                         "ssl"=>array(
    835                                             "verify_peer"=>false,
    836                                             "verify_peer_name"=>false,
    837                                         ),
    838                                     );
    839                                     $homepage = file_get_contents($post_url, false, stream_context_create($arrContextOptions));
    840                                     update_post_meta(99997, 'test',$homepage);
     833                                    $post_url = $post_url . '?receipt=view';
     834
     835                                    // Create a stream context with appropriate headers
     836                                    $arrContextOptions = array(
     837                                        "ssl" => array(
     838                                            "verify_peer" => false,
     839                                            "verify_peer_name" => false,
     840                                        ),
     841                                        "http" => array(
     842                                            "header" => "Content-type: text/html; charset=utf-8\r\n",
     843                                        ),
     844                                    );
     845
     846                                    $context = stream_context_create($arrContextOptions);
     847
     848                                    // Retrieve the HTML content with the specified headers
     849                                    $homepage = file_get_contents($post_url, false, $context);
    841850                                    // Modify the height of .information.left and .information.right elements
    842851                                    $modified_homepage =  $homepage;
    843                                     if ( get_post_meta($id_of_order, '_billing_invoice_type', true) == 'receipt' ) {
    844                                         $height = '120px';
    845                                     }
    846                                     else {
    847                                         if ( (get_post_meta($id_of_order, '_billing_country', true)) !="GR" ) {
    848                                             $height = '160px';
    849                                         }
    850                                         else {
    851                                             $height = '160px';
    852                                         }
    853                                     }
    854                                     $modified_homepage = str_replace('.information {', '.information {
    855                                         border: 1px solid #555;
    856                                         border-radius: 4px;
    857                                         padding: 1px;
    858                                     }
    859 
    860                                     .information.left {
    861                                         height: '.$height.';
    862                                     }
    863 
    864                                     .information.right {
    865                                         height: '.$height.';
    866                                     }', $modified_homepage);
    867                                     if ( get_post_meta($id_of_order, '_billing_country', true) != "GR") {
    868                                         $modified_homepage = str_replace('<tr><p class="table_titles">CUSTOMER INFORMATION</p>', '<tr><td colspan="2" style="text-align: center;"><p class="table_titles" style="white-space: nowrap; text-align: center;">CUSTOMER INFORMATION</p></td></tr><tr>',$modified_homepage);
    869                                         $modified_homepage = str_replace('<tr><p class="table_titles">OTHER INFORMATION</p>', '<tr><td colspan="2" style="text-align: center;"><p class="table_titles">OTHER INFORMATION</p></td></tr><tr>',$modified_homepage);
    870                                     } else {
    871                                         $modified_homepage = str_replace('<tr><p class="table_titles">ΣΤΟΙΧΕΙΑ ΠΕΛΑΤΗ</p>', '<tr><td colspan="2" style="text-align: center;"><p class="table_titles" style="white-space: nowrap; text-align: center;">ΣΤΟΙΧΕΙΑ ΠΕΛΑΤΗ</p></td></tr><tr>',$modified_homepage);
    872                                         $modified_homepage = str_replace('<tr><p class="table_titles">ΛΟΙΠΑ ΣΤΟΙΧΕΙΑ</p>', '<tr><td colspan="2" style="text-align: center;"><p class="table_titles">ΛΟΙΠΑ ΣΤΟΙΧΕΙΑ</p></td></tr><tr>',$modified_homepage);
    873                                     }
    874852                                    $log_id = get_post_meta($id_of_order, 'log_id_for_order', true);
    875853                                    $json = get_post_meta($log_id,'json_send_to_api',true);
     
    907885                                        $modified_homepage = str_replace('<div class="cont_notation"><span class="skin bold">COMMENTS:</span>', '<div class="cont_notation">' . $exception_vat . '<span class="skin bold">COMMENTS:</span>', $modified_homepage);
    908886                                    }
     887                                    if ( (get_post_meta($id_of_order, '_billing_invoice_type', true) == 'receipt') && (get_post_meta($id_of_order, '_billing_country', true) == "GR") )  {
     888                                        $modified_homepage = str_replace('<div class="information left">', '<div class="information left" style="height: 120px">', $homepage);
     889                                        $modified_homepage = str_replace('<div class="information right">', '<div class="information right" style="height: 120px">', $homepage);
     890                                    }
     891                                    elseif ( (get_post_meta($id_of_order, '_billing_invoice_type', true) == 'receipt' && get_post_meta($id_of_order, '_billing_country', true) != "GR")) {
     892                                        $modified_homepage = str_replace('<div class="information left">', '<div class="information left" style="height: 120px">', $homepage);
     893                                        $modified_homepage = str_replace('<div class="information right">', '<div class="information right" style="height: 100px">', $homepage);
     894                                    }
     895                                    elseif ( (get_post_meta($id_of_order, '_billing_invoice_type', true) != 'receipt') && (get_post_meta($id_of_order, '_billing_country', true) == "GR") ) {
     896                                        $modified_homepage = str_replace('<div class="information left">', '<div class="information left" style="height: 120px">', $homepage);
     897                                        $modified_homepage = str_replace('<div class="information right">', '<div class="information right" style="height: 154px">', $homepage);
     898                                    }
     899                                    elseif ( (get_post_meta($id_of_order, '_billing_invoice_type', true) != 'receipt') && (get_post_meta($id_of_order, '_billing_country', true) != "GR") ) {
     900                                        $modified_homepage = str_replace('<div class="information left">', '<div class="information left" style="height: 120px">', $homepage);
     901                                        $modified_homepage = str_replace('<div class="information right">', '<div class="information right" style="height: 160px">', $homepage);
     902                                    }
     903                                    if ( get_post_meta($id_of_order, '_billing_country', true) != "GR") {
     904                                        $modified_homepage = str_replace('<tr><p class="table_titles">CUSTOMER INFORMATION</p>', '<tr><td colspan="2" style="text-align: center;"><p class="table_titles" style="white-space: nowrap; text-align: center;">CUSTOMER INFORMATION</p></td></tr><tr>',$modified_homepage);
     905                                        $modified_homepage = str_replace('<tr><p class="table_titles">OTHER INFORMATION</p>', '<tr><td colspan="2" style="text-align: center;"><p class="table_titles">OTHER INFORMATION</p></td></tr><tr>',$modified_homepage);
     906                                    } else {
     907                                        $modified_homepage = str_replace('<tr><p class="table_titles">ΣΤΟΙΧΕΙΑ ΠΕΛΑΤΗ</p>', '<tr><td colspan="2" style="text-align: center;"><p class="table_titles" style="white-space: nowrap; text-align: center;">ΣΤΟΙΧΕΙΑ ΠΕΛΑΤΗ</p></td></tr><tr>',$modified_homepage);
     908                                        $modified_homepage = str_replace('<tr><p class="table_titles">ΛΟΙΠΑ ΣΤΟΙΧΕΙΑ</p>', '<tr><td colspan="2" style="text-align: center;"><p class="table_titles">ΛΟΙΠΑ ΣΤΟΙΧΕΙΑ</p></td></tr><tr>',$modified_homepage);
     909                                    }
     910                                    $modified_homepage = str_replace('body { font-family: DejaVu Sans, sans-serif; }', '', $modified_homepage);
     911                                    $modified_homepage = str_replace('<body>', '<body style="font-family: \'DejaVu Sans\', sans-serif;">', $modified_homepage);
    909912                                    $dompdf = new Dompdf();
    910913                                    $options= $dompdf->getOptions();
    911914                                    $options->setIsHtml5ParserEnabled(true);
    912915                                    $options->setIsRemoteEnabled(true);
     916                                    $options->setDefaultFont('DejaVu Sans');
    913917                                    $dompdf->setOptions($options);
    914918                                    $dompdf->loadHtml($modified_homepage);
  • primer-mydata/trunk/includes/class-primer-cron.php

    r2937024 r2939391  
    452452                                                                    "verify_peer_name" => false,
    453453                                                                ),
     454                                                                "http" => array(
     455                                                                    "header" => "Content-type: text/html; charset=utf-8\r\n",
     456                                                                ),
    454457                                                            );
    455                                                             $homepage = file_get_contents($post_url, false, stream_context_create($arrContextOptions));
    456                                                             // instantiate and use the dompdf class
     458
     459                                                            $context = stream_context_create($arrContextOptions);
     460
     461                                                    // Retrieve the HTML content with the specified headers
     462                                                            $homepage = file_get_contents($post_url, false, $context);
    457463                                                            // Modify the height of .information.left and .information.right elements
    458464                                                            $modified_homepage =  $homepage;
    459                                                             if ( get_post_meta($id_of_order, '_billing_invoice_type', true) == 'receipt' ) {
    460                                                                 $height = '120px';
    461                                                             }
    462                                                             else {
    463                                                                 if ( (get_post_meta($id_of_order, '_billing_country', true)) !="GR" ) {
    464                                                                     $height = '160px';
    465                                                                 }
    466                                                                 else {
    467                                                                     $height = '160px';
    468                                                                 }
    469                                                             }
    470                                                             $modified_homepage = str_replace('.information {', '.information {
    471                                                                 border: 1px solid #555;
    472                                                                 border-radius: 4px;
    473                                                                 padding: 1px;
    474                                                             }
    475 
    476                                                             .information.left {
    477                                                                 height: '.$height.';
    478                                                             }
    479 
    480                                                             .information.right {
    481                                                                 height: '.$height.';
    482                                                             }', $modified_homepage);
    483                                                             if ( get_post_meta($id_of_order, '_billing_country', true) != "GR") {
    484                                                                 $modified_homepage = str_replace('<tr><p class="table_titles">CUSTOMER INFORMATION</p>', '<tr><td colspan="2" style="text-align: center;"><p class="table_titles" style="white-space: nowrap; text-align: center;">CUSTOMER INFORMATION</p></td></tr><tr>',$modified_homepage);
    485                                                                 $modified_homepage = str_replace('<tr><p class="table_titles">OTHER INFORMATION</p>', '<tr><td colspan="2" style="text-align: center;"><p class="table_titles">OTHER INFORMATION</p></td></tr><tr>',$modified_homepage);
    486                                                             } else {
    487                                                                 $modified_homepage = str_replace('<tr><p class="table_titles">ΣΤΟΙΧΕΙΑ ΠΕΛΑΤΗ</p>', '<tr><td colspan="2" style="text-align: center;"><p class="table_titles" style="white-space: nowrap; text-align: center;">ΣΤΟΙΧΕΙΑ ΠΕΛΑΤΗ</p></td></tr><tr>',$modified_homepage);
    488                                                                 $modified_homepage = str_replace('<tr><p class="table_titles">ΛΟΙΠΑ ΣΤΟΙΧΕΙΑ</p>', '<tr><td colspan="2" style="text-align: center;"><p class="table_titles">ΛΟΙΠΑ ΣΤΟΙΧΕΙΑ</p></td></tr><tr>',$modified_homepage);
    489                                                             }
    490465                                                            $log_id = get_post_meta($id_of_order, 'log_id_for_order', true);
    491466                                                            $json = get_post_meta($log_id,'json_send_to_api',true);
     
    523498                                                                $modified_homepage = str_replace('<div class="cont_notation"><span class="skin bold">COMMENTS:</span>', '<div class="cont_notation">' . $exception_vat . '<span class="skin bold">COMMENTS:</span>', $modified_homepage);
    524499                                                            }
     500                                                            if ( (get_post_meta($id_of_order, '_billing_invoice_type', true) == 'receipt') && (get_post_meta($id_of_order, '_billing_country', true) == "GR") )  {
     501                                                                $modified_homepage = str_replace('<div class="information left">', '<div class="information left" style="height: 120px">', $homepage);
     502                                                                $modified_homepage = str_replace('<div class="information right">', '<div class="information right" style="height: 120px">', $homepage);
     503                                                            }
     504                                                            elseif ( (get_post_meta($id_of_order, '_billing_invoice_type', true) == 'receipt' && get_post_meta($id_of_order, '_billing_country', true) != "GR")) {
     505                                                                $modified_homepage = str_replace('<div class="information left">', '<div class="information left" style="height: 120px">', $homepage);
     506                                                                $modified_homepage = str_replace('<div class="information right">', '<div class="information right" style="height: 100px">', $homepage);
     507                                                            }
     508                                                            elseif ( (get_post_meta($id_of_order, '_billing_invoice_type', true) != 'receipt') && (get_post_meta($id_of_order, '_billing_country', true) == "GR") ) {
     509                                                                $modified_homepage = str_replace('<div class="information left">', '<div class="information left" style="height: 120px">', $homepage);
     510                                                                $modified_homepage = str_replace('<div class="information right">', '<div class="information right" style="height: 154px">', $homepage);
     511                                                            }
     512                                                            elseif ( (get_post_meta($id_of_order, '_billing_invoice_type', true) != 'receipt') && (get_post_meta($id_of_order, '_billing_country', true) != "GR") ) {
     513                                                                $modified_homepage = str_replace('<div class="information left">', '<div class="information left" style="height: 120px">', $homepage);
     514                                                                $modified_homepage = str_replace('<div class="information right">', '<div class="information right" style="height: 160px">', $homepage);
     515                                                            }
     516                                                            if ( get_post_meta($id_of_order, '_billing_country', true) != "GR") {
     517                                                                $modified_homepage = str_replace('<tr><p class="table_titles">CUSTOMER INFORMATION</p>', '<tr><td colspan="2" style="text-align: center;"><p class="table_titles" style="white-space: nowrap; text-align: center;">CUSTOMER INFORMATION</p></td></tr><tr>',$modified_homepage);
     518                                                                $modified_homepage = str_replace('<tr><p class="table_titles">OTHER INFORMATION</p>', '<tr><td colspan="2" style="text-align: center;"><p class="table_titles">OTHER INFORMATION</p></td></tr><tr>',$modified_homepage);
     519                                                            } else {
     520                                                                $modified_homepage = str_replace('<tr><p class="table_titles">ΣΤΟΙΧΕΙΑ ΠΕΛΑΤΗ</p>', '<tr><td colspan="2" style="text-align: center;"><p class="table_titles" style="white-space: nowrap; text-align: center;">ΣΤΟΙΧΕΙΑ ΠΕΛΑΤΗ</p></td></tr><tr>',$modified_homepage);
     521                                                                $modified_homepage = str_replace('<tr><p class="table_titles">ΛΟΙΠΑ ΣΤΟΙΧΕΙΑ</p>', '<tr><td colspan="2" style="text-align: center;"><p class="table_titles">ΛΟΙΠΑ ΣΤΟΙΧΕΙΑ</p></td></tr><tr>',$modified_homepage);
     522                                                            }
     523                                                            $modified_homepage = str_replace('body { font-family: DejaVu Sans, sans-serif; }', '', $modified_homepage);
     524                                                            $modified_homepage = str_replace('<body>', '<body style="font-family: \'DejaVu Sans\', sans-serif;">', $modified_homepage);
    525525                                                            $dompdf = new Dompdf();
    526526                                                            $options = $dompdf->getOptions();
  • primer-mydata/trunk/includes/vendor/composer.json

    r2937024 r2939391  
    11{
    22    "require": {
    3         "chillerlan/php-qrcode": "^4.3"
     3        "chillerlan/php-qrcode": "^4.3",
     4        "dompdf/dompdf": "^2.0"
    45    }
    56}
  • primer-mydata/trunk/includes/vendor/composer.lock

    r2937024 r2939391  
    55        "This file is @generated automatically"
    66    ],
    7     "content-hash": "00ef37448ccf3265fe3336495a293603",
     7    "content-hash": "7a789d08404bb255d306192d607b1a96",
    88    "packages": [
    99        {
     
    140140            ],
    141141            "time": "2022-07-05T22:32:14+00:00"
     142        },
     143        {
     144            "name": "dompdf/dompdf",
     145            "version": "v2.0.3",
     146            "source": {
     147                "type": "git",
     148                "url": "https://github.com/dompdf/dompdf.git",
     149                "reference": "e8d2d5e37e8b0b30f0732a011295ab80680d7e85"
     150            },
     151            "dist": {
     152                "type": "zip",
     153                "url": "https://api.github.com/repos/dompdf/dompdf/zipball/e8d2d5e37e8b0b30f0732a011295ab80680d7e85",
     154                "reference": "e8d2d5e37e8b0b30f0732a011295ab80680d7e85",
     155                "shasum": ""
     156            },
     157            "require": {
     158                "ext-dom": "*",
     159                "ext-mbstring": "*",
     160                "masterminds/html5": "^2.0",
     161                "phenx/php-font-lib": ">=0.5.4 <1.0.0",
     162                "phenx/php-svg-lib": ">=0.3.3 <1.0.0",
     163                "php": "^7.1 || ^8.0"
     164            },
     165            "require-dev": {
     166                "ext-json": "*",
     167                "ext-zip": "*",
     168                "mockery/mockery": "^1.3",
     169                "phpunit/phpunit": "^7.5 || ^8 || ^9",
     170                "squizlabs/php_codesniffer": "^3.5"
     171            },
     172            "suggest": {
     173                "ext-gd": "Needed to process images",
     174                "ext-gmagick": "Improves image processing performance",
     175                "ext-imagick": "Improves image processing performance",
     176                "ext-zlib": "Needed for pdf stream compression"
     177            },
     178            "type": "library",
     179            "autoload": {
     180                "psr-4": {
     181                    "Dompdf\\": "src/"
     182                },
     183                "classmap": [
     184                    "lib/"
     185                ]
     186            },
     187            "notification-url": "https://packagist.org/downloads/",
     188            "license": [
     189                "LGPL-2.1"
     190            ],
     191            "authors": [
     192                {
     193                    "name": "The Dompdf Community",
     194                    "homepage": "https://github.com/dompdf/dompdf/blob/master/AUTHORS.md"
     195                }
     196            ],
     197            "description": "DOMPDF is a CSS 2.1 compliant HTML to PDF converter",
     198            "homepage": "https://github.com/dompdf/dompdf",
     199            "support": {
     200                "issues": "https://github.com/dompdf/dompdf/issues",
     201                "source": "https://github.com/dompdf/dompdf/tree/v2.0.3"
     202            },
     203            "time": "2023-02-07T12:51:48+00:00"
     204        },
     205        {
     206            "name": "masterminds/html5",
     207            "version": "2.8.0",
     208            "source": {
     209                "type": "git",
     210                "url": "https://github.com/Masterminds/html5-php.git",
     211                "reference": "3c5d5a56d56f48a1ca08a0670f0f80c1dad368f3"
     212            },
     213            "dist": {
     214                "type": "zip",
     215                "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/3c5d5a56d56f48a1ca08a0670f0f80c1dad368f3",
     216                "reference": "3c5d5a56d56f48a1ca08a0670f0f80c1dad368f3",
     217                "shasum": ""
     218            },
     219            "require": {
     220                "ext-dom": "*",
     221                "php": ">=5.3.0"
     222            },
     223            "require-dev": {
     224                "phpunit/phpunit": "^4.8.35 || ^5.7.21 || ^6 || ^7 || ^8"
     225            },
     226            "type": "library",
     227            "extra": {
     228                "branch-alias": {
     229                    "dev-master": "2.7-dev"
     230                }
     231            },
     232            "autoload": {
     233                "psr-4": {
     234                    "Masterminds\\": "src"
     235                }
     236            },
     237            "notification-url": "https://packagist.org/downloads/",
     238            "license": [
     239                "MIT"
     240            ],
     241            "authors": [
     242                {
     243                    "name": "Matt Butcher",
     244                    "email": "[email protected]"
     245                },
     246                {
     247                    "name": "Matt Farina",
     248                    "email": "[email protected]"
     249                },
     250                {
     251                    "name": "Asmir Mustafic",
     252                    "email": "[email protected]"
     253                }
     254            ],
     255            "description": "An HTML5 parser and serializer.",
     256            "homepage": "http://masterminds.github.io/html5-php",
     257            "keywords": [
     258                "HTML5",
     259                "dom",
     260                "html",
     261                "parser",
     262                "querypath",
     263                "serializer",
     264                "xml"
     265            ],
     266            "support": {
     267                "issues": "https://github.com/Masterminds/html5-php/issues",
     268                "source": "https://github.com/Masterminds/html5-php/tree/2.8.0"
     269            },
     270            "time": "2023-04-26T07:27:39+00:00"
     271        },
     272        {
     273            "name": "phenx/php-font-lib",
     274            "version": "0.5.4",
     275            "source": {
     276                "type": "git",
     277                "url": "https://github.com/dompdf/php-font-lib.git",
     278                "reference": "dd448ad1ce34c63d09baccd05415e361300c35b4"
     279            },
     280            "dist": {
     281                "type": "zip",
     282                "url": "https://api.github.com/repos/dompdf/php-font-lib/zipball/dd448ad1ce34c63d09baccd05415e361300c35b4",
     283                "reference": "dd448ad1ce34c63d09baccd05415e361300c35b4",
     284                "shasum": ""
     285            },
     286            "require": {
     287                "ext-mbstring": "*"
     288            },
     289            "require-dev": {
     290                "symfony/phpunit-bridge": "^3 || ^4 || ^5"
     291            },
     292            "type": "library",
     293            "autoload": {
     294                "psr-4": {
     295                    "FontLib\\": "src/FontLib"
     296                }
     297            },
     298            "notification-url": "https://packagist.org/downloads/",
     299            "license": [
     300                "LGPL-3.0"
     301            ],
     302            "authors": [
     303                {
     304                    "name": "Fabien Ménager",
     305                    "email": "[email protected]"
     306                }
     307            ],
     308            "description": "A library to read, parse, export and make subsets of different types of font files.",
     309            "homepage": "https://github.com/PhenX/php-font-lib",
     310            "support": {
     311                "issues": "https://github.com/dompdf/php-font-lib/issues",
     312                "source": "https://github.com/dompdf/php-font-lib/tree/0.5.4"
     313            },
     314            "time": "2021-12-17T19:44:54+00:00"
     315        },
     316        {
     317            "name": "phenx/php-svg-lib",
     318            "version": "0.5.0",
     319            "source": {
     320                "type": "git",
     321                "url": "https://github.com/dompdf/php-svg-lib.git",
     322                "reference": "76876c6cf3080bcb6f249d7d59705108166a6685"
     323            },
     324            "dist": {
     325                "type": "zip",
     326                "url": "https://api.github.com/repos/dompdf/php-svg-lib/zipball/76876c6cf3080bcb6f249d7d59705108166a6685",
     327                "reference": "76876c6cf3080bcb6f249d7d59705108166a6685",
     328                "shasum": ""
     329            },
     330            "require": {
     331                "ext-mbstring": "*",
     332                "php": "^7.1 || ^8.0",
     333                "sabberworm/php-css-parser": "^8.4"
     334            },
     335            "require-dev": {
     336                "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5"
     337            },
     338            "type": "library",
     339            "autoload": {
     340                "psr-4": {
     341                    "Svg\\": "src/Svg"
     342                }
     343            },
     344            "notification-url": "https://packagist.org/downloads/",
     345            "license": [
     346                "LGPL-3.0"
     347            ],
     348            "authors": [
     349                {
     350                    "name": "Fabien Ménager",
     351                    "email": "[email protected]"
     352                }
     353            ],
     354            "description": "A library to read, parse and export to PDF SVG files.",
     355            "homepage": "https://github.com/PhenX/php-svg-lib",
     356            "support": {
     357                "issues": "https://github.com/dompdf/php-svg-lib/issues",
     358                "source": "https://github.com/dompdf/php-svg-lib/tree/0.5.0"
     359            },
     360            "time": "2022-09-06T12:16:56+00:00"
     361        },
     362        {
     363            "name": "sabberworm/php-css-parser",
     364            "version": "8.4.0",
     365            "source": {
     366                "type": "git",
     367                "url": "https://github.com/sabberworm/PHP-CSS-Parser.git",
     368                "reference": "e41d2140031d533348b2192a83f02d8dd8a71d30"
     369            },
     370            "dist": {
     371                "type": "zip",
     372                "url": "https://api.github.com/repos/sabberworm/PHP-CSS-Parser/zipball/e41d2140031d533348b2192a83f02d8dd8a71d30",
     373                "reference": "e41d2140031d533348b2192a83f02d8dd8a71d30",
     374                "shasum": ""
     375            },
     376            "require": {
     377                "ext-iconv": "*",
     378                "php": ">=5.6.20"
     379            },
     380            "require-dev": {
     381                "codacy/coverage": "^1.4",
     382                "phpunit/phpunit": "^4.8.36"
     383            },
     384            "suggest": {
     385                "ext-mbstring": "for parsing UTF-8 CSS"
     386            },
     387            "type": "library",
     388            "autoload": {
     389                "psr-4": {
     390                    "Sabberworm\\CSS\\": "src/"
     391                }
     392            },
     393            "notification-url": "https://packagist.org/downloads/",
     394            "license": [
     395                "MIT"
     396            ],
     397            "authors": [
     398                {
     399                    "name": "Raphael Schweikert"
     400                }
     401            ],
     402            "description": "Parser for CSS Files written in PHP",
     403            "homepage": "https://www.sabberworm.com/blog/2010/6/10/php-css-parser",
     404            "keywords": [
     405                "css",
     406                "parser",
     407                "stylesheet"
     408            ],
     409            "support": {
     410                "issues": "https://github.com/sabberworm/PHP-CSS-Parser/issues",
     411                "source": "https://github.com/sabberworm/PHP-CSS-Parser/tree/8.4.0"
     412            },
     413            "time": "2021-12-11T13:40:54+00:00"
    142414        }
    143415    ],
     
    150422    "platform": [],
    151423    "platform-dev": [],
    152     "plugin-api-version": "1.1.0"
     424    "plugin-api-version": "2.2.0"
    153425}
  • primer-mydata/trunk/primer.php

    r2937024 r2939391  
    1818 * Plugin URI:        primer.gr/plugin/
    1919 * Description:      Issue receipts and invoices with woocommerce.
    20  * Version:           4.0.2
     20 * Version:           4.0.3
    2121 * Author:            Primer Software
    2222 * Author URI:        primer.gr
     
    3636 * Rename this for your plugin and update it as you release new versions.
    3737 */
    38 define( 'PRIMER_VERSION', '4.0.2');
     38define( 'PRIMER_VERSION', '4.0.3');
    3939define( 'PRIMER_NAME', 'Primer MyData' );
    4040
  • primer-mydata/trunk/views/get_receipt_list.php

    r2937024 r2939391  
    8888                    'receipt_hour' => get_the_time(),
    8989                    'receipt_client' => $invoice_client,
    90                     'receipt_product' => get_post_meta(get_the_ID(), 'receipt_product', true),
     90                    //'receipt_product' => get_post_meta(get_the_ID(), 'receipt_product', true),
    9191                    'receipt_price' => get_post_meta(get_the_ID(), 'receipt_price', true),
    9292                    'receipt_status' => $receipt_status_text,
     
    120120            if (empty($customer_full_name) && !empty($order_id)) {
    121121                $order = wc_get_order($order_id);
    122                 $billing_data = $order->get_billing();
    123                 $order_user_first_name = isset($billing_data['first_name']) ? $billing_data['first_name'] : '';
    124                 $order_user_last_name = isset($billing_data['last_name']) ? $billing_data['last_name'] : '';
     122                $order_user_first_name = $order->get_billing_first_name();
     123                $order_user_last_name = $order->get_billing_last_name();
    125124                $customer_full_name = $order_user_first_name . ' ' . $order_user_last_name;
    126125            }
     
    228227            );
    229228        }
     229        $i = 0;
     230        if ( ! empty( $search_term ) ) {
     231            // $receipt_args['order_id_to_receipt'] = array(intval(sanitize_text_field( wp_unslash( $_GET['s'] ))));
     232            $receipt_args['meta_query'][$i + 1]['relation'] = 'OR';
     233            $receipt_args['meta_query'][$i + 1][] = [
     234                'key' => 'order_id_to_receipt',
     235                'value' => array(intval(sanitize_text_field( wp_unslash( $_GET['s'] )))),
     236                'compare' => 'IN'];
     237            $receipt_args['meta_query'][$i + 1][] = [
     238                'key' => '_primer_receipt_number',
     239                'value' => array(intval(sanitize_text_field( wp_unslash( $_GET['s'] )))),
     240                'compare' => 'IN'];
     241
     242        }
    230243
    231244        if (!empty($search_term)) {
    232             $receipt_args['meta_query']['relation'] = 'OR';
    233             $receipt_args_total['meta_query']['relation'] = 'OR';
    234             $receipt_args['meta_query'][] = array(
     245            $receipt_args_total['meta_query'][$i + 1]['relation'] = 'OR';
     246            $receipt_args_total['meta_query'][$i + 1][] = array(
    235247                'key' => 'order_id_to_receipt',
    236                 'value' => intval($search_term),
    237                 'compare' => '=',
    238                 'type' => 'NUMERIC',
    239             );
    240             $receipt_args_total['meta_query'][] = array(
    241                 'key' => 'order_id_to_receipt',
    242                 'value' => intval($search_term),
    243                 'compare' => '=',
    244                 'type' => 'NUMERIC',
    245             );
    246             $receipt_args['meta_query'][] = array(
     248                'value' => array(intval(sanitize_text_field(wp_unslash($_GET['s'])))),
     249                'compare' => 'IN',
     250            );
     251            $receipt_args_total['meta_query'][$i + 1][] = array(
    247252                'key' => '_primer_receipt_number',
    248                 'value' => intval($search_term),
    249                 'compare' => '=',
    250                 'type' => 'NUMERIC',
    251             );
    252             $receipt_args_total['meta_query'][] = array(
    253                 'key' => '_primer_receipt_number',
    254                 'value' => intval($search_term),
    255                 'compare' => '=',
    256                 'type' => 'NUMERIC',
     253                'value' => array(intval(sanitize_text_field(wp_unslash($_GET['s'])))),
     254                'compare' => 'IN',
    257255            );
    258256        }
Note: See TracChangeset for help on using the changeset viewer.