Skip to content

Develop to Master 25.03.6 #1216

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

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.
- Allow to search by project reference.

## [25.03.5]

### Fixed
Expand Down
30 changes: 26 additions & 4 deletions admin_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@
<?php } ?>

<?php if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) { ?>
<div class="alert alert-warning">
<strong>Ensure you have a current <a href="https://docs.itflow.org/backups">app & database backup</a> before updating!</strong>
<div class="alert alert-danger">
<h1 class="font-weight-bold text-center">⚠️ DANGER ⚠️</h1>
<h2 class="font-weight-bold text-center">Do NOT run updates without first taking a backup</h2>
<p>VM Snapshots are highly recommended over other methods - see the <a href="https://docs.itflow.org/backups" class="alert-link" target="_blank">docs</a>. Review the <a href="https://github.com/itflow-org/itflow/blob/master/CHANGELOG.md" class="alert-link" target="_blank">changelog</a> for breaking changes that may require manual remediation.</p>
<p class="text-center font-weight-bold">Ignore this warning at your own risk.</p>
</div>
<br>
<a class="btn btn-dark btn-lg my-4" href="post.php?update_db"><i class="fas fa-fw fa-4x fa-download mb-1"></i><h5>Update Database</h5></a>
Expand All @@ -46,16 +49,35 @@

<?php } else {
if (!empty($git_log)) { ?>
<div class="alert alert-danger">
<h1 class="font-weight-bold text-center">⚠️ DANGER ⚠️</h1>
<h2 class="font-weight-bold text-center">Do NOT run updates without first taking a backup</h2>
<p>VM Snapshots are highly recommended over other methods - see the <a href="https://docs.itflow.org/backups" class="alert-link" target="_blank">docs</a>. Review the <a href="https://github.com/itflow-org/itflow/blob/master/CHANGELOG.md" class="alert-link" target="_blank">changelog</a> for breaking changes that may require manual remediation.</p>
<p class="text-center font-weight-bold">Ignore this warning at your own risk.</p>
</div>

<a class="btn btn-primary btn-lg my-4 confirm-link" href="post.php?no"><i class="fas fa-fw fa-4x fa-download mb-1"></i><h5>TEST</h5></a>

<a class="btn btn-primary btn-lg my-4" href="post.php?update"><i class="fas fa-fw fa-4x fa-download mb-1"></i><h5>Update App</h5></a>
<a class="btn btn-danger btn-lg" href="post.php?update&force_update=1"><i class="fas fa-fw fa-4x fa-hammer mb-1"></i><h5>FORCE Update App</h5></a>
<a class="btn btn-primary btn-lg my-4 confirm-link" href="post.php?update"><i class="fas fa-fw fa-4x fa-download mb-1"></i><h5>Update App</h5></a>
<a class="btn btn-danger btn-lg confirm-link" href="post.php?update&force_update=1"><i class="fas fa-fw fa-4x fa-hammer mb-1"></i><h5>FORCE Update App</h5></a>

<?php } else { ?>
<p><strong>Application Release Version:<br><strong class="text-dark"><?php echo APP_VERSION; ?></strong></p>
<p class="text-secondary">Database Version:<br><strong class="text-dark"><?php echo CURRENT_DATABASE_VERSION; ?></strong></p>
<p class="text-secondary">Code Commit:<br><strong class="text-dark"><?php echo $current_version; ?></strong></p>
<p class="text-muted">You are up to date!<br>Everything is going to be alright</p>
<i class="far fa-3x text-dark fa-smile-wink"></i><br>

<?php if (rand(1,10) == 1) { ?>
<br>
<div class="alert alert-info alert-dismissible fade show" role="alert">
You're up to date, but when was the last time you checked your ITFlow backup works?
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<?php } ?>

<?php }
}

Expand Down
2 changes: 1 addition & 1 deletion includes/app_version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");
2 changes: 1 addition & 1 deletion includes/filter_header.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
$dtt = date('Y-m-d', strtotime("last day of december last year"));
} else {
$dtf = "NULL";
$dtt = '9999-12-31';
$dtt = '2035-12-31';
}

// Archived
Expand Down
45 changes: 37 additions & 8 deletions post/user/client.php
Original file line number Diff line number Diff line change
Expand Up @@ -597,14 +597,23 @@
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"]);
$export_assets = intval($_POST["export_assets"]);
$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"]);
Expand Down Expand Up @@ -747,6 +756,10 @@
$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);

Expand Down Expand Up @@ -779,17 +792,27 @@
";

// Cover page section (for main content, not the TOC)
$html .= '<div class="cover">';
if (!empty($company_logo)) {
$pdf->Image('uploads/settings/' . $company_logo, '', '', 35, 35, '', '', 'L', false, 300, '', false, false, 1, false, false, false);
}
$html .= "
<div class='cover'>
<h1>$client_name</h1>
<h2>IT Documentation</h2>
<p>Export Date: " . date("F j, Y") . "</p>
<h1>IT Documentation</h1>
<h2>$client_name</h2>
<h4>Prepared by $session_name on " . date("F j, Y") . "</h4>
</div>
<hr>";
";
$html .= "
<br>
<h4>$session_company_name</h4>
$company_phone<br>$company_email<br>
<hr>
";

// Client header information (non-table)
$html .= "
<div class='client-header'>
<h3>$client_name</h3>
<p><strong>Address:</strong> $location_address</p>
<p><strong>City State Zip:</strong> $location_city $location_state $location_zip</p>
<p><strong>Phone:</strong> $contact_phone</p>
Expand Down Expand Up @@ -1203,6 +1226,8 @@
<th>Type</th>
<th>License</th>
<th>License Key</th>
<th>Purchase Date</th>
<th>Expiration Date</th>
<th>Notes</th>
</tr>
</thead>
Expand All @@ -1212,13 +1237,17 @@
$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 .= "
<tr style='page-break-inside: avoid;'>
<td>$software_name</td>
<td>$software_type</td>
<td>$software_license_type</td>
<td>$software_key</td>
<td>$software_purchase</td>
<td>$software_expire</td>
<td>$software_notes</td>
</tr>";
}
Expand Down Expand Up @@ -1326,7 +1355,7 @@
<thead>
<tr>
<th>Domain Name</th>
<th>Expire</th>
<th>Expiration Date</th>
</tr>
</thead>
<tbody>";
Expand Down Expand Up @@ -1383,4 +1412,4 @@
// Output the PDF document for download
$pdf->Output(strtoAZaz09($client_name) . "-IT_Documentation-" . date("Y-m-d") . ".pdf", "D");
exit;
}
}
2 changes: 1 addition & 1 deletion projects.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
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
Expand Down