diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6e5a5a2fa..ff3afce87 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -130,6 +130,9 @@ If you are coming from 26.08 or earlier, the database update still has to be run
- Tickets: a closed ticket can no longer be changed, either from the ticket's windows or through the API. Merging is only offered between tickets of the same client.
- Client portal: primary and technical contacts' Tickets page now opens on everyone's tickets at their company, with Mine to see only their own. The separate All tickets page is gone, and links to it land on Tickets. A ticket shows the client where it stands - Received, In progress, Waiting on you, On hold, Resolved or Closed - rather than your ticket statuses.
- Client portal: invoices and quotes now open in the portal, where they used to open their guest link in a new tab. The links in your emails work as before. A quote answered in the portal records the contact's name and any note they left. Pay invoices pays the invoices ticked as one card payment, and the Pay drop-down on each invoice is gone (see Client portal).
+- Client portal: only the primary contact can add or change contacts now, and give or turn off their portal access. Technical contacts still see the contacts, but can no longer add or edit them. A primary contact can turn access back on for someone you turned off, and it is logged and notified when they do.
+- Client portal: turning off a contact's portal access, in ITFlow or in the portal, now signs them out at once. They used to stay signed in until their session ran out.
+- Client portal: Certificates is now a tab of Domains & certificates, and links to it land there. A contact who opens a page they can't use is taken home with a message, where they used to be signed out.
- Stripe: Refund on a Stripe payment now refunds that payment's amount, where it used to refund the whole card charge. A card payment from the client portal over several invoices is booked as a payment on each, so refund each invoice's part from that invoice. Stripe's fee for such a payment is recorded once, naming every invoice it paid.
- Invoicing a ticket:
- The invoice line now reads `Ticket TCK-123 - Subject - 10/14/2026`. It used to be a block of text with the agent, dates, contact, asset and time spent. You can still edit it before adding the line.
@@ -675,7 +678,7 @@ If you are coming from 26.08 or earlier, the database update still has to be run
- A cleared line's quick look says which statement it cleared on, and its Edit window keeps its amount, date and account as they are (see Breaking Changes, Accounts, transactions and transfers).
- Reconciling needs write access to Financial, and undoing a reconciled statement full access. Agents with read access can look at the statements.
- The demo data reconciles Operating Checking and the Business Visa to each month's statement through last month.
-- **Client portal** (rebuilt: the look, home, tickets and billing)
+- **Client portal** (rebuilt: the look, home, tickets, billing and Your IT)
- A new look: a light top bar with your logo, or your company's initials on your theme colour, and the sections the contact can open - Home, Tickets, Billing for billing contacts, Your IT for technical contacts, and your custom links - with New ticket and their account menu. On a phone the sections sit in a bar along the bottom and a menu that slides in. Contacts can switch to dark mode from their account menu, and it stays that way. The welcome banner along the top of every page is gone.
- Home shows what needs the contact first: tickets waiting on their reply or resolved for them to confirm, tasks waiting for their approval and invoices past due. Then their open tickets, what is owed with Pay invoices, the domains, certificates, licenses and warranties renewing in the next 45 days or lapsed in the last 30, the devices they use with any warranty that has run out or is about to, and your phone and email when they are set.
- Tickets has tabs for Open, Waiting on you, Resolved, Closed and All, each with its count, a search by subject or number, and 20 to a page. Primary and technical contacts see their whole company's, with who raised each, and Mine for their own.
@@ -691,7 +694,15 @@ If you are coming from 26.08 or earlier, the database update still has to be run
- Cards & autopay: the saved cards, with expired ones marked and the recurring invoices each one pays, adding a card in Stripe's form straight after agreeing to it, removing one, and autopay for each recurring invoice, all on one page.
- Home lists quotes waiting for an answer, and a past-due invoice opens that invoice. Ask us on an invoice, quote or recurring invoice starts a ticket with the subject filled in.
- Pay invoices and Cards & autopay only show when Stripe is set up. Without it, an invoice says to use the payment details on it.
- - The Your IT and account pages are in the new look and work as before. They are rebuilt in the stages to come.
+ - Devices has tabs by kind - Computers, Servers, Network, Phones & tablets and Other - each with its count, Everyone's or Mine, and a search by name, make, model, serial or who uses it. Each shows who uses it and where it is, with its warranty when it has run out or is about to.
+ - A device shows its make and model, serial, OS, who uses it, where it is, when it was bought and how old it is, its warranty, and its open tickets and licenses. Report a problem starts a ticket with the device picked, and Open goes to its link when it has one. Any contact can open the devices they use from Home.
+ - Licenses has tabs for All, Renewing soon (the next 30 days) and Expired, with how many seats are in use and when each renews. License keys are not shown.
+ - Domains & certificates: the domains with their registrar, DNS, web and mail hosts, when each expires and whether it renews by itself, and on its own tab the certificates with their domain, issuer and expiry.
+ - Documents lists the documents you share with the client, in tabs by folder, with a search that looks inside them. A document shows as written, with its tables and colours, and the files that came with it - a PDF or picture shown on the page, any file to open or download - ready to print, and Ask us about it starts a ticket. Primary and technical contacts can write a new document in the editor or upload a file (PDF, Word, OpenDocument, RTF or text), and you are notified of each.
+ - Contacts lists everyone at the company, the primary contact first, with their roles, and a search by name, email, title, department or phone.
+ - The primary contact manages their company's contacts: Add a person with their details, phone numbers and roles, and give them portal access with an emailed invite to set a password - or to sign in with Microsoft 365 when that is set up. A person's page shows whether they can sign in and when they last did, with Email the invite again, Turn off access and Left the company?, which turns off their access and starts an offboarding ticket. Each change is in the audit log, and you are notified when someone is added, given access, turned off or has left.
+ - Home: the renewals open the domain, certificate, license or device they are about, and each device opens its page.
+ - The account pages are in the new look and work as before. They are rebuilt next.
### Bug Fixes
@@ -761,6 +772,10 @@ If you are coming from 26.08 or earlier, the database update still has to be run
- Client Portal: on most pages the browser blocked the arrows on drop-downs, the close crosses and the editor setup, as the portal's security policy didn't allow them.
- Client Portal: paying an invoice with a saved card didn't check the contact had billing access, and couldn't pay a partly paid invoice. A double click could charge the card twice.
- Client Portal: the saved cards page asked Stripe about every card each time it opened, and showed an error instead of the cards when Stripe couldn't be reached. It started a Stripe checkout on every visit too, where it now starts one when Add a card is clicked.
+- Client Portal: a technical contact could change the primary contact's details, including the email they sign in with, by changing the edit form. Contacts can only be changed by the primary contact now, never their own record or another primary contact's, and only their own company's.
+- Client Portal: a contact whose portal access was turned off stayed signed in until their session ran out.
+- Client Portal: documents added in the portal recorded the contact as their author in place of their portal user, so ITFlow showed the wrong person or no one. An uploaded file's name went into its document unescaped.
+- Client Portal: a page turning a contact away after it had started could leave only the top bar on screen, as the redirect it fell back on was blocked by the portal's security policy.
- Client Portal: a ticket rating could be saved as any value. Only Good and Bad, the two buttons the portal shows, are accepted now. The demo data rated tickets Great and Ok, which the portal never offers, and now uses Good and Bad.
- Notifications that linked to a page did not open correctly from Admin pages.
- Messages showed a backslash before apostrophes and quotes in names, or showed `&` instead of `&`.
@@ -1090,6 +1105,13 @@ If you are coming from 26.08 or earlier, the database update still has to be run
- `includes/billing_paper.php` takes `client` to leave out the agent-only note on a seat line.
- `cron/nightly_tasks.php` reconciles Stripe fees by payment reference, so a card payment over several invoices gets one fee expense. `refund_payment_stripe` refunds the payment's amount.
- CSS: `.itflow-portal-amount`, `-big-amount`, `-state-late`, `-outcome`, `-note`, `-payrow`, `-paybox`, `-methods`, `-method`, `-paybar`, `-stripe-element`, `-card-brand`, `-aging`, `-table` and `-receipt`, and print rules that leave only the document.
+- Client portal Your IT:
+ - New pages: `client/asset.php` (`?id=`, within `portalAssetScopeSql()`, so a plain contact reaches the devices they use), `contact.php` (`?id=`, or `?new=1` for the primary contact) with its form in `client/includes/contact_form.php`, `document_add.php` (the editor, or `?upload=1` for a file) and `licenses.php` (`tab` `all`, `soon` or `expired`, and `q`). `assets.php` takes `tab` (`all`, `computers`, `servers`, `network`, `phones`, `other`), `scope=mine`, `q` and `page`; `domains.php` takes `tab=certificates`; `documents.php` takes `folder` (a folder's id, or 0 for those in none), `q` and `page`; `contacts.php` takes `q`. `certificates.php` redirects to `domains.php?tab=certificates`, and `contact_add.php` and `contact_edit.php` to `contact.php`. `ticket_add.php` takes `asset` to pick the device.
+ - `client/post.php`: `add_contact` and `edit_contact` are replaced by `portal_contact_save` (`contact_id`, 0 for new; the contact fields; `invite` and `method` for a new one), `portal_contact_access` (`contact_id`, `invite` or `off`, and `method`) and `portal_contact_left` (`contact_id`), all needing `contactCan('contacts_manage')` and refusing a primary contact or the contact's own record. A form that fails is kept in `$_SESSION['portal_contact_form']` for the page to fill back in. `client_add_document` and `client_upload_document` check `portalItGate()`, refuse a blank name or empty document, set `document_created_by` and `file_created_by` to the portal user and notify.
+ - `client/functions.php`: `contactCan('contacts_manage')` (the primary contact only), `portalItGate()` (primary or technical, and the module), `portalAssetScopeSql()`, `portalAssetGroups()`, `portalTile($icon, $size)`, `portalRenewalState($renewal, $active_label)`, `portalContactRoles($row)`, `portalContactAccess($row)` (`none`, `off`, `local` or `azure`, with a label, icon and class), `portalContactLastSignIn($user_id)`, `portalSignInMethods()`, `portalContactInvite($contact_id, $method, $by)` and `portalContactAccessOff($contact_id)`. The invite makes or turns back on the contact's portal user and, when email is set up, sends `login_reset.php`'s own set-password link, or the sign-in page for Microsoft 365. `enforceContactCan()` sends the contact home with a message rather than to logout.
+ - `client/includes/check_login.php` ends the session when the user has no sign-in method (`user_auth_method` not `local` or `azure`).
+ - `client/includes/header.php` starts output buffering, so a gate after `includes/inc_all.php` sends a real redirect. A page that sets `$portal_csp_inline_styles` before `includes/inc_all.php` gets `style-src 'self' 'unsafe-inline'` added to the portal's policy, for HTML from `documentHtmlPurify()`; `document.php` sets it.
+ - CSS: `.itflow-portal-tile` with `-sm` and `-lg` (the grey icon tiles), `.itflow-portal-roles`, `.itflow-portal-pdf` and `.itflow-portal-document`. The tiles in a list row are left off on phones.
- Empty states: every list page sets `$empty_state` before including `includes/filter_footer.php`, and `includes/inc_empty_state.php` draws it with `emptyStateHtml()` (`functions/format.php`) when the list has nothing - `thing`, `icon`, `title`, `text`, `actions` (`label`, `modal` or `href`, `size`, `icon`; the first is the main one), `archived`, `view`, `filtered`, `views`, `match_title`, `match_text` and `clear_url`. `emptyStateFiltered($views)` reads the GET string for a search or filter, leaving out paging, sorting, `client_id`, `archived` and the page's views, and `emptyStateClearUrl($views)` is the page without them. `emptyStatePill($pills, $key, $default, $good)` builds a pill's own state from the page's pill array (`label`, `icon`, `title`, `alarm`), with a tick for `alarm` pills and the keys in `$good`. Files, notifications and racks call `emptyStateHtml()` in their own layout; files and notifications set `$empty_state_skip`. A page that sets nothing still gets one, worded from `$page_title`. The pages' own empty blocks (`.itflow-asset-empty` under a list) are gone. CSS: `.itflow-empty-state` with `-icon` (a grey round tile), `-title`, `-text` and `-actions`.
- Removed unused helpers and files:
- `credentialLink()`, `projectLink()`, `linkCounts()`, `assetContactAvatar()` and `clientOverviewPersonInitials()`
diff --git a/client/asset.php b/client/asset.php
new file mode 100644
index 000000000..25faf5919
--- /dev/null
+++ b/client/asset.php
@@ -0,0 +1,149 @@
+
+ = $back[1] ?>
+
= escapeHtml(implode(' · ', array_filter([$asset['asset_type'], $what]))) ?>
+= escapeHtml($asset['asset_description']) ?>
+ += $mine ? 'The ones you use' : 'Everything we look after at ' . escapeHtml($session_client_name) ?>
| Name | -Type | -Model | -Serial | -Assigned | -Purchase | -Warranty | -Status | -URI | -
|---|---|---|---|---|---|---|---|---|
|
- = $asset_name ?>
- - = $asset_description ?> - |
- = $asset_type ?> | -= "$asset_make $asset_model" ?> |
- = $asset_serial ?> | -= $assigned_to ?> | -= $asset_purchase_date ?> | -= $asset_warranty_expire ?> | -= $asset_status ?> | -
-
- = truncate($asset_uri_client, 40) ?>
-
- -
+ |
-
| Certificate Name | -FQDN | -Issuer | -Expiry | -
|---|---|---|---|
| = $certificate_name ?> | -= $certificate_domain ?> | -= $certificate_issued_by ?> | -- = $certificate_expire ?: '-' ?> - - = $expiry['state'] === 'expired' ? 'Expired' : 'Expiring soon' ?> - - Renews automatically - - | -
Someone new at = escapeHtml($session_client_name) ?> - and whether they can sign in here
+= escapeHtml(implode(' · ', array_filter(array_merge([$contact['contact_title']], $roles)))) ?: 'Contact' ?>
+This is the company's primary contact - ask us to change who that is.
+ +Change your own phone numbers and sign-in in Your account.
+ +They can sign in here as = escapeHtml($contact['contact_email']) ?> and see = $contact['contact_technical'] ? 'every ticket at ' . escapeHtml($session_client_name) : 'the tickets they raise' ?>= $contact['contact_billing'] ? ', and the billing' : '' ?>.
+ + +Give them access and we email = escapeHtml($contact['contact_email'] ?: 'them') ?> a link to sign in.
+ + +We turn off their portal access now, and you tell us what else to close down - their email, accounts and devices - on a ticket.
+ +The people at = escapeHtml($session_client_name) ?>= $manage ? ', and who can sign in here' : '' ?>
| Name | -Roles | -|
|---|---|---|
| = $contact_name ?> | -= $contact_email ?> | -= $contact_roles_display ?> | -
- Type: = strtoupper($file_ext) ?> File
- Size: = $file_size_formatted ?>
-
$document_description
") { ?> -+ = trim((string) $document['document_description']) !== '' ? escapeHtml($document['document_description']) . ' · ' : '' ?> + = escapeHtml($document['folder_name']) ?> · + Updated = escapeHtml(date('M j, Y', strtotime($updated))) ?> +
+| Name | -Updated | -Actions | -
|---|---|---|
|
-
- = documentTile() ?>
-
-
- = $document_name ?>
-
-
- = $folder_name ?>
- ·
- = escapeHtml($row['document_description']) ?>
-
- |
- = date('M j, Y', strtotime($document_updated_at)) ?> | -- - - - | -
| Domain Name | -Expiry | -Renews automatically | -
|---|---|---|
| = $domain_name ?> | -- = $domain_expire ?: '-' ?> - - = escapeHtml($expiry['text']) ?> - - | -= intval($row['domain_auto_renew']) ? 'Yes' : 'No' ?> | -
Your domain names and the certificates that keep your sites secure
The software you are licensed for, and when it renews
+Uploaded file: $file_name
$document_description
"; - $document_content_raw = "$document_name $file_name $document_description"; - - mysqli_query($mysqli, "INSERT INTO documents SET - document_name = '$document_name', - document_description = '$document_description', - document_content = '$document_content', - document_content_raw = '$document_content_raw', - document_client_visible = 1, - document_client_id = $session_client_id, - document_created_by = $session_contact_id"); - - $document_id = mysqli_insert_id($mysqli); - - // Create file entry - mysqli_query($mysqli, "INSERT INTO files SET - file_reference_name = '$file_reference_name', - file_name = '$file_name', - file_description = 'Attached to document: $document_name', - file_ext = '$file_extension', - file_mime_type = '$file_mime_type', - file_size = $file_size, - file_created_by = $session_contact_id, - file_client_id = $session_client_id"); - - $file_id = mysqli_insert_id($mysqli); - - // Link file to document - mysqli_query($mysqli, "INSERT INTO document_files SET document_id = $document_id, file_id = $file_id"); - - logAudit("Document", "Upload", "Client contact $session_contact_name uploaded document $document_name with file $file_name", $session_client_id, $document_id); - - flashAlert("Document $document_name uploaded successfully"); - - } else { - flashAlert('Error uploading file. Please try again.', 'error'); - } - - } else { - flashAlert('Invalid file type. Please upload PDF, Word documents, or text files only.', 'error'); - } - - } else { - flashAlert('Please select a file to upload.', 'error'); + if (!move_uploaded_file($_FILES['document_file']['tmp_name'], "$client_dir/$file_reference_name")) { + flashAlert('Something went wrong uploading the file - please try again', 'error'); + redirect('document_add.php?upload=1'); } - redirect('documents.php'); + $original = (string) $_FILES['document_file']['name']; + $ext_parts = explode('.', $original); + $file_name = escapeSql($original); + $file_extension = escapeSql(strtolower(end($ext_parts))); + $file_mime_type = escapeSql($_FILES['document_file']['type']); + $file_size = intval($_FILES['document_file']['size']); + $document_name = escapeSql($name); + $document_description = escapeSql($description); + // What the document says is the file - its name and description, escaped for the page + $document_content = mysqli_real_escape_string($mysqli, 'Uploaded file: ' . escapeHtml($original) . '
' . ($description !== '' ? '' . escapeHtml($description) . '
' : '')); + $document_content_raw = escapeSql("$name $original $description"); + + mysqli_query($mysqli, "INSERT INTO documents SET + document_name = '$document_name', + document_description = '$document_description', + document_content = '$document_content', + document_content_raw = '$document_content_raw', + document_client_visible = 1, + document_client_id = $session_client_id, + document_created_by = $session_user_id"); + $document_id = mysqli_insert_id($mysqli); + + mysqli_query($mysqli, "INSERT INTO files SET + file_reference_name = '" . escapeSql($file_reference_name) . "', + file_name = '$file_name', + file_description = 'Attached to document: $document_name', + file_ext = '$file_extension', + file_mime_type = '$file_mime_type', + file_size = $file_size, + file_created_by = $session_user_id, + file_client_id = $session_client_id"); + $file_id = mysqli_insert_id($mysqli); + + mysqli_query($mysqli, "INSERT INTO document_files SET document_id = $document_id, file_id = $file_id"); + + logAudit("Document", "Upload", "Client contact $session_contact_name uploaded document $document_name with file $file_name in the client portal", $session_client_id, $document_id); + appNotify("Document", "$session_contact_name uploaded the document $document_name in the client portal", "/agent/document.php?document_id=$document_id", $session_client_id, $document_id); + + flashAlert("Document " . escapeHtml($name) . " uploaded"); + + redirect("document.php?id=$document_id"); } diff --git a/client/ticket_add.php b/client/ticket_add.php index c095ed774..bcc91863f 100644 --- a/client/ticket_add.php +++ b/client/ticket_add.php @@ -3,7 +3,8 @@ * Client Portal * New ticket - what's wrong, how much it is getting in the way, which device, * and any screenshots or files, with what happens next alongside. ?subject= - * fills the subject in - the Ask us links on invoices and quotes. + * fills the subject in - the Ask us links on invoices and quotes - and ?asset= + * picks the device, from Report a problem on a device's page. * * No Content-Security-Policy here: the editor needs inline styles. */ @@ -96,7 +97,7 @@ $company = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT company_phone, compa diff --git a/css/itflow_custom.css b/css/itflow_custom.css index 65a80b501..e3b7d046b 100644 --- a/css/itflow_custom.css +++ b/css/itflow_custom.css @@ -7456,6 +7456,68 @@ a.itflow-portal-todo:hover { font-size: .8rem; } +/* Your IT: a grey tile for each device, license, domain or document, the + roles on a contact, and a document as written */ +.itflow-portal-tile { + display: inline-flex; + flex: 0 0 auto; + align-items: center; + justify-content: center; + width: 2.5rem; + height: 2.5rem; + border-radius: var(--bs-border-radius-lg); + background-color: var(--bs-secondary-bg); + color: var(--bs-secondary-color); + font-size: 1rem; +} +.itflow-portal-tile-sm { + width: 2rem; + height: 2rem; + font-size: .85rem; +} +.itflow-portal-tile-lg { + width: 3.25rem; + height: 3.25rem; + font-size: 1.35rem; +} +.itflow-portal-roles { + display: inline-flex; + flex-wrap: wrap; + justify-content: flex-end; + gap: .25rem; +} +.itflow-portal-roles > span { + padding: .1rem .5rem; + border: 1px solid var(--bs-border-color); + border-radius: 2rem; + color: var(--bs-secondary-color); + font-size: .72rem; + font-weight: 600; + white-space: nowrap; +} +.itflow-portal-pdf { + display: block; + width: 100%; + height: 75vh; + border: 0; +} +.itflow-portal-document { + overflow-x: auto; + overflow-wrap: anywhere; +} +.itflow-portal-document img { + max-width: 100%; + height: auto; +} +.itflow-portal-document > :last-child { + margin-bottom: 0; +} +@media (max-width: 575.98px) { + .itflow-portal-ticket > .itflow-portal-tile { + display: none; + } +} + /* Printing an invoice, quote or receipt: the document and nothing round it */ @media print { .itflow-portal-header,