From 08be751aa490ba9fb71bd8f39213d6767c87fe35 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 18 Feb 2019 12:02:56 +0200 Subject: [PATCH] Hide report export to PDF option --- composer.json | 2 +- composer.lock | 148 +++--------------- .../views/reports/report_builder.blade.php | 4 +- 3 files changed, 22 insertions(+), 132 deletions(-) diff --git a/composer.json b/composer.json index 05458d0b4671..63c96f2591e8 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "collizo4sky/omnipay-wepay": "dev-address-fix", "digitickets/omnipay-gocardlessv2": "dev-payment-fix", "doctrine/dbal": "2.5.x", - "dompdf/dompdf": "^0.8.3", + "dompdf/dompdf": "0.6.2", "ezyang/htmlpurifier": "~v4.7", "fzaninotto/faker": "^1.5", "google/apiclient": "^2.0", diff --git a/composer.lock b/composer.lock index f4ba7780a884..f5acbfdbd2d3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2d701891d83e5881ea89c2a9270a71aa", + "content-hash": "a7cf7307a3be07f3619d7a274952c03d", "packages": [ { "name": "abdala/omnipay-pagseguro", @@ -2272,51 +2272,30 @@ }, { "name": "dompdf/dompdf", - "version": "v0.8.3", + "version": "v0.6.2", "source": { "type": "git", "url": "https://github.com/dompdf/dompdf.git", - "reference": "75f13c700009be21a1965dc2c5b68a8708c22ba2" + "reference": "cc06008f75262510ee135b8cbb14e333a309f651" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dompdf/dompdf/zipball/75f13c700009be21a1965dc2c5b68a8708c22ba2", - "reference": "75f13c700009be21a1965dc2c5b68a8708c22ba2", + "url": "https://api.github.com/repos/dompdf/dompdf/zipball/cc06008f75262510ee135b8cbb14e333a309f651", + "reference": "cc06008f75262510ee135b8cbb14e333a309f651", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-mbstring": "*", - "phenx/php-font-lib": "0.5.*", - "phenx/php-svg-lib": "0.3.*", - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8|^5.5|^6.5", - "squizlabs/php_codesniffer": "2.*" - }, - "suggest": { - "ext-gd": "Needed to process images", - "ext-gmagick": "Improves image processing performance", - "ext-imagick": "Improves image processing performance" + "phenx/php-font-lib": "0.2.*" }, "type": "library", - "extra": { - "branch-alias": { - "dev-develop": "0.7-dev" - } - }, "autoload": { - "psr-4": { - "Dompdf\\": "src/" - }, "classmap": [ - "lib/" + "include/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL-2.1" + "LGPL" ], "authors": [ { @@ -2326,15 +2305,11 @@ { "name": "Brian Sweeney", "email": "eclecticgeek@gmail.com" - }, - { - "name": "Gabriel Bull", - "email": "me@gabrielbull.com" } ], "description": "DOMPDF is a CSS 2.1 compliant HTML to PDF converter", "homepage": "https://github.com/dompdf/dompdf", - "time": "2018-12-14T02:40:31+00:00" + "time": "2015-12-07T04:07:13+00:00" }, { "name": "erusev/parsedown", @@ -7719,30 +7694,27 @@ }, { "name": "phenx/php-font-lib", - "version": "0.5.1", + "version": "0.2.2", "source": { "type": "git", "url": "https://github.com/PhenX/php-font-lib.git", - "reference": "760148820110a1ae0936e5cc35851e25a938bc97" + "reference": "c30c7fc00a6b0d863e9bb4c5d5dd015298b2dc82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PhenX/php-font-lib/zipball/760148820110a1ae0936e5cc35851e25a938bc97", - "reference": "760148820110a1ae0936e5cc35851e25a938bc97", + "url": "https://api.github.com/repos/PhenX/php-font-lib/zipball/c30c7fc00a6b0d863e9bb4c5d5dd015298b2dc82", + "reference": "c30c7fc00a6b0d863e9bb4c5d5dd015298b2dc82", "shasum": "" }, - "require-dev": { - "phpunit/phpunit": "^4.8" - }, "type": "library", "autoload": { - "psr-4": { - "FontLib\\": "src/FontLib" - } + "classmap": [ + "classes/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL-3.0" + "LGPL" ], "authors": [ { @@ -7752,47 +7724,7 @@ ], "description": "A library to read, parse, export and make subsets of different types of font files.", "homepage": "https://github.com/PhenX/php-font-lib", - "time": "2017-09-13T16:14:37+00:00" - }, - { - "name": "phenx/php-svg-lib", - "version": "v0.3.2", - "source": { - "type": "git", - "url": "https://github.com/PhenX/php-svg-lib.git", - "reference": "ccc46ef6340d4b8a4a68047e68d8501ea961442c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PhenX/php-svg-lib/zipball/ccc46ef6340d4b8a4a68047e68d8501ea961442c", - "reference": "ccc46ef6340d4b8a4a68047e68d8501ea961442c", - "shasum": "" - }, - "require": { - "sabberworm/php-css-parser": "8.1.*" - }, - "require-dev": { - "phpunit/phpunit": "~5.0" - }, - "type": "library", - "autoload": { - "psr-0": { - "Svg\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-3.0" - ], - "authors": [ - { - "name": "Fabien Ménager", - "email": "fabien.menager@gmail.com" - } - ], - "description": "A library to read, parse and export to PDF SVG files.", - "homepage": "https://github.com/PhenX/php-svg-lib", - "time": "2018-06-03T10:10:03+00:00" + "time": "2014-02-01T15:22:28+00:00" }, { "name": "phpoffice/phpexcel", @@ -8727,50 +8659,6 @@ "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", "time": "2018-03-07T15:45:44+00:00" }, - { - "name": "sabberworm/php-css-parser", - "version": "8.1.0", - "source": { - "type": "git", - "url": "https://github.com/sabberworm/PHP-CSS-Parser.git", - "reference": "850cbbcbe7fbb155387a151ea562897a67e242ef" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sabberworm/PHP-CSS-Parser/zipball/850cbbcbe7fbb155387a151ea562897a67e242ef", - "reference": "850cbbcbe7fbb155387a151ea562897a67e242ef", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "*" - }, - "type": "library", - "autoload": { - "psr-0": { - "Sabberworm\\CSS": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Raphael Schweikert" - } - ], - "description": "Parser for CSS Files written in PHP", - "homepage": "http://www.sabberworm.com/blog/2010/6/10/php-css-parser", - "keywords": [ - "css", - "parser", - "stylesheet" - ], - "time": "2016-07-19T19:14:21+00:00" - }, { "name": "sabre/uri", "version": "2.1.1", diff --git a/resources/views/reports/report_builder.blade.php b/resources/views/reports/report_builder.blade.php index 258366c486ba..0e6bfdd58f62 100644 --- a/resources/views/reports/report_builder.blade.php +++ b/resources/views/reports/report_builder.blade.php @@ -585,7 +585,9 @@ var options = [ new ExportFormatModel('csv', 'CSV'), new ExportFormatModel('xlsx', 'XLSX'), - new ExportFormatModel('pdf', 'PDF'), + @if (Utils::isSelfhost()) + new ExportFormatModel('pdf', 'PDF'), + @endif ] if (['{{ ENTITY_INVOICE }}', '{{ ENTITY_QUOTE }}', '{{ ENTITY_EXPENSE }}', '{{ ENTITY_DOCUMENT }}'].indexOf(self.report_type()) >= 0) {