From 07cbe561bdf5777968736e686a0c1eb35cf21726 Mon Sep 17 00:00:00 2001 From: Marcus Hill Date: Sat, 19 Apr 2025 15:14:40 +0100 Subject: [PATCH 1/4] Add stupidly bigger update warning to update page. Add reminder note to check ITFlow backup (one in every ten page loads) --- admin_update.php | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/admin_update.php b/admin_update.php index 9f2df4fa..c1accee9 100644 --- a/admin_update.php +++ b/admin_update.php @@ -32,8 +32,11 @@ $git_log = shell_exec("git log $repo_branch..origin/$repo_branch --pretty=format CURRENT_DATABASE_VERSION) { ?> -
- Ensure you have a current app & database backup before updating! +
+

⚠️ DANGER ⚠️

+

Do NOT run updates without first taking a backup

+

VM Snapshots are highly recommended over other methods - see the docs. Review the changelog for breaking changes that may require manual remediation.

+

Ignore this warning at your own risk.


Update Database
@@ -46,9 +49,17 @@ $git_log = shell_exec("git log $repo_branch..origin/$repo_branch --pretty=format +
+

⚠️ DANGER ⚠️

+

Do NOT run updates without first taking a backup

+

VM Snapshots are highly recommended over other methods - see the docs. Review the changelog for breaking changes that may require manual remediation.

+

Ignore this warning at your own risk.

+
-
Update App
-
FORCE Update App
+
TEST
+ +
Update App
+
FORCE Update App

Application Release Version:

@@ -56,6 +67,17 @@ $git_log = shell_exec("git log $repo_branch..origin/$repo_branch --pretty=format

Code Commit:

You are up to date!
Everything is going to be alright


+ + +
+ + + Date: Sat, 19 Apr 2025 16:30:00 +0100 Subject: [PATCH 2/4] Update client pdf export - Fix HTML formatting for the cover div, other div styling is still broken - Adjust layout of cover info and add MSP logo - Add software purchase and expiry dates --- post/user/client.php | 45 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/post/user/client.php b/post/user/client.php index ff2c194e..8ff8812d 100644 --- a/post/user/client.php +++ b/post/user/client.php @@ -597,6 +597,15 @@ if (isset($_POST["export_client_pdf"])) { enforceUserPermission("module_sales", 1); enforceUserPermission("module_financial", 1); + $sql = mysqli_query($mysqli, "SELECT * FROM companies, settings WHERE companies.company_id = settings.company_id AND companies.company_id = 1"); + $row = mysqli_fetch_array($sql); + $company_name = nullable_htmlentities($row['company_name']); + $company_phone_country_code = nullable_htmlentities($row['company_phone_country_code']); + $company_phone = nullable_htmlentities(formatPhoneNumber($row['company_phone'], $company_phone_country_code)); + $company_email = nullable_htmlentities($row['company_email']); + $company_website = nullable_htmlentities($row['company_website']); + $company_logo = nullable_htmlentities($row['company_logo']); + $client_id = intval($_POST["client_id"]); $export_contacts = intval($_POST["export_contacts"]); $export_locations = intval($_POST["export_locations"]); @@ -604,7 +613,7 @@ if (isset($_POST["export_client_pdf"])) { $export_software = intval($_POST["export_software"]); $export_credentials = 0; if (lookupUserPermission("module_credential") >= 1) { - $export_credentials = intval($_POST["export_credentials"]); + $export_credentials = intval($_POST["export_credentials"] ?? 0); } $export_networks = intval($_POST["export_networks"]); $export_certificates = intval($_POST["export_certificates"]); @@ -747,6 +756,10 @@ if (isset($_POST["export_client_pdf"])) { $pdf->SetAuthor($session_company_name); $pdf->SetTitle("$client_name - IT Documentation"); + // TODO: Add page numbers to footer, but can't work out how to do it without the ugly line + // $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); + // $pdf->setFooterData(); + // Enable auto page breaks with a margin from the bottom $pdf->SetAutoPageBreak(true, 15); @@ -779,17 +792,27 @@ if (isset($_POST["export_client_pdf"])) { "; // Cover page section (for main content, not the TOC) + $html .= '
'; + if (!empty($company_logo)) { + $pdf->Image('uploads/settings/' . $company_logo, '', '', 35, 35, '', '', 'L', false, 300, '', false, false, 1, false, false, false); + } $html .= " -
-

$client_name

-

IT Documentation

-

Export Date: " . date("F j, Y") . "

+

IT Documentation

+

$client_name

+

Prepared by $session_name on " . date("F j, Y") . "

-
"; + "; + $html .= " +
+

$session_company_name

+ $company_phone
$company_email
+
+ "; // Client header information (non-table) $html .= "
+

$client_name

Address: $location_address

City State Zip: $location_city $location_state $location_zip

Phone: $contact_phone

@@ -1203,6 +1226,8 @@ if (isset($_POST["export_client_pdf"])) { Type License License Key + Purchase Date + Expiration Date Notes @@ -1212,6 +1237,8 @@ if (isset($_POST["export_client_pdf"])) { $software_type = nullable_htmlentities($row["software_type"]); $software_license_type = nullable_htmlentities($row["software_license_type"]); $software_key = nullable_htmlentities($row["software_key"]); + $software_purchase = nullable_htmlentities($row['software_purchase']); + $software_expire = nullable_htmlentities($row['software_expire']); $software_notes = nullable_htmlentities($row["software_notes"]); $html .= " @@ -1219,6 +1246,8 @@ if (isset($_POST["export_client_pdf"])) { $software_type $software_license_type $software_key + $software_purchase + $software_expire $software_notes "; } @@ -1326,7 +1355,7 @@ if (isset($_POST["export_client_pdf"])) { Domain Name - Expire + Expiration Date "; @@ -1383,4 +1412,4 @@ if (isset($_POST["export_client_pdf"])) { // Output the PDF document for download $pdf->Output(strtoAZaz09($client_name) . "-IT_Documentation-" . date("Y-m-d") . ".pdf", "D"); exit; -} \ No newline at end of file +} From f1a7b35aa6f1579d153c2176fb5ae6aebdf14e91 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Mon, 21 Apr 2025 17:00:32 -0400 Subject: [PATCH 3/4] Update Changelog and App Version fix date to --- CHANGELOG.md | 7 +++++++ includes/app_version.php | 2 +- includes/filter_header.php | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75c0a8c4..9e9c3a86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ This file documents all notable changes made to ITFlow. +## [25.03.6] + +### Fixed +- Set default to date to 2035-12-31 as 9999-12-31 and 2999-12-31 broke certain browsers. +- Update Client PDF Export, add header added company logo. +- Present Larger clearer Warning about updates on update page. + ## [25.03.5] ### Fixed diff --git a/includes/app_version.php b/includes/app_version.php index 30829180..c9868984 100644 --- a/includes/app_version.php +++ b/includes/app_version.php @@ -5,4 +5,4 @@ * Update this file each time we merge develop into master. Format is YY.MM (add a .v if there is more than one release a month. */ -DEFINE("APP_VERSION", "25.03.5"); +DEFINE("APP_VERSION", "25.03.6"); diff --git a/includes/filter_header.php b/includes/filter_header.php index 08e0cd39..1008ef2f 100644 --- a/includes/filter_header.php +++ b/includes/filter_header.php @@ -100,7 +100,7 @@ if ($_GET['canned_date'] == "custom" && !empty($_GET['dtf'])) { $dtt = date('Y-m-d', strtotime("last day of december last year")); } else { $dtf = "NULL"; - $dtt = '9999-12-31'; + $dtt = '2035-12-31'; } // Archived From b309081d75b248f6805922e87aa6b98a55cefffc Mon Sep 17 00:00:00 2001 From: johnnyq Date: Mon, 21 Apr 2025 17:16:35 -0400 Subject: [PATCH 4/4] Allow to search by project reference number --- CHANGELOG.md | 1 + projects.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e9c3a86..099c264e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ This file documents all notable changes made to ITFlow. - Set default to date to 2035-12-31 as 9999-12-31 and 2999-12-31 broke certain browsers. - Update Client PDF Export, add header added company logo. - Present Larger clearer Warning about updates on update page. +- Allow to search by project reference. ## [25.03.5] diff --git a/projects.php b/projects.php index b3a9efdd..114179b4 100644 --- a/projects.php +++ b/projects.php @@ -48,7 +48,7 @@ $sql_projects = mysqli_query( LEFT JOIN clients ON client_id = project_client_id LEFT JOIN users ON user_id = project_manager WHERE DATE(project_created_at) BETWEEN '$dtf' AND '$dtt' - AND (project_name LIKE '%$q%' OR project_description LIKE '%$q%' OR user_name LIKE '%$q%') + AND (CONCAT(project_prefix,project_number) LIKE '%$q%' OR project_name LIKE '%$q%' OR project_description LIKE '%$q%' OR user_name LIKE '%$q%') AND project_completed_at $status_query $project_permission_snippet AND project_$archive_query