diff --git a/VERSION.txt b/VERSION.txt index 2ae3c8ec4905..df6132c03556 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.3.73 \ No newline at end of file +5.3.74 \ No newline at end of file diff --git a/app/Console/Commands/PostUpdate.php b/app/Console/Commands/PostUpdate.php index e2d27b23b8e1..7c62f31caa1d 100644 --- a/app/Console/Commands/PostUpdate.php +++ b/app/Console/Commands/PostUpdate.php @@ -54,7 +54,7 @@ class PostUpdate extends Command $output = []; - exec('vendor/bin/composer install --no-dev -o', $output); + // exec('vendor/bin/composer install --no-dev -o', $output); info(print_r($output,1)); info("finished running composer install "); diff --git a/app/Http/Controllers/SelfUpdateController.php b/app/Http/Controllers/SelfUpdateController.php index 62a5e5f9c51a..98d68777a894 100644 --- a/app/Http/Controllers/SelfUpdateController.php +++ b/app/Http/Controllers/SelfUpdateController.php @@ -15,6 +15,7 @@ use App\Exceptions\FilePermissionsFailure; use App\Utils\Ninja; use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Support\Facades\Artisan; +use Illuminate\Support\Facades\Storage; class SelfUpdateController extends BaseController { @@ -53,8 +54,43 @@ class SelfUpdateController extends BaseController * ), * ) */ - public function update(\Codedge\Updater\UpdaterManager $updater) + // public function old_update(\Codedge\Updater\UpdaterManager $updater) + // { + // set_time_limit(0); + // define('STDIN', fopen('php://stdin', 'r')); + + // if (Ninja::isHosted()) { + // return response()->json(['message' => ctrans('texts.self_update_not_available')], 403); + // } + + // $this->testWritable(); + + // // Get the new version available + // $versionAvailable = $updater->source()->getVersionAvailable(); + + // // Create a release + // $release = $updater->source()->fetch($versionAvailable); + + // $updater->source()->update($release); + + + // $cacheCompiled = base_path('bootstrap/cache/compiled.php'); + // if (file_exists($cacheCompiled)) { unlink ($cacheCompiled); } + // $cacheServices = base_path('bootstrap/cache/services.php'); + // if (file_exists($cacheServices)) { unlink ($cacheServices); } + + // Artisan::call('clear-compiled'); + // Artisan::call('route:clear'); + // Artisan::call('view:clear'); + // Artisan::call('optimize'); + + // return response()->json(['message' => 'Update completed'], 200); + + // } + + public function update() { + set_time_limit(0); define('STDIN', fopen('php://stdin', 'r')); @@ -64,15 +100,22 @@ class SelfUpdateController extends BaseController $this->testWritable(); - // Get the new version available - $versionAvailable = $updater->source()->getVersionAvailable(); + $contents = file_get_contents($this->getDownloadUrl()); - // Create a release - $release = $updater->source()->fetch($versionAvailable); + Storage::disk('local')->put('invoiceninja.zip', $contents); - $updater->source()->update($release); + $file = Storage::disk('local')->path('invoiceninja.zip'); + + $zipFile = new \PhpZip\ZipFile(); + + $zipFile->openFile($file); + + $zipFile->extractTo(base_path()); + + $zipFile->close(); + + unlink($file); - $cacheCompiled = base_path('bootstrap/cache/compiled.php'); if (file_exists($cacheCompiled)) { unlink ($cacheCompiled); } $cacheServices = base_path('bootstrap/cache/services.php'); @@ -81,10 +124,12 @@ class SelfUpdateController extends BaseController Artisan::call('clear-compiled'); Artisan::call('route:clear'); Artisan::call('view:clear'); + Artisan::call('migrate', ['--force' => true]); Artisan::call('optimize'); return response()->json(['message' => 'Update completed'], 200); + } private function testWritable() @@ -113,4 +158,11 @@ class SelfUpdateController extends BaseController { return trim(file_get_contents(config('ninja.version_url'))); } + + private function getDownloadUrl() + { + $version = $this->checkVersion(); + + return "https://github.com/invoiceninja/invoiceninja/releases/download/v{$version}/invoiceninja.zip"; + } } diff --git a/composer.json b/composer.json index 9d6a0aa36836..9ba53b9158d1 100644 --- a/composer.json +++ b/composer.json @@ -40,8 +40,6 @@ "checkout/checkout-sdk-php": "^1.0", "cleverit/ubl_invoice": "^1.3", "coconutcraig/laravel-postmark": "^2.10", - "codedge/laravel-selfupdater": "^3.2", - "composer/composer": "^2", "doctrine/dbal": "^3.0", "eway/eway-rapid-php": "^1.3", "fakerphp/faker": "^1.14", diff --git a/config/ninja.php b/config/ninja.php index 6c382ba011c8..27362231cfff 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -14,8 +14,8 @@ return [ 'require_https' => env('REQUIRE_HTTPS', true), 'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'), - 'app_version' => '5.3.73', - 'app_tag' => '5.3.73', + 'app_version' => '5.3.74', + 'app_tag' => '5.3.74', 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', ''), diff --git a/resources/views/pdf-designs/bold.html b/resources/views/pdf-designs/bold.html index ddbf71e194bb..d648ae8fc87b 100644 --- a/resources/views/pdf-designs/bold.html +++ b/resources/views/pdf-designs/bold.html @@ -22,6 +22,7 @@ @page { margin: 0 !important; + size: $page_size $page_layout; } p { @@ -159,7 +160,7 @@ } #table-totals { - margin-top: 1rem; + margin-top: 0rem; display: grid; grid-template-columns: 2fr 1fr; padding-top: .5rem; diff --git a/resources/views/pdf-designs/business.html b/resources/views/pdf-designs/business.html index dcc3206e82d7..2f6a42656729 100644 --- a/resources/views/pdf-designs/business.html +++ b/resources/views/pdf-designs/business.html @@ -7,6 +7,11 @@ --line-height: 1.6; } + html { + width: 210mm; + height: 200mm; + } + body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; @@ -20,6 +25,7 @@ margin-right: $global_margin; margin-top: 0; margin-bottom: 0; + size: $page_size $page_layout; } p { @@ -56,7 +62,7 @@ } .entity-issued-to { - margin-top: 3rem; + margin-top: 2rem; font-weight: bold; } @@ -161,7 +167,7 @@ } #table-totals { - margin-top: 1rem; + margin-top: 0.5rem; display: grid; grid-template-columns: 2fr 1fr; gap: 80px; @@ -253,7 +259,7 @@ .repeating-header-space, **/ .repeating-footer, .repeating-footer-space { - height: 160px; + height: 10px; } .repeating-header { position: fixed; diff --git a/resources/views/pdf-designs/clean.html b/resources/views/pdf-designs/clean.html index 0dc623d880a1..fe5109228a29 100644 --- a/resources/views/pdf-designs/clean.html +++ b/resources/views/pdf-designs/clean.html @@ -7,6 +7,11 @@ --line-height: 1.6; } + html { + width: 210mm; + height: 200mm; + } + body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; @@ -20,8 +25,10 @@ margin-right: $global_margin; margin-top: 0; margin-bottom: 0; + size: $page_size $page_layout; } + p { margin: 0; padding: 0; @@ -119,7 +126,7 @@ [data-ref="table"] > tbody > tr > td { border-top: 1px solid #d8d8d8; border-bottom: 1px solid #d8d8d8; - padding: 1.5rem 1rem; + padding: 1rem 1rem; } [data-ref="table"] > tbody > tr > td:first-child { @@ -191,7 +198,7 @@ } #footer { - margin-top: 30px; + margin-top: 10px; } /** Markdown-specific styles. **/ @@ -222,7 +229,7 @@ .repeating-header-space, **/ .repeating-footer, .repeating-footer-space { - height: 160px; + height: 10px; } .repeating-header { position: fixed; diff --git a/resources/views/pdf-designs/creative.html b/resources/views/pdf-designs/creative.html index dc017018bdac..49808d33f6e3 100644 --- a/resources/views/pdf-designs/creative.html +++ b/resources/views/pdf-designs/creative.html @@ -7,6 +7,11 @@ --line-height: 1.6; } + html { + width: 210mm; + height: 200mm; + } + body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; @@ -20,6 +25,7 @@ margin-right: $global_margin; margin-top: 0; margin-bottom: 0; + size: $page_size $page_layout; } p { @@ -206,7 +212,7 @@ .repeating-header-space, **/ .repeating-footer, .repeating-footer-space { - height: 160px; + height: 10px; } .repeating-header { position: fixed; diff --git a/resources/views/pdf-designs/elegant.html b/resources/views/pdf-designs/elegant.html index fc14396d245d..7795518238a1 100644 --- a/resources/views/pdf-designs/elegant.html +++ b/resources/views/pdf-designs/elegant.html @@ -7,6 +7,11 @@ --line-height: 1.6; } + html { + width: 210mm; + height: 200mm; + } + body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; @@ -17,6 +22,7 @@ @page { margin: $global_margin; + size: $page_size $page_layout; } p { @@ -211,7 +217,7 @@ .repeating-header-space, **/ .repeating-footer, .repeating-footer-space { - height: 160px; + height: 10px; } .repeating-header { position: fixed; diff --git a/resources/views/pdf-designs/hipster.html b/resources/views/pdf-designs/hipster.html index df4101e703d8..a6a54310cc1c 100644 --- a/resources/views/pdf-designs/hipster.html +++ b/resources/views/pdf-designs/hipster.html @@ -7,6 +7,11 @@ --line-height: 1.6; } + html { + width: 210mm; + height: 200mm; + } + body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; @@ -17,6 +22,7 @@ @page { margin: $global_margin; + size: $page_size $page_layout; } p { @@ -100,7 +106,7 @@ } [data-ref="table"] { - margin-top: 3rem; + margin-top: 1rem; /* margin-bottom: 200px; */ min-width: 100%; table-layout: fixed; diff --git a/resources/views/pdf-designs/modern.html b/resources/views/pdf-designs/modern.html index 0f31218c9042..da83b85bed89 100644 --- a/resources/views/pdf-designs/modern.html +++ b/resources/views/pdf-designs/modern.html @@ -6,6 +6,11 @@ --secondary-color: $secondary_color; } + html { + width: 210mm; + height: 200mm; + } + body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; @@ -21,6 +26,7 @@ @page { margin: 0 !important; + size: $page_size $page_layout; } p { diff --git a/resources/views/pdf-designs/plain.html b/resources/views/pdf-designs/plain.html index 6fad8938d517..2561aac89d7a 100644 --- a/resources/views/pdf-designs/plain.html +++ b/resources/views/pdf-designs/plain.html @@ -15,13 +15,17 @@ zoom: 80%; } + html { + width: 210mm; + height: 200mm; + } + @page { - position: absolute; - top: 0; margin-left: $global_margin; margin-right: $global_margin; margin-top: 0; margin-bottom: 0; + size: $page_size $page_layout; } @@ -200,7 +204,7 @@ .repeating-header-space, **/ .repeating-footer, .repeating-footer-space { - height: 100px; + height: 10px; } .repeating-header { position: fixed; diff --git a/resources/views/pdf-designs/playful.html b/resources/views/pdf-designs/playful.html index d8712983e3c9..6b3be643a5e0 100644 --- a/resources/views/pdf-designs/playful.html +++ b/resources/views/pdf-designs/playful.html @@ -15,10 +15,18 @@ zoom: 80%; } + html { + width: 210mm; + height: 200mm; + } + @page { margin: -0.25cm !important; + size: $page_size $page_layout; + margin-top: 1rem; } + p { margin: 0; padding: 0; @@ -28,12 +36,12 @@ display: flex; justify-content: space-between; gap: 20px; - padding: 2rem 3rem; + padding: 1rem 0rem 0rem 2rem; } .header-wrapper .entity-details-wrapper { background-color: var(--primary-color); - padding: 1rem; + padding: 0.5rem; border-radius: 10px; } @@ -61,7 +69,7 @@ display: grid; grid-template-columns: 1fr 1fr; gap: 40px; - padding: 3rem; + padding: 1rem 0rem 0rem 2rem; } .contacts-wrapper .contact-label { @@ -75,7 +83,7 @@ .contacts-wrapper #client-details { display: flex; flex-direction: column; - margin-bottom: 1rem; + margin-bottom: 0.5rem; } .contacts-wrapper .company-info { @@ -99,8 +107,8 @@ } [data-ref="table"] { - padding-left: 3rem; - padding-right: 3rem; + padding-left: 2rem; + padding-right: 0rem; margin-top: 1rem; /* margin-bottom: 200px; */ min-width: 100%; @@ -154,13 +162,12 @@ } #table-totals { - margin-top: 1rem; + margin-top: 0.5rem; display: grid; grid-template-columns: 2fr 1fr; gap: 80px; - padding-left: 3rem; - padding-right: 3rem; - margin-right: .75rem; + padding-left: 2rem; + padding-right: 0rem; page-break-inside:auto; overflow: visible !important; } @@ -220,12 +227,14 @@ [data-ref="total_table-footer"] { text-align: left; - padding-left: 3rem; - padding-right: 3rem; + padding-left: 2rem; + padding-right: rem; } #footer { margin-top: 1rem; + page-break-inside:auto; + overflow: visible !important; } /** Markdown-specific styles. **/ @@ -260,12 +269,15 @@ .repeating-header, .repeating-header-space { - height: 50px; + height: 20px; + page-break-inside:avoid; + page-break-before:avoid; + page-break-after:avoid; } .repeating-footer, .repeating-footer-space { - height: 160px; + height: 20px; } .repeating-header { position: fixed; @@ -377,7 +389,7 @@ $entity_images -