# Changelog This file documents all notable changes made to ITFlow. ## [26.11.9] ### Upgrading Update from Maintenance > Update — Queue Update hands the job to cron, which updates the files and applies this release's twenty-two database changes (3.6.6 to 3.8.8) in the same pass. They add four tables for RMM providers and their alerts, a setting for device actions and one for API keys in the address, a column marking the emails the mail queue clears once sent, a column and a table for agent banners, two columns for ticket statuses with a setting for the "ticket assigned" message, a column on tickets with a setting for the "no response" message, a table for who a ticket's email replies go to, the settings for Quick tickets, columns on recurring tickets and recurring invoices for booking and making them ahead, two columns on ticket replies for when their time was worked, the settings for cron alerts, a table and a setting for labor costs, a column on users for API / service accounts, columns on tickets and recurring tickets for how long booked work takes, a column each on recurring tickets and calendar events for repeating on a weekday, three columns on agents' settings for their calendar color, what their calendar shows and their own time zone, and a table for the agents helping on a ticket, three columns on quote lines with three settings for what a quote line costs and how it is priced, and a column each on quote lines and products with a setting for their pictures, and change nothing that is there. Nothing else is required. This release has eleven security fixes - see Security. On Apache, ITFlow's own .htaccess now sends security headers: if you show ITFlow inside a frame on another website, it will now refuse to load there. On nginx, add the same headers to your server block if you want them - see Developer Updates. ### Security - API: send your API key in the `X-API-Key` header. A key put in the address (`?api_key=`) was written to your web server's access log with every call, and to a proxy's in front of it - a header isn't. The address and a JSON body still work, so nothing that uses the API breaks, but move your scripts and integrations to the header, then give each one that sent its key in the address a new key and revoke the old one, as the old logs still have it. The API docs now send the key in the header throughout, and the New API Key window says where it goes. Admin > API Keys flags each key sent in the address in the last 30 days, and Admin > Settings > Security has Take API keys in the address - on if your ITFlow had API keys that still worked, so nothing stops when you update, and off on a new ITFlow. Once the flags have gone, turn it off, and a key in the address is turned away from then on. - Credentials: a login saved with a piece of web page code as its username or password could run that code in the browser of an agent who followed a link made for the purpose. The address ITFlow's own pages use to fetch a login's username and password answered as a web page, so a browser sent straight to it drew what the login held instead of showing it as text - and the code then acted as that agent. It took someone able to get such a login saved - an agent who can edit credentials, or a person sent an Ask for a login link, once an agent had saved what they sent back - and then an agent with access to that login opening the link while signed in. The pages that list and show logins were never affected. That answer now says it is data, which no browser draws as a page, and so do sixteen like it that carried only text ITFlow had already made safe. Releases from 26.10 to 26.11.8 are affected, and there is nothing to do after updating. - Invites: with a login key required, the page behind an agent's invite link went on showing the sign-in address with the key in it after the invite had been cancelled or had run out. Someone whose invite was withdrawn could still read the key from their old link. The key signs no one in by itself - it only opens the agents' sign-in page, which still asks for an email and password. A cancelled or run-out link now leads to the plain sign-in page. Releases from 26.11 to 26.11.8 are affected. If you cancelled an invite because the person should never have had it, change the login key in Admin > Settings > Security. - Client access: an agent limited to some clients could read a few names belonging to the others, by putting a record's number in a page's address - a project's name on the tickets list, a site's name, a ticket's subject and an invoice's number on Trips and its export window, a vendor's name in the domains export window, and a client's name on Update Prices and in the message when an AI request was turned away. Nothing else of those records showed, and nothing could be changed. These names now show only for clients the agent can open. Releases from 26.09 to 26.11.8 are affected. - Tickets: a link in an email or a client portal reply could be written so that an agent who clicked it on the ticket opened a page from another website inside ITFlow, where it ran as that agent - able to do anything they could, such as reading the logins they have access to. It took someone sending such a message and an agent clicking its link. Links in tickets, and in documents, now open as ordinary links, and ITFlow's windows only ever load ITFlow's own pages. On an ITFlow without HTTPS, the key that unlocks a signed-in agent's saved logins is also kept out of reach of the page, as it already was with HTTPS. Releases from 25.12 to 26.11.8 are affected, and there is nothing to do after updating. Found by Mountaineer IT. - Client portal: turning the portal off, or archiving a client or a contact, now ends the portal sessions they already have - before, someone signed in stayed signed in until they signed out. Signing in with Microsoft 365 is refused while the portal is off or the contact is archived, as signing in with a password already was. Found by Mountaineer IT. - Ticket emails: anyone can put a ticket's number in a subject, and an email from someone who isn't the client's contact, a watcher or one of your agents reopened the ticket and added its attachments. It is now kept as an internal note marked as from a stranger: the ticket stays as it is, the attachments stay in the mailbox's ITFlow folder, and the assigned agent's email shows it as plain text. An email from one of your agents - answering an email about the ticket - is added as their internal note and reopens nothing. Found by Mountaineer IT. - Two-step sign-in: setting up an authenticator while one was already on replaced it without asking for the password - so anyone with a signed-in browser could swap it for their own and lock the owner out. It now has to be turned off first, which asks for the password. Found by Mountaineer IT. - Uploads: a file opened straight from ITFlow's uploads folder - an HTML or SVG file someone uploaded, say - could run scripts as ITFlow. Files there are now never run, and every page says not to guess a file's type, not to send its address to other sites, and not to be shown inside another site's frame. These are Apache settings; on nginx add them yourself. Found by Mountaineer IT. - Client portal: saving a card now only finishes the card setup the contact started, for their own client's Stripe customer. Found by Mountaineer IT. - Clients and contacts: Send Email to several clients or contacts needs Modify on clients, not View, and is no longer offered to agents who can only view. Found by Mountaineer IT. ### New Features & Updates - RMM Providers: Admin > Integrations > RMM Providers brings in devices from your RMM - Tactical RMM is the first it knows. Add it with its API address and an API key, then on its Clients page link its clients to yours: a client with the same name is suggested, one click links it, and Link the suggested does them all. A linked client's devices come in as its assets straight away, then every 15 minutes or with Sync now. A device is matched to the asset you already have for it - same serial number, or the only asset with its name - and only what that asset is missing is filled in. Otherwise a new asset is made: its name, type (laptop, desktop, server or virtual machine), make and model, serial number, OS, IP, CPU and storage, at the location named like its site in the RMM. - RMM Providers: more than one can be set up - two Tactical servers, say, each with a name of its own. A device both have is matched to the same asset, which shows what each says. - RMM Providers: what the RMM says about a device keeps its asset up to date, field by field - until you change that field in ITFlow, which then stays as you set it. A blank from the RMM never clears anything. - RMM Providers: an asset from an RMM shows whether the device is online, offline or overdue, beside its status. It also gets a card named after its provider: when it was last seen, who is signed in, its public IP and site, and whether it needs a reboot, has patches waiting or has checks failing. For Tactical RMM, Take Control opens its remote session, and its menu has Open in Tactical RMM and Remote Background. The quick look has the state and Take Control too. - RMM Providers: on the assets list, a dot after a device's name says how it is, and the RMM filter - named after your provider when you have one - shows the online, offline or overdue ones, every device in it, or the assets that aren't in it. - RMM Providers: a device the RMM no longer has keeps its asset, marked as no longer in it. If you delete an asset in ITFlow, the next sync doesn't make it again - Bring back on the client's row does. A client linked to another of your clients brings its devices in there. The assets already made for the first client stay, no longer kept up. Each change is in the asset's history. - RMM Providers: alerts can open tickets. In a provider's Edit, pick which - errors, errors and warnings, or every alert - and the category their tickets go in. A new alert on a device of a linked client opens a ticket on its client and asset within a minute: High for an error, Medium for a warning, Low for the rest, with what the alert says and a link to the device in the RMM. The same alert again on the same device goes on that ticket while it is open, reopening it if it was resolved, so a check that keeps failing doesn't fill the queue. - RMM Providers: when an alert clears, its ticket gets a note and is resolved - unless someone has written on it, it is in a status someone moved it to, or another of its alerts is still open. Then it gets the note and stays as it is. Alerts already open when you turn this on, or when you link a client, don't open tickets. - RMM Providers: for Tactical RMM, the alerts are the ones its dashboard shows - a check's or agent's Dashboard alert setting, or its alert template, decides which those are. Nothing needs setting up in Tactical, but the API key's user has to be able to list alerts. A device's open alerts and their tickets show on its card on the asset, and the providers list says which alerts open tickets, how many are open and whether the last look worked. - RMM Providers: bill per managed device. A recurring invoice line's Quantity from has Managed devices - the client's devices your RMM has - beside Users and Devices. Like Devices it can count only some types, Desktop and Laptop for a managed workstation, Server and Virtual Machine for a managed server, or only those with a tag. With more than one RMM it can count one of them. A device the RMM no longer has stops counting at the next invoice, and lost, stolen or retired ones never count. - RMM Providers: a product can be counted Per managed device, so it bills that way on any recurring invoice it is added to - in the product window, and as Per managed device in a product import. - RMM Providers: if the RMM provider a line counted is deleted, the line stays at the quantity it last billed, marked RMM provider gone, until another is picked. Deleting a provider says how many lines bill its devices. - RMM Providers: device actions. Turn on Device actions in a provider's Edit, and technicians who can edit assets can reboot a device, install its patches, turn its maintenance mode on and off, and run one of the RMM's scripts on it - from Actions on the device's card on its asset, or the lightning button beside the asset on a ticket. Rebooting and installing patches ask first, and say who is signed in. Installing patches is for Windows devices, and installs what the device's patch policy approves. While maintenance mode is on, Tactical raises no alerts for the device, so none opens a ticket. - RMM Providers: Run a script lists your RMM's scripts that run on the device's system, favorites first, and starts with the script's own arguments and timeout. The output shows in the window, and the ticket you pick - the one you started from, on a ticket - gets what was run and its output as an internal note. For a long script, turn off Wait for its output: the RMM runs it and keeps the output in the device's history there. - RMM Providers: every device action goes in the asset's history and the audit log, and on the ticket it was done from. Device actions are off for every provider until you turn them on. Tactical does each as the API key's user, so its role needs Shutdown / Reboot Agents, Manage Windows Updates, Edit Agents for maintenance mode, and List Scripts and Run Script - give it only the ones you want, and one it hasn't got says so when tried. - RMM Providers: the RMM Sync job is on Maintenance > Cron, and so is RMM Alerts, every minute. Turning a provider off stops its syncs, and Delete forgets its links - the assets stay as they are either way. API keys are kept like other providers' keys and never shown again. A Tactical RMM key can do whatever its Tactical user can, so make it for a user whose role can see clients and agents, and do the device actions you turn on, and no more. - API: invoices can be made with their lines, changed, emailed, marked sent, cancelled and deleted, and their lines changed or taken off. Emailing one sends it to the client's primary and billing contacts, or the contacts you name, with its link to view and pay - or a reminder of what is still owed. - API: quotes can be made with their lines - billed once, or each month, quarter or year - changed, emailed, marked sent, accepted or declined, and deleted. An accepted quote can be invoiced as Invoice does on its page: its one-time lines on a new invoice, the rest on recurring invoices. A quote's lines can be read, added, changed and taken off. - API: recurring invoices can be changed, paused or resumed, and deleted, and their lines read, added, changed and taken off - a line can count its quantity from the client's users or devices, as in the line window. - API: expenses can be recorded, refunded, changed and deleted, with the same checks as the expense window. Services can be made, changed, archived and deleted, licenses made, changed and deleted, certificates changed, archived and deleted, and products made, archived and deleted. - API: tickets can be reopened and deleted, and replies edited and archived. Assets can be archived and unarchived, and documents, domains, networks and vendors deleted. Documents, domains, networks and vendors are archived before the API deletes them, as clients and contacts are, and a closed ticket is kept, not deleted. Deleting needs Full access. An admin's key can delete tags. A client's waiting portal invites can be listed and cancelled. - API: payments can be read, recorded on an invoice that is sent and still owed on - no more than is owed, into one of your accounts, with the client's receipt emailed - changed, deleted, and their receipt sent again, with the same checks as the payment window. A payment cleared on a reconciled statement keeps its date, amount and account. Payments need Financial, with Read on Sales. Card payments are still charged and refunded in ITFlow. - API: projects can be read - one with its tickets and its progress and time - started for a client or as internal work, with a project template's tickets, changed, completed once none of its tickets is open, reopened, archived, unarchived and deleted once archived. A template's tickets can be added to an open project. A ticket goes on or off a project with tickets/create and tickets/update. - API: a ticket's tasks can be read, added, changed, marked done or not done, and deleted, and an approval can be asked of the client or your team, given by the key's agent, and taken off. A task waiting on an approval, or whose approval was declined, can't be marked done. - API: recurring tickets can be read, made - from a ticket template, with its fill-ins answered and its tasks for those answers - changed, paused and resumed, raised now and deleted. - API: a network's documented IP addresses can be read, added - one at a time or a run of up to 256 - changed and deleted, with the same checks as the address plan: inside the subnet, not documented twice, and a DHCP reservation with its MAC. - API: an asset's interfaces can be read - with what each is plugged into - added, changed, made the primary, plugged in or unplugged, and deleted, with the same checks as the interface window. - API: a license's keys can be read, added, handed to the client's devices and users, and deleted, its seats can be set, and it can be renewed by a term or to a date. Reading licenses by software_key finds a license by any of its keys. - API: asset and contact notes can be read, added with one of your note types, archived, unarchived and deleted once archived. - API: racks can be read - one with what is mounted in it - made, changed, archived, unarchived and deleted once archived, and items mounted, moved and taken out, with the same checks as the rack page: an asset in one rack at a time, nothing else on that face, and a rack no shorter than what is in it. Rack photos are still added in ITFlow. - API: calendar events can be read - one with who is on it - put on a calendar for a client or nobody, once or repeating, changed, sent as invitations, skipped for a day of a series and deleted, with the calendar's rules: an event of no client is anyone's, a client's follows the Clients role. The calendars can be read. - API: trips can be read, logged, changed and deleted - anyone their own, someone else's with Financial - with the same checks as the trip window. One paid back for or billed is kept as it was. - API: accounts can be read with their balances, added, changed, archived, unarchived and deleted while nothing is on them; other income and transfers between accounts can be read, recorded, changed and deleted; recurring expenses can be read, set up, changed, paused and resumed, recorded now, moved on past missed runs and deleted. A line cleared on a reconciled statement keeps its date, amount and account. - API: contracts can be read - one with its prepaid hours and where its signing stands - added, changed, made active, renewed, cancelled and deleted, sent for signature or sent the link again, and the request withdrawn. Prepaid hours can be added, with a draft invoice for them, and deleted, done tickets' time drawn on them and a ticket's hours put back, and the recurring invoice that bills a contract made, linked or unlinked. Countersigning and contract PDFs stay in ITFlow. - API: a client's files can be read, uploaded, downloaded, renamed, moved, archived, unarchived and deleted once archived, and its folders read, made, renamed, moved and deleted - what is in a deleted folder moves up. An upload comes base64 in the request, so the server's upload size caps it. - Contracts: an hourly or after-hours rate of 0 is now a rate of nothing - time it covers bills at no charge - where 0 used to be taken as empty, so the default rate applied. Leave a rate empty for the default, as before. A plan that covers business-hours time and bills after hours, say, is a contract with an hourly rate of 0 and an after-hours rate. Unbilled Time and its reports show such a contract's tickets at its rate, not as having no rate, and the client's terms show the after-hours rate even when it is 0. - Imports: one Import window for clients, contacts, locations, credentials, networks, assets and products. Choose a CSV file and it lists the file's columns with a few of each one's values and what it imports as, matched by its heading in any order - change any of them, or set one to Don't import. Before anything goes in it shows what every row will do: be added, update one already here, be skipped, or not import and why. When it's done, the rows that didn't import download as a file with the reason in a last column, to fix and import again. - Imports: a record already here can be skipped or updated with the file's values - an empty cell leaves what it has - so a list can be exported, changed in a spreadsheet and imported back. Contacts are found by their email, else their name; products by their code, else their name; networks by their name and subnet; the rest by their name. A row for the same record as a row above it is skipped, and an archived record is never changed. - Imports: every list takes everything its export has, so an exported file imports as it is. A file separated by semicolons works too, files made from the old templates still import, and long notes are no longer cut off. Each list's Template has every heading and an example row. - Imports: clients take Lead, Tax Rate (one of your tax rates, by name), Tax Exempt with its certificate and expiry, Tags and Notes, besides what they took before. A phone number written with + and its country code keeps its country code. A client with no location or contact in the file no longer gets an empty one. Updating a client changes its primary location and contact; its rate and terms stay on its contract. - Imports: assets take Status, Primary IP (or DHCP), Primary MAC, Network, Link, Second Link and Client Link, Vendor, Order Reference, Install Date, Warranty Expire, Tags and any of their details, besides what they took before. Assigned To, Location, Vendor and Network are the client's own, by name - Assigned To by email too. A virtual machine's Host can be further down the same file. - Imports: contacts take Primary, Important, Billing, Technical, Tags and Notes, and keep a phone's country code; locations take Country, On-site Contact, Primary, Tags and Notes; credentials take URI 2, Favorite, Asset, Contact, Tags and Notes; networks take Site, Provider, Tags and Notes. A credential whose 2FA secret isn't one is not imported, rather than imported without its 2FA. - Imports: vendors, domains, certificates, licenses and services import too, from Import under the arrow beside each list's New button. Vendors go to the client whose vendors it's opened from, or are your own when it's opened from your vendors. A new domain is looked up, and a certificate with a host is checked, on its refresher's next run. A license's Assets and Contacts give it seats, and a service's Runs On, Vendors, People and Domains link it to them - by name, added to what it has. A license Type that isn't a software type yet is added. - Pictures: your picture, a user's and a contact's, and the photos of assets, locations and racks, show on their form as the picture itself with a camera on it - the person's initials, or a camera, when there isn't one. Click it to open the Picture window: drop, paste or choose a picture, crop it to fit the shape it's shown in - a circle for a person - by dragging and zooming, turn it a quarter at a time, and Use this picture, or Remove the one there is. Photos of assets, locations and racks can also be square, 4:3, 3:4 or the whole photo. What's kept is what's in the frame, at up to 512 pixels across for a person and 2048 for a photo, so a big phone photo goes in at a sensible size, the right way up, without its location or camera details. A person's initials follow their name as it's typed. - Receipts and logos open in the Picture window too: an expense's receipt (on its form, and on its quick look, where it's saved as soon as it's used) and your company's logo (Admin > Settings > Company details, and the setup wizard, where your own picture works the same way). They have no set shape - drag the frame's corners and edges in to just the receipt or logo. Trim the edges cuts the empty or plain-coloured space round a logo, and a PNG logo keeps its see-through background. A receipt can still be a PDF, which goes in as it is. A receipt is kept at up to 2400 pixels, so it stays readable, and a logo at up to 1200. - Mail queue: a sent email keeps what it said, its attachments and its calendar file, so you can open it in Admin > Mail Queue and see exactly what went - until it's deleted after 90 days, as before. Until now every email was cleared as it was sent. An email with a link or code that opens something - a shared login and its code, a client portal or agent invite, a password link, a contract to sign or a task to approve - is still cleared once it's sent, and a day after it was queued if it failed or was cancelled. One cleared like that can't be retried: send a new one from where it came from. Emails sent before this update stay cleared. - Dashboard: Cash flow runs January to December - of this year, or of the year picked at the top right - with what's expected for the months still to come. It showed the last 12 months and the next 3. - Reports: Geography shows where your clients and their locations are, on a map. It opens on your own country, shaded by how many clients - or locations - are in each place: the US state by state, Canada province by province, and any other country as a chart of its regions. All countries shows the world map. Click a state, or pick it at the top, to list its cities and every location in it, and a city for its locations. Incomplete addresses counts the locations it couldn't place - no city, or a country, state or province it doesn't recognise - and a location with no country counts in yours. Leads can be included, and each table prints and exports. The maps are part of ITFlow, so nothing is sent anywhere to draw them. - Reports: every report exports as a PDF that looks like the page - Export > PDF. It has the dark bar with the report's name and dates, your company and who printed it, the figures along the top, and each section as you see it: the charts and the map, the tables with their colours, badges and bold, and the notes under them. Tables come out with all their rows rather than the first few. Client Review makes a PDF to hand a client at a business review. The PDF is in the light colours of paper even when you use dark mode, on Letter paper in the US and Canada and A4 elsewhere, and on its side when a table is wide. Export still has each table as a CSV. - Reports: Tax Package, under Finance, gathers what your accountant asks for at year end for one tax year - profit and loss by category a quarter at a time, the sales tax charged at each rate on payments received and on invoices sent, each account's balance at the start and end of the year, the invoices unpaid at year end, for a US company the vendors paid enough to need a 1099 (with what was paid by card apart), the mileage, and the expenses with no receipt. The year starts in January, or in the month you pick - April in the UK, New Zealand and India, July in Australia and March in South Africa to start with. Download package makes one ZIP: the page as a PDF, each table as a CSV, every payment, expense, invoice and trip of the year as spreadsheets that add up to the summary, and every expense's receipt, named by date, vendor and amount. - Tickets: checking off a task, or marking it not done, no longer reloads the page and sends you back to the top - the list, the count and the Resolve button update where you are, so you can work down a long list. The "Completed Task" note shows in the conversation the next time the page loads. - Banners: a note your team sees along the top of their pages - for one client, such as "On credit hold - no work without approval", or for every client. A client's shows on its pages, and on its tickets, invoices, quotes, recurring invoices and projects however they're opened. Anyone who can edit a client adds one from New Banner in the client's ⋮ menu, which lists its banners below to change, archive or delete. Admins add them for every client, and see them all, in Admin > Agent Banners. Each is a Notice, Heads up or Urgent, and shows between its start and end like a portal announcement. Anyone can hide a Notice or Heads up until it's changed; an Urgent one is big and red, first on the page, and can't be hidden. Clients never see banners. - New Ticket: pick the Status a ticket starts in, and book the work as you make it - a date and time, remote or onsite, under Schedule. The booking goes out as it does from the ticket's Schedule window: the assigned agent, the contact and the watchers are emailed the time with a calendar invite, and it is noted on the ticket. Left as it is, a ticket still starts as New, or Open once it is assigned. From Mountaineer IT's build of ITFlow. - Ticket Statuses: When the client replies can move a ticket to another status - a "Client responded" status, say, so the tickets with a new answer from the client stand out. It can be set on New, Open, On Hold and Resolved as well as your own statuses, for replies by email, in the portal or by text; back to Open is still the default. From Mountaineer IT's build of ITFlow. - Ticket Statuses: a status can count as the first response. An agent moving a ticket nobody has answered yet into it - setting it by hand or in a reply, or assigning a new ticket, which opens it - meets (or misses) the SLA's response target then. It can count quietly, or once the contact and watchers are emailed a "ticket assigned" message, kept on the ticket as a public note - an "Assigned" status, say. The message is set in Admin > Settings > Tickets, under Messages to clients. A client's own reply moving a ticket never counts. From Mountaineer IT's build of ITFlow. - Tickets: Resolve - no response, on the arrow beside a ticket's Resolve button, is for a client who never answered after several tries. It shows the message from Admin > Settings > Tickets filled in for the ticket, to change before it goes; the message goes on the ticket as a public note and, with client emails on, to the contact and watchers in place of the usual "resolved" words. The ticket is resolved and closes on its own as usual, but without the email asking how we did. If they reply before then, it reopens. From Mountaineer IT's build of ITFlow. - Tickets: Email reply has a To line. It starts with the contact, the watchers and anyone at the client who asked for every update on their company's tickets; the technician it's assigned to, the client's other contacts or any email address typed in can be added, and anyone taken out. Everyone in To gets the email, each told why. What was changed is kept for the ticket, so its next email reply starts with the same people - taking a watcher out of To doesn't stop them watching. A reply sent to several tickets at once still goes to each one's contact and watchers. From Mountaineer IT's build of ITFlow. - Tickets: Quick ticket - the + in the top bar, on every page - is for a call or someone at your desk: the client (on a client's page, that one), the contact, found by name, email address or phone number, and what the issue is. The contact's tickets still open are listed first, with who has each, so the same problem isn't raised twice - Work on this one goes to one of them instead, with its timer running. Make ticket raises it as New Ticket would and opens it with its timer already running. Admin > Settings > Tickets, Quick tickets, sets what these tickets start with: who they go to, the status, priority, category and billing, when the timer starts, whether the contact starts on the client's primary and whether they're emailed. From Mountaineer IT's build of ITFlow. - Tickets: a stopwatch in the top bar shows the ticket timers running or paused in your browser, pulsing while one runs, so time isn't lost on a ticket you moved away from. It lists each ticket and its time, to go back to it, pause or resume the timer, or throw its time away. From Mountaineer IT's build of ITFlow. - Tickets: a note with time worked keeps when the work was done. Under Time worked, When it was worked has the date, start and end - filled in from the timer, ending now, until you type them, and typed times set the time worked, for a visit or a call written up later. The conversation shows it beside the time ("25m (Tue Nov 17, 2:05 - 2:30 PM)"), and Edit changes it: new times set the time worked, and a new time worked alone moves the start. An end before the start runs past midnight. A note with time worked needs a date, start and end to send. From Mountaineer IT's build of ITFlow. - Recurring tickets: on Schedule, Book the work for takes a time and Remote or Onsite - each ticket raised is booked for its run day at that time, with the emails, calendar invite and note booking it on the ticket gives. Make it ahead raises each ticket so many days before its run day, which stays the day the work is for - or so many days before the 1st of its month, so every run in a month is raised on one day (monthly and longer repeats). The window says when the next one will be made, and the list shows the time and days ahead. Raise now books the ticket for its run too. From Mountaineer IT's build of ITFlow. - Recurring invoices: Make it ahead makes each invoice so many days before its date, dated the day it's made, and Due, when made ahead sets it due on its date plus the client's terms, or on its date. With 0 days nothing changes. From Mountaineer IT's build of ITFlow. - Maintenance > Cron: admins see a heartbeat in the top bar, beside the bell, when cron needs looking at - cron isn't running, it's switched off, or a job failed, is still running two hours after it started, or has fallen behind. Opening it lists what's wrong, with a job's error, and links to Maintenance > Cron. Nobody else sees it, and it's gone once all is well. From Mountaineer IT's build of ITFlow. - Maintenance > Cron: the new Cron Watch job, every 5 minutes, emails your admins when a job fails, gets stuck or falls behind - once when it starts, again once a day while it lasts, and once more when it's fixed. The Alerts card turns the emails off, sends them to other addresses instead, and sends a test. From Mountaineer IT's build of ITFlow. - Maintenance > Cron: an email can't say cron has stopped, since cron sends it. The Alerts card has a private health address for an uptime monitor such as Uptime Kuma or UptimeRobot: it answers OK while all is well and an error when cron isn't running or a job is in trouble. Check it every 5 minutes. Make a new address if the old one gets out. From Mountaineer IT's build of ITFlow. - Development mode, for a test copy of your ITFlow: turn it on in Admin > Backup before you restore production's backup onto a test server, and nothing reaches your clients, your team or the systems production talks to. Every email goes to a test inbox you give, with who it was for at the front of its subject. Texts wait in the queue, the ticket mailbox isn't read, AI Triage doesn't run, Stripe charges nothing (autopay included), nothing is done to RMM devices, log entries aren't sent to your syslog server, a managed ITFlow doesn't check in with its manager, and telemetry isn't sent. A red DEVELOPMENT badge shows in the top bar for everyone. It's kept in config.php rather than the database, so a restore can't turn it off. Never turn it on in production. From Mountaineer IT's build of ITFlow. - Maintenance > Backup: restore a backup from the page - Restore in a backup's menu, or upload one under Restoring, from another ITFlow say, with its key. An upload of up to 5 GB goes up in pieces, joins the list as Uploaded and opens its Restore window. That window says what's in the backup and refuses one from a newer version, and you confirm with your password and by typing RESTORE. Cron does it within a minute: ITFlow backs itself up first, kept as Before restore so the restore can be undone, then restores the backup and brings its database up to this version. The top of the page shows it waiting (with Cancel), running, and how it went. The command line restore is still under Restoring, for a backup of any size. From Mountaineer IT's build of ITFlow. - Admin > Labor Costs, under Lists: what an hour of each agent costs your company - wage, payroll taxes and benefits - with the date each rate counts from, so a raise doesn't change what last year cost, and a company default for agents with none. Only admins see it, and the audit log never records the amounts. From Mountaineer IT's build of ITFlow. - Reports: Client Profitability, with labor costs set, shows each client's labor cost (their hours at the cost of the agent who worked them), parts cost (the products on their invoices, at cost), profit and margin, and for flat monthly fees the hours a month their fee pays for against the hours they take, marked Over when they take more. The totals along the top add labor, parts, profit, and how many clients lose money or go over. Paid and Invoiced switch income between money received, as before, and sales before tax on invoices dated in the period. Hours by agents with no cost and no default are flagged. From Mountaineer IT's build of ITFlow. - Users: an API / service account is a login that API keys act as - for your RMM or a sync. Turn on API / service account on a user's Sign in tab (a new one needs Set a password now, as it isn't invited). It keeps its role, so its keys work as before, but it's left out of the calendar, the assign pickers, the reports and the other agent lists, gets no notifications or admin alerts, and can't sign in to ITFlow - a session it has is ended. Admin > Users lists them under API accounts, with an API badge, and leaves them out of the other tabs but Archived. It still takes a seat where there's a limit on agents. From Mountaineer IT's build of ITFlow. - Tickets: booked work has an end. The Schedule window has How long - 15 minutes to a day, an hour unless picked - and an Agent picker, so booking someone else's ticket gives it to them and takes it off the old agent's calendar. New Ticket's Schedule and a recurring ticket's Book the work for take a length too. The calendar draws each booking at its length, and dragging its bottom edge changes how long it takes, after asking. The booking email, the calendar file, the ticket and the guest page say when it ends. From Mountaineer IT's build of ITFlow. - Tickets: the warning when an agent is booked twice now means it - it lists their tickets and timed events that overlap the booking, at their lengths, instead of anything within two hours. From Mountaineer IT's build of ITFlow. - Recurring tickets and events: a monthly, quarterly, twice-yearly or yearly recurring ticket, and a monthly or yearly event, can repeat on a weekday - the third Wednesday, or the last Friday - instead of the same date. Pick its date, then Repeats on offers what that date is: On the 16th, or On the third Wednesday. Moving the next run, or an event's start, keeps it on the same kind of weekday. The recurring tickets list, the event and its calendar invitations say which, and Google, Outlook and phone calendars that subscribe show it on the right days. From Mountaineer IT's build of ITFlow. - Calendar: every agent has a color, and their booked tickets and the events assigned to them are drawn in it - so whose work is whose shows at a glance. Each has one from the start; pick your own under Account > Preferences > Calendar color, or an admin picks one in Admin > Users. In the week, 7 days, day and list views the agent's first name sits beside the time. From Mountaineer IT's build of ITFlow. - Calendar: events are assigned to agents. New Event and Edit have Assigned to beside the title, and the client's contacts and anyone else by email go under Invite. Calendar is only asked for when you have more than one. An event added from someone's calendar - Whose set to them - starts assigned to them, and it shows on their calendar rather than yours. The event's quick look changes who it's assigned to without opening Edit, sending the cancellation to anyone taken off who had the invitation, and the invitation to anyone added when others have it. From Mountaineer IT's build of ITFlow. - Calendar: Left behind, under the calendar, lists open tickets booked on a day that has gone - the work wasn't done and nobody moved it on - longest left first, with how many days ago. Drag one onto the calendar to book it again, for as long as before, or click it for the quick look. Its old booking on the calendar has a dashed red outline. It follows Whose, so Everyone shows everyone's. From Mountaineer IT's build of ITFlow. - Calendar: a 7 days view shows seven days from any day, and its arrows move a day at a time, so a booking can be dragged across a weekend without leaving the view. Bookings at the same time now sit side by side instead of on top of each other. From Mountaineer IT's build of ITFlow. - Calendar: Holidays, under From ITFlow, shows the closure days from Admin > SLA, and is on to start with. From Mountaineer IT's build of ITFlow. - Calendar: what you have shown - calendars, sources, Whose and the view - is kept to your account, so the calendar opens the same way on every computer and phone. The first time, it opens on your own calendar. With Whose set to Everyone, To schedule lists everyone's open tickets that aren't booked, with who has each. From Mountaineer IT's build of ITFlow. - Tickets: more than one agent can work a ticket. Under Assigned to on the ticket, Additional agents adds others to help, while the ticket stays assigned to its lead. Each helper is booked at the same time as the lead - moving and cancelled with the lead's booking - at a time of their own, or not booked. A helper finds the ticket under Mine and on the dashboard, is emailed the client's replies as the lead is, and is sent their own booking with a calendar file that doesn't replace the lead's. The client's emails stay about the lead's booking. Click a helper to change their booking or take them off. From Mountaineer IT's build of ITFlow. - Tickets: the tickets list and board show +1, +2 after the lead when others are helping - Helping when one of them is you. A helper's booking is on the calendar in their color, can be dragged to a time of their own, shows in their calendar link, and counts when someone books them for something else at the same time. From Mountaineer IT's build of ITFlow. - Time zones: an agent who works away from the company can pick My time zone under Account > Preferences. The calendar, the ticket's booking, the Schedule window, New Event and Edit, and the event's quick look are then on their own clock, with a note saying so, and their booking emails give their time with the company's beside it. Bookings are still kept in the company's time, so the client's emails and calendar files, and everyone else's view, don't change. From Mountaineer IT's build of ITFlow. - Dispatch: a new page under Support puts each agent's booked work beside the tickets still to give out. The queue on the left has three tabs - No agent, Not booked (with an agent, nothing booked) and Left behind - most urgent first, with a search, a client and a priority filter. Day shows a column for each agent through the day; Week a row for each agent with a column for each day. Drag a ticket from the queue onto an agent and a time, or drag a booking to another agent or time, and the Schedule window opens with the agent, the time, how long and onsite or remote filled in - Schedule it gives the ticket to that agent and books it, emailing them the calendar file, the agent who had it the cancellation, and the contact and watchers unless you switch that off. Drag a booking back onto the queue to take it off the schedule. One-off events move the same way, to another time or agent. Workload shows each agent's open tickets (leading and helping), SLAs breached or close to it, tickets past due, not booked or gone quiet, and the hours booked today and this week against the working hours in Admin > SLA - flagged Falling behind, Watch, Overloaded or Has room against the team. Click an agent for their tickets, or drop a ticket from the queue on one to give it to them. Under it, This week shows tickets in and closed each day, against last week and the last four, the week's SLA results and each agent's share. Which agents show, the view and weekends are kept to your account, and an agent on their own time zone sees it on their clock. Seeing Dispatch takes Support in your role; booking from it takes Support at Modify. From Mountaineer IT's build of ITFlow. - Quotes: a quote line can carry what it costs you, and its price can come from that cost. In a line's Edit window, Your cost has Cost each, Price by - Markup (a % added to the cost), Margin (a % of the price) or Set price - and the %, with buttons for the ones you use most: the Price is worked out as you type, and says what the line makes each. Typing the Price yourself makes it a set price. A line added from a product takes the product's cost and keeps its price. On the quote, while it can be changed, each line with a cost shows it under its name with its markup or margin, and the quote's Margin counts each line's own cost. Only agents see any of it - never the PDF, the guest link, the client portal or the invoice made from the quote. Admin > Settings > Quotes has what a line is priced by to start with, its % and the quick picks. From Mountaineer IT's build of ITFlow. - Quotes: a quote line can have a picture beside its name - on the quote, the guest link, the client portal and the PDF. In the line's Edit window, upload one or paste a link: a picture, or the product's web page, whose main picture is taken. A product keeps a picture too, in its Edit window, and a quote line added from it takes a copy; copying a quote copies them. ITFlow keeps its own copy of each, made smaller, and only fetches from public websites. Admin > Settings > Quotes can switch pictures off. From Mountaineer IT's build of ITFlow. ### Bug Fixes - Quotes: Copy Quote dropped each line's link to the product it came from, so the copy's Margin left those lines out. The copy now keeps it. Found by Mountaineer IT. - Backups: restoring a backup rewrote the uploads folder's settings in a form Apache with PHP-FPM refuses - as HestiaCP, cPanel and Plesk run it - so your logo, avatars and photos stopped loading after a restore. Found by Mountaineer IT. - Contacts: archiving several contacts at once left the client's primary contact in place, as it should, but archived its client portal login, so they could no longer sign in. Found by Mountaineer IT. - Sign-in: an authenticator code of 000000 was taken as no code. Found by Mountaineer IT. - Tasks: Mark all complete also completed tasks waiting for an approval, or declined, which the task list doesn't let you tick. Those now stay open, and a task waiting for approval can't be completed on its own either. Found by Mountaineer IT. - Email parser: an email with a subject over 500 characters, or an attachment with a name over 255, was never taken - it was tried again every minute. An attachment name with an apostrophe was also saved with a backslash in it. Found by Mountaineer IT. - SLAs: saving an SLA, the SLA settings or a closure day, or changing a ticket's priority, sent the "SLA breached" email again for every open ticket that had already been sent one, and the warning again for those already warned. A ticket keeps its alerts now unless the change gives it a new target to meet - one moved later is warned and breached again when it comes. Found by Mountaineer IT. - Ticket emails: with Microsoft 365, cancelling a ticket's schedule left every "Ticket Schedule Cancelled" email failing with "SMTP Error: data not accepted", however often it was retried. The cancellation went in the email as a meeting cancellation with no organiser or attendees, which Microsoft 365 turns away. It's now attached as a calendar file, the same way the booking is, for the recipient to open and take the visit off their calendar. Event invitations and their cancellations, which have attendees, go as before. - Mail queue: when the mail server turns an email away, Admin > Mail Queue and the failure notice now show what the server said, not only the step that failed - "SMTP Error: data not accepted. The mail server said: 554 5.2.0 ..." - which usually says why. - Invoices, quotes and contracts: opening one from its link while signed in to ITFlow - View as Client - counted as the client viewing it. A sent one became Viewed, its history said the client had viewed it, and your team was told. An agent looking doesn't count now; the client opening it still does. - Ticket emails: a picture of about 750 KB or more pasted into a reply, or into a ticket's details, left the email without its message - the picture went missing, and the words with it. The email has all of it now, whatever the picture's size. The same picture made a document come out empty in a client export, and a document template come out empty when it was exported or imported. - Ticket emails: a picture pasted into a reply, or into a ticket's details, now goes with the email as a picture attached inline, where the message shows it, rather than as data inside the message. Gmail, among others, showed no picture sent the old way. The mail queue also keeps each picture once, instead of a copy inside every email it sends. Admin > Mail Queue still shows the email with its pictures. - App Logs: the email parser wrote an entry every minute that mail came in or was left in the inbox ("Cron Email Parser executed in 0.16 seconds. Processed: 0 email(s), Unprocessed: 2 email(s)"), and the mail queue and email parser wrote one every minute while no mail server was set up. Neither does now. Each email is still a ticket or a reply, one that can't be is still left flagged and unread in the inbox, and an email that fails is still logged, once. With no mail server set up, Maintenance > Cron says so instead. The Mail Queue, Ticket SLA Monitor, Domain Refresher and Certificate Refresher also no longer log an error each time they run while cron is switched off - Maintenance > Cron says why they stopped, as the email parser already did. - Assets: a virtual machine can have a vendor - the provider a hosted one or VPS is rented from - with its order reference and date, on the Purchase tab like other assets. Before, only one added from a vendor's page kept its vendor. - Hosting panels: on a server where Apache hands PHP to PHP-FPM - as HestiaCP, cPanel, Plesk and most hosting control panels set it up - your logo, the favicon, avatars and the photos on contacts, locations, assets and racks didn't load, and the server answered them with an error. They load now. The folders kept private, such as backups and receipts, stay private. Installs made with the install script, which runs PHP inside Apache, were not affected. - Tickets: a resolved ticket reopened by a reply - on the ticket page, in a bulk reply, from the client portal or through the API - kept its resolved time, and its resolution SLA stayed met, so however long it then stayed open, it was never warned or breached. Each of these now clears the resolved time and starts the resolution SLA again, as a client's emailed reply already did. Found by Mountaineer IT. - Ticket emails: every email from the client on a ticket that was already open sent the resolution SLA warning again once the ticket was past its warning point. Only an email that reopens a resolved ticket starts the resolution SLA over now. Found by Mountaineer IT. - Client portal: opening a ticket's Resolve or Close link directly could resolve a ticket that was already resolved, giving it a new resolved time, resolve one whose tasks weren't all done, or close one that wasn't resolved. Resolve now works only on a ticket that isn't resolved yet and has its tasks done, and Close only on a resolved one, as the ticket's page offers them. Found by Mountaineer IT. - API: a reply could be added to a closed ticket, and a reply could set a ticket to New, Closed or a status that doesn't exist, or resolve it with tasks still open. These are now refused with a message saying why. A status set with a reply also pauses or restarts the SLA clock as it does on the ticket page, and changing a ticket's priority through the API picks its SLA again. Found by Mountaineer IT. - Merging tickets: with Also move this ticket's replies onto it ticked, the replies moved but their attachments stayed behind on the merged ticket, so the replies showed without their files. The attachments go with the replies now. Found by Mountaineer IT. - Payments: Charge Saved Card could charge a card twice. A double click on Charge, or two people charging the same invoice at once, made two charges at Stripe and recorded both. A second Charge now waits for the first and then finds the invoice paid, and the same window sent twice is one charge at Stripe. Found by Mountaineer IT. - Payments: Add Payment checked the amount against the balance shown when the window opened, so a window left open, or two people recording the same payment, could take an invoice past what it owes. It also took a payment of 0 or less, and a payment on a draft or cancelled invoice. The balance is now worked out when you save, and only a sent invoice with something owed takes a payment. Found by Mountaineer IT. - Payments: a Batch Payment that paid a client's invoices exactly could leave one of them Partial with nothing owed - with two invoices, about one time in four - because the amounts were worked out in fractions of a cent. It's worked out in whole cents now, against what the client owes when you save rather than when the window opened, and a payment of 0 or less is refused. Found by Mountaineer IT. - Autopay: an invoice with part of it already paid wasn't charged on its due date at all. Autopay now charges what is still owed, read again just before the charge. Found by Mountaineer IT. - Online payments: an invoice owing less than 1.00 couldn't be paid from its link. The card limit in Admin > Payment Providers also only hid the Pay button - the invoice's payment page still took a card for an invoice over the limit, or one marked non-billable. The page now says the invoice can't be paid online. Found by Mountaineer IT. - Online payments: the payment page an invoice's link opens never showed why a card was declined, or any other problem, and its button gave no sign of working while a payment went through. The reason now shows under the button until the next try, and the button shows a spinner while it works. - Emails: with mail sent through a Microsoft 365 or Google sign-in and no SMTP server filled in, a client paying from an invoice's link got no receipt and the paid notification address wasn't told, and the quote notification address wasn't told when a client accepted or declined a quote. Found by Mountaineer IT. - Recurring invoices: Make Recurring on an invoice with a discount kept the discounted total but not the discount, so the recurring invoice showed no discount and lost it the next time a line was changed. The discount goes with it now. Found by Mountaineer IT. - Lists: a page number of 0 or less in a list's address - an old bookmark, a link typed by hand - stopped the page part way, with no list. It shows the first page now. A custom date range with a start and no end matched nothing; it now runs on from the start. Found by Mountaineer IT. - Client portal: a contact signed in to the portal who went to ITFlow's main address was signed out, rather than taken to the portal. Found by Mountaineer IT. - Custom pages: every form on a page of your own under agent/custom stopped with an error, as the handler loaded a file that is no longer there. Found by Mountaineer IT. - Maintenance > Cron: a job that stopped on an error - the email parser not reaching the mail server, an RMM sync or alert check that failed - showed as Skipped, as if it had nothing to do, and wasn't counted among the failures at the top of the page. It shows as Failed now, and the email parser's failure says what the mail server answered. Found by Mountaineer IT. - Mail: with Microsoft 365 or Google mail, the mail queue fetched a new sign-in token for every email it sent once the old one ran out, rather than once. Found by Mountaineer IT. - Updates: once an install was a hundred or so commits behind, the update check stopped with "Data too long" and the Update page no longer showed what was new. It keeps the newest 100 commits now, and counts them all. Found by Mountaineer IT. - Restoring from the command line into a database with no settings yet - a new install stopped at the setup wizard, as Moving to a new server has you do - stopped with a time zone error before it began. Found by Mountaineer IT. - API: a body that isn't JSON - a form post, or none at all - and a limit under 1 or an offset under 0 answered with a server error rather than a message. Deleting a client through the API left its files behind. Found by Mountaineer IT. - Contacts: Anonymize missed a name with an apostrophe in it (O'Brien) in the logs and in the tickets the contact raised. Found by Mountaineer IT. It also took the first name out of an email address that starts with it before the address itself, leaving the rest of the address showing. - Assets: moving assets to another client logged "created asset (via transfer)" without the asset's name. Found by Mountaineer IT. - New client: the duplicate warning took % and _ in the name you typed as wildcards, so a name with them in it could warn of a duplicate that isn't one. Found by Mountaineer IT. - Admin > Access Modules: the page stopped part way when sorted by a column it doesn't have, and its New Module button, and Edit and Delete on the AI module, went nowhere. Those are gone - modules are built in. Found by Mountaineer IT. - Tickets: moving a ticket to another client left the old client's watchers on it, so they kept getting its emails. Watchers who aren't on your team or contacts at the new client now come off it, and the ticket's history says how many. Found by Mountaineer IT. ### Developer Updates - Database 3.6.7: `rmm_providers` (`rmm_provider_kind` - `tactical` for now - the name it goes by, `api_url`, `web_url`, `api_key`, `api_secret` for an RMM that signs in with an id and a secret, and how the last sync went), `rmm_clients` (each provider's clients, `rmm_client_client_id` 0 until linked, `rmm_client_removed_at` once the RMM stops listing one) and `rmm_devices` (one a device: its asset, what the RMM last said - status, last seen, signed-in user, reboot, patches, checks - and `rmm_device_synced`, JSON of what the sync last wrote to the asset). Re-runnable, like 3.6.0. - `functions/rmm.php` is what every RMM shares. A kind is an entry in `rmmProviderKinds()` and a file of its own - `functions/rmm_tactical.php` for Tactical. It names the connection fields it uses, with their labels and help (the window and its checks are built from them), hints added to errors, the device links it offers, and four functions: `clients`, `devices` (each device in the shape described above `rmmDeviceFacts()`), `dashboard` and `device_urls`. `rmmHttp()` makes the request and turns a refused key, a redirect, a 404 or an answer that isn't JSON into a sentence for the person; `rmmTacticalRequest()` adds Tactical's `X-API-KEY`. Another RMM is a file like `rmm_tactical.php`, a line in `rmmProviderKinds()` and a `require_once` in `functions.php`. - `rmmSync($provider, $only = 0, $max_seconds = 120)` asks the kind for its clients, then for each linked client's devices, longest since brought in first, and stops on time to pick up next run. `GET_LOCK('itflow_rmm_sync_')` keeps each provider to one sync at a time. Devices and clients are marked removed by what the RMM listed, never by time, and only for a client whose list came back whole. One client failing doesn't hold up the rest or mark its devices removed. `rmmDeviceSave()` matches (`rmmAssetMatch()` - serial, then a name only one asset has, among this client's unarchived assets no other device of the provider has), makes (`rmmAssetCreate()`) and follows (`rmmAssetFollow()`). The follow rule: a field is written when it is empty or still holds what `rmm_device_synced` says was last written, and a blank never writes. Values go through `rmmText()` first - what `escapeSql()` would store - so a value compares the same on both sides and isn't written again every run. CPU and storage are asset details (`asset_specs`) and are only written for a type that has them. A device two providers have is one asset with a row from each, and each follows only what it wrote. - `cron/rmm_sync.php` is the `rmm_sync` job in `includes/cron_jobs.php`, every 15 minutes: `rmmSyncAll()` syncs each provider that is on, sharing two minutes between them. It stops with the failing providers' notes, or when cron is off. Admin handlers are in `admin/post/rmm.php`; their request keys are in `DEMO_MODE_LOCKS`, and `admin/rmm_providers.php` and `admin/rmm_clients.php` are locked pages in the demo. - `agent/assets.php` takes `rmm` (`any`, `online`, `offline`, `overdue`, `none`) as a subquery on `rmm_devices`, in the list and the tab counts alike. The RMM select only shows once a provider is set up. - Database 3.6.8: `rmm_providers` gains `rmm_provider_alert_level` (`''` none, `error`, `warning`, `info`), `rmm_provider_alert_category_id`, `rmm_provider_alerts_since` (NULL until the first look), `rmm_provider_alerts_at` and `rmm_provider_alerts_note` (the last look's error, NULL when it worked). `rmm_alerts` is one an alert ITFlow has seen: its device, asset and client, `rmm_alert_about` (what on the device it is about - `check:12`, `task:3`, `availability`), severity, message, raised and cleared times, and `rmm_alert_ticket_id`, 0 for one already open before ITFlow watched. Re-runnable. - Alerts are two more optional kind functions, `alerts` (the open ones) and `alert` (one by id, null once the RMM no longer has it), each alert in the shape described above `rmmAlertLevels()`. Tactical's are `PATCH /alerts/` with `resolvedFilter: false` and `GET /alerts//`. `rmmAlertsPoll($provider)` takes a lock per provider (`itflow_rmm_alerts_`). The first look after alerts are turned on, or the provider back on, records what is open with no ticket. After that an alert it hasn't seen is new - no clock is compared, except to skip one raised before its device came into ITFlow. Alerts no longer listed as open are asked about one by one, 25 a run. An error is written to App Logs once, when it starts, not every minute it lasts. - `rmmAlertTicketOpen()` makes the ticket the way a text does (`smsTicketOpen()`): next ticket number, `ticket_source` `RMM`, `applyTicketSla()`, the new-ticket address (`ticketMailNewTicketAddress($ticket_id, 'rmm')`) and `triggerCustomAction('ticket_create')`, but no email to the client's contacts. Its notes are internal replies with `ticket_reply_by` 0, and `rmmTicketWorked()` counts any reply by someone (`ticket_reply_by` > 0). Resolving and reopening go through `ticketResolve()` and `ticketReopen()`, so the SLA clock and history follow. `ticketSourceIcon()` and the ticket page know the `RMM` source. - Seat lines have a fourth source, `managed` (`recurringSeatSources()`): the client's assets in use that have an `rmm_devices` row not marked removed (`recurringSeatManagedSql()`). Its filter takes `types` and `tag` as `assets` does, and `rmm`, a provider id - absent for any. `recurringSeatCount()` gives null for a provider that is gone, so the line keeps its quantity as it does for a license that is gone; `recurringSeatLines()` adds `seat_gone`, the words for that. `recurringSeatOptions()` adds the managed count, types and tags, and each provider's count, once an RMM is set up. `productSeatSources()` has `managed`, and the line script, product import, AI catalog text and tag merges know it. `recurringSeatManagedLineCount($provider_id)` counts the active recurring lines that bill a provider's devices. No database change - `item_seat_source` and `product_seat_source` take the new value. - `cron/rmm_alerts.php` is the `rmm_alerts` job, every minute. It stops when cron or ticketing is off, or no provider's alerts open tickets. - Database 3.6.9: `rmm_providers.rmm_provider_actions`, 0 for every provider until an admin turns device actions on in its Edit. Re-runnable. - Device actions are optional kind entries: `actions` (`reboot`, `patches`, `maintenance`, `script`, each with `label`, `icon`, `needs` - the permission its key's user needs there - `about`, and `platforms` when it is only for some), `act($provider, $remote_id, $action, $options)` answering `ok`, `output`, `timed_out` and `error`, and for scripts `scripts($provider, $platform)` and `script($provider, $id)`, each script in the shape described above `rmmProviderKinds()`. `actions_help` is the provider window's text. `rmmDeviceActions($row)` is what a device offers - its provider on with actions on, the device not removed, the action for its platform - and `rmmDeviceActionsMenu($row, $ticket_id)` draws them for Modify on Support. `rmmActionTarget()` checks the device and the ticket (the asset's client's, not closed), and `rmmActionRecord()` writes the asset history, the audit log (`Asset` / `RMM`) and the ticket's internal note by the person, through the new `rmmTicketNoteHtml()` that `rmmTicketNote()` now uses. - `agent/post/rmm.php` handles `rmm_reboot`, `rmm_install_patches`, `rmm_maintenance_on` and `rmm_maintenance_off`, each with the `rmm_devices` id and an optional `ticket_id`, and `rmm_run_script` with `script_id`, `args` (one a line), `timeout` (5 to 600) and `wait`, which answers JSON when asked for it and a flash otherwise. A script run waits up to its timeout plus 30 seconds, with `set_time_limit()` to match and the session closed first, so the person's other tabs aren't held up. The window is `agent/modals/rmm/rmm_script.php`. The request keys are in `DEMO_MODE_LOCKS`. - Tactical: `POST /agents//reboot/`, `POST /winupdate//install/`, `PUT /agents//` with `maintenance_mode`, `GET /scripts/` and `/scripts//`, and `POST /agents//runscript/` with every key its view reads - output `wait` or `forget`, and the script's own `env_vars` as Tactical's Run Script window sends them. `rmmHttp()` takes `$text_ok` for answers that are a JSON string, reads a JSON-string error body into its message, and sends `{}` for an empty body. `rmmTacticalActError()` turns a 403 into the permission the key's role needs. - `agent/ajax.php`: the seventeen GET answers that printed JSON under PHP's default `text/html` now send `Content-Type: application/json` first - `get_credential_via_id`, `get_totp_token_via_id`, `get_readable_pass`, `get_active_clients`, `get_client_contacts`, `get_client_assets`, `get_client_locations`, `get_client_vendors`, `get_client_projects`, `get_internal_users`, `get_document_content`, `get_canned_response`, `ticket_query_views`, `client_duplicate_check`, `contact_email_check`, `network_ip_check` and `domain_check`. Their callers read the body as text (`itflowGet()`) or with `res.json()`, so nothing changes for them. A new JSON answer sets the header the same way: a value that is not escaped for HTML, as a login's username and password are not, must never go out as `text/html`. - `getFieldByIdInScope($table, $id, $field, $client_field)` (`functions/app.php`) is `getFieldById()` for a record that belongs to a client. It gives null unless `hasClientAccess()` passes for the record's client, as it does for a record that isn't there; a record with no client (0) is anyone's. Use it wherever a label is made from an id in the query string. The two labels read with their own query, on `agent/trips.php` and `agent/modals/trip/trip_export.php`, take `clientScopeSql()` instead. - `join.php` puts the login key in its sign-in link only while the invite is `pending` or `accepted` (`userInviteState()`). - API endpoints: `invoices/` `create`, `update`, `delete`, `send`, `mark_sent`, `cancel`; `invoice_items/` `update`, `delete`; `quotes/` `create`, `update`, `delete`, `send`, `mark_sent`, `accept`, `decline`, `invoice`; `quote_items/` and `recurring_invoice_items/` `read`, `create`, `update`, `delete`; `recurring_invoices/` `update`, `delete`, `status`; `expenses/` `create`, `update`, `delete`; `services/` `create`, `update`, `archive`, `unarchive`, `delete`; `software/` `create`, `update`, `delete`; `certificates/` `update`, `archive`, `unarchive`, `delete`; `products/` `create`, `archive`, `unarchive`, `delete`; `assets/` `archive`, `unarchive`; `delete` for `documents`, `domains`, `networks`, `vendors`, `tags` and `tickets`; `tickets/reopen`; `ticket_replies/` `update`, `archive`; `portal_invites/` `read`, `cancel`. Each calls what its page's handler does - `certificateFormSet()`, `serviceFormSet()`, `softwareFormSet()`, `productSave()`, `expenseSave()`, `expenseDelete()`, `billingInvoiceCreate()`, `billingItemSave()`, `billingItemDelete()`, `quoteConvert()`, `ticketReopen()`, `ticketDeleteForGood()`, `documentDeleteForGood()`, `vendorDeleteBlocker()` and the rest - and where the handler does the work inline, the endpoint does the same steps. A refusal the page would flash comes back as a 400 with its words. - The line endpoints of all three document types are one body, `api/v1/billing_lines.php`, included by files that set `$billing_type` (`invoice`, `quote`, `recurring`) and `$billing_op`. `billingLineFromApi()` (`functions/billing.php`) checks a line an API call sends - a product's name, description and price for those not sent, qty 1, `tax_id` `default` - and is shared by `recurring_invoices/create` (its messages are unchanged), `invoices/create`, `quotes/create` and the line creates. `billing_lines.php` and `quotes/quote_answer.php` refuse a request that doesn't come through an endpoint. - `enforce_api_rbac.php` maps `quote_items` and `recurring_invoice_items` to `module_sales`, and lists the state changes - `archive`, `unarchive`, `close`, `resolve`, `reopen`, `send`, `mark_sent`, `cancel`, `accept`, `decline`, `invoice`, `status` - at level 2 rather than leaving them to the default. `delete.php` stays at 3, a line's included. - The new updates answer success when the record is saved unchanged; the older ones still answer failure when no row changed. - API endpoints: `payments/` `read`, `create`, `update`, `delete`, `send` (the receipt); `projects/` `read`, `create`, `update`, `complete`, `reopen`, `archive`, `unarchive`, `delete`, `apply_template`; `tasks/` `read`, `create`, `update`, `complete`, `delete`; `task_approvals/` `create`, `approve`, `delete`; `recurring_tickets/` `read`, `create`, `update`, `status`, `raise`, `delete`. They call `billingMoneyCan()`, `invoiceCanPay()`, `updateInvoiceStatusFromPayments()`, `reconcileCheckChange()`, `reconcileCheckDelete()`, `transferDepositRelease()`, `billingPaymentSend()`, `projectNextNumber()`, `projectApplyTemplate()`, `projectComplete()`, `projectReopen()`, `projectArchive()`, `projectRestore()`, `projectDelete()`, `projectNotifyManager()`, `projectStats()`, `ticketMailTaskApproval()`, `recurringTicketRunNow()`, `recurringTicketNextRun()`, `ticketFillInAnswers()`, `ticketTemplateTaskApplies()` and `recurringTicketMailAssigned()`; the task and recurring ticket handlers work inline, and their endpoints do the same steps. Payment and recurring ticket fields go through `payments/payment_model.php` and `recurring_tickets/recurring_ticket_model.php`, project fields through `projects/project_model.php`. - `enforce_api_rbac.php` maps `payments` to `module_financial` (the endpoints also check Sales at Read through `billingMoneyCan()`), and `projects`, `tasks`, `task_approvals` and `recurring_tickets` to `module_support`, with `complete`, `approve`, `raise` and `apply_template` at level 2. - `tickets/ticket_model.php` takes `ticket_project_id` - the client's project or an internal one (`ticketClientOwnedId()`), 0 to take it off - and turns down any other id rather than dropping it; `tickets/create` and `tickets/update` write it and the ticket's history. - API endpoints: `network_ips/` `read`, `create`, `update`, `delete`; `asset_interfaces/` `read`, `create`, `update`, `delete`; `software/` `seats`, `renew`; `software_keys/` `read`, `create`, `update`, `delete`; `asset_notes/` and `contact_notes/` `read`, `create`, `archive`, `unarchive`, `delete`; `racks/` `read`, `create`, `update`, `archive`, `unarchive`, `delete`; `rack_units/` `create`, `update`, `delete`. They call `networkIpFieldsSet()`, `checkIpForNetwork()`, `expandIpSuffix()`, `interfaceFormSet()`, `interfaceConnectTarget()`, `interfaceConnect()`, `interfaceMakePrimary()`, `interfaceLinks()`, `softwareSyncSeats()`, `softwareSeatHolders()`, `softwareRenewalExtended()`, `softwareAddKeys()`, `softwareKeys()`, `rackUnitConflict()`, `rackLoadUnits()` and `rackDeletePhoto()`; the note, key, rack and rack item handlers work inline, and their endpoints do the same steps. An update sends `interfaceFormSet()` and `networkIpFieldsSet()` the record's own values for the fields it leaves out. Asset and contact notes are one body, `api/v1/notes_body.php`, included with `$note_kind` and `$note_op`, as the billing lines are. - `categoryPickedName($kind, $name, $keep = '')` (`functions/categories.php`) checks a name posted for a category kind held by name - a rack type, an interface type, a note type - against what the picker offers, in any case, and gives the category's own spelling, '' for blank, or null when it is none of them; while a kind has no categories set up, any name is taken. - `enforce_api_rbac.php` maps `network_ips`, `asset_interfaces`, `software_keys`, `asset_notes`, `racks` and `rack_units` to `module_support` and `contact_notes` to `module_client`, with `seats` and `renew` at level 2. Deleting an IP, interface, key or rack item needs Full, as every API delete does, where the page lets Modify do it. - `software/read.php` read `software_key` from the wrong parameter (`software_license`), so a lookup by key matched licenses with no key; it now matches the license's own key or one in `software_keys`. - API endpoints: `calendars/read`; `events/` `read`, `create`, `update`, `send`, `skip`, `delete`; `trips/` `read`, `create`, `update`, `delete`; `accounts/` `read`, `create`, `update`, `archive`, `unarchive`, `delete`; `revenues/` and `transfers/` `read`, `create`, `update`, `delete`; `recurring_expenses/` `read`, `create`, `update`, `status`, `record`, `move_on`, `delete`; `contracts/` `read`, `create`, `update`, `activate`, `renew`, `cancel`, `delete`, `send`, `withdraw`, `draw`, `put_back`, `recurring`, `unlink`; `contract_hours/` `create`, `delete`; `files/` `read`, `create`, `download`, `update`, `archive`, `unarchive`, `delete`; `folders/` `read`, `create`, `update`, `delete`. They call `calendarEventFormSet()`, `calendarSetAttendees()`, `calendarSendInvites()`, `calendarEventCan()`, `tripSave()`, `tripDelete()`, `accountSave()`, `accountArchive()`, `accountRestore()`, `accountDelete()`, `incomeRevenueSave()`, `incomeRevenueDelete()`, `transferSave()`, `transferDelete()`, `recurringExpenseSave()`, `recurringExpenseRecord()`, `recurringExpenseCatchUp()`, `recurringExpenseDelete()`, `contractFromInput()`, `contractCreate()`, `contractUpdate()`, `contractActivate()`, `contractRenew()`, `contractCancel()`, `contractSignatureSend()`, `contractSignatureWithdraw()`, `contractHoursAdd()`, `contractHoursDraw()`, `contractHoursPutBack()`, `contractRecurringCreate()`, `contractRecurringLink()`, `contractRecurringUnlink()` and `fileDeleteForGood()`. `api/v1/form_input.php` has `apiFormInput()`, which builds a save function's `$in` from the API's field names and, on an update, the record's own values, and `apiFormRefuse()`. - `fileUploadExtensions()` (`functions/files.php`) is the list of file kinds Files take, which `agent/post/file.php` held inline; Upload Files and `files/create` both check against it. `files/create` takes the file base64 in the JSON body (`file_data`), as `validate_api_key.php` reads the body as JSON, stores it under the same unguessable name an upload gets and reads its type from the file. `files/download` answers with the file itself, `application/octet-stream` and `nosniff`, as an attachment. - `enforce_api_rbac.php` maps `accounts`, `revenues`, `transfers` and `recurring_expenses` to `module_financial`, `contracts` and `contract_hours` to `module_sales`, `files` and `folders` to `module_support`, and `events`, `calendars` and `trips` to `''` - their endpoints check `calendarEventCan()` and `tripCanEdit()` as the pages do. `skip`, `record`, `move_on`, `activate`, `withdraw`, `draw`, `put_back`, `recurring` and `unlink` are at level 2, and `download.php` reads, at level 1 and not a write. - `php_flag engine off` in `uploads/.htaccess`, its `backups`, `expenses`, `tmp` and `canned_responses` folders and `scripts/.htaccess` is wrapped in ``. Apache only knows `php_flag` under mod_php - with PHP-FPM through `mod_proxy_fcgi` it stops on the line and answers every request in the folder with a 500. Under FPM, PHP still can't run there: `uploads/.htaccess` denies `.php`, `.phtml`, `.phar` and the rest by name, and the other five deny everything. - A contract's or contract template's rate of 0 is kept: `contractFromInput()` saves an entered 0 as `0.00` and only an empty field as `NULL`. `contractTicketRate()`, `contractTermsOn()`, `contractUsualTerms()`, `contractClientTerms()` and the clients list treat a rate as set when it isn't `NULL`, rather than above 0, and `contractClientTerms()` gives `null` for no after-hours rate rather than 0. The no-rate warnings on Unbilled Time, Unbilled Tickets, Time Detail by Client and the bill-a-ticket window are for a rate of 0 from the default only (`default_rate`). Contracts saved before kept no 0 rates - 0 was saved as `NULL` - so nothing changes for them. - `Virtual Machine` in `ASSET_TYPES` (`functions/asset_type.php`) has the `purchase` fields - Vendor, Order / invoice reference and Purchased. - Imports run through one window, `agent/modals/import/import.php?kind=&client_id=`, and one handler, `agent/post/import.php`: `import_check` and `import_run` (both JSON, the file sent each time with the column map) and `import_template`. Each kind is an entry in `importKinds()` (`functions/import_kinds.php`) - its permission module, whether it is a client's, its fields (template and export heading, other headings taken for it, required, help, example), `find` (the record already here), `key` (what makes two rows the same record), `legacy` (the old fixed columns, by position) and `row`, which adds or updates one record from the fields the file has. Adding a kind is an entry and its `row` function. `importProcess()` (`functions/import.php`) runs the rows in a transaction, each behind a savepoint so a row that fails is undone whole, commits it for `import_run` and rolls it back for `import_check` - the check is the import itself, as the email preview is; like it, a check moves `AUTO_INCREMENT` on. `importAutoMap()` matches headings, `importFile()` checks and reads the upload (comma or semicolon, byte-order mark, 10 MB and 5,000 rows at most). The per-kind import windows, their `import_*_csv` and `download_*_csv_template` handlers, `importColumns()`, `importCsvRows()`, `importLegacyColumns()`, `importHeadingsText()`, `importTagIds()`, `importNotesText()` and `NETWORK_CSV_COLUMNS` are gone. Templates need read access to the kind's module - the products template had no check. An asset an import adds or updates gets an `asset_history` row. - Import kinds `vendors`, `domains`, `certificates`, `licenses` and `services` in `importKinds()`, saved through `vendorFormSet()`, `domainFormSet()` with `domainWriteHistory()`, `certificateFormSet()` with `certificateWriteHistory()`, `softwareFormSet()` with `softwareSyncSeats()` and `softwareAddKeys()`, and `serviceFormSet()` with `linkAdd()`. Updating, a kind's row reads the record's current values into the form's fields and lays the file's over them, so it is checked as the form checks it. A kind's `module` can be a callable of the client id (`importModule()`) and its `client` `'optional'` - a vendor is the client's (`module_client`), or with none your own (`module_financial`). `log` names it in the audit log when that isn't its `one` (licenses log as Software). `importClientRecordId()` finds a client's domain, and `importClientRecordIds()` reads a cell of names separated by commas. The Domains and Certificates menus show to an agent who can add, so Import is there on an empty list. - Picture fields: `pictureField($name, $remove_name, $current, $empty, $opts)` (`functions/picture.php`) renders the picture as a button with a camera badge, a hidden file input named `$name` and a hidden `$remove_name` input; `js/picture_field.js` opens the Picture window over the form's own (the window stacking in `js/app.js`), crops on a canvas and puts the crop in the file input through `DataTransfer` - a JPG for a JPG, else WebP, PNG where the browser can't write WebP - and sets the remove input to 1 on Remove, so the forms post the same fields as before and no handler changed. Options: `round`, `shapes`, `max`, `class` (the new picture's ``), `box` and `name` (the field the initials follow). `picturePhoto()` and `picturePhotoEmpty()` are a photo's two looks. Used on the profile, Admin > Users, contacts, assets, locations and racks, replacing their file inputs, remove boxes and preview scripts. A browser without `DataTransfer` gets the file picker and the file as picked. Free crops: `shapes => 'free'` gives a frame with corner and edge handles over the whole picture instead of the fixed-shape crop, `trim` adds Trim the edges (transparent, or within a small distance of the corner colour, found on a downscaled probe), `accept` sets the file types - with `application/pdf` a PDF is used as it is - and `submit` sends the form once a picture is used; `box` adds `tall` (a receipt) and `logo`, and `pictureFile()` is a PDF's look. A PNG source stays PNG when the field doesn't take WebP, so a logo keeps its transparency. Used on the expense form and quick look (`expense_receipt_save` is now posted as a hidden field), Admin > Settings > Company details and the setup wizard's company and account steps; `js/setup.js` loses its `data-setup-image` preview and checks, and `.itflow-setup-preview` is gone. - `cron/ticket_email_parser.php` no longer writes its run summary to App Logs - it echoes the counts and the time for a run from the command line - and ends with `cronJobStop("No mailbox is set up to read - see Admin > Settings > Mail")` when `config_imap_provider` is empty instead of logging. `cron/mail_queue.php` does the same with no `config_smtp_provider`. `cron/mail_queue.php`, `ticket_sla.php`, `domain_refresher.php` and `certificate_refresher.php` stop with `config_enable_cron` off without a `logApp()` error, as the parser has since 26.11.4. - `apiKeyFromRequest()` (`functions/api_keys.php`) reads the key an API call came with for `api/v1/validate_api_key.php` - the `X-API-Key` header (`HTTP_X_API_KEY`), else the JSON body's `api_key`, else the query string's; one that's empty or not a string counts as none, a 401 with an empty body. The key was also escaped twice on its way in; it's escaped once now. - Database 3.7.0: `api_keys.api_key_address_at`, when a key last came in a call's address (`apiKeyNoteAddress()`, at most once a minute), and `settings.config_api_key_in_address` - on where a key that hadn't expired was there at the update, off otherwise and in `db.sql`. `apiKeyInAddress()` says whether a call's query string has an `api_key`. With `apiKeyInAddressAccepted()` false (read guarded, so true before the update), `api/v1/validate_api_key.php` answers a working key in the address with a 401 and a message, and logs it as an `API` `Failed` against the key without counting it toward `apiKeyWatch()` - even when a header sends the key too, as the address is logged all the same. Admin > API Keys reads `api_key_address_at` for its flag and note, and Admin > Settings > Security saves the switch. - Database 3.7.1: `email_queue.email_sensitive`, set by `emailQueue()`'s new `sensitive` option (`addToMailQueue()` writes it once the column is there, `mailQueueHasSensitive()`). It is passed by `shareEmailLink()`, `shareEmailCode()`, `portalInviteMail()`, `portalMailInvite()` and `portalMailSignupExists()` when the account is local, `portalMailPasswordReset()`, `userInviteMail()`, `contractSignatureRequestEmail()` and `ticketMailTaskApproval()`. `cron/mail_queue.php` marks an email sent with `mailQueueSentSql()`, which clears `email_content`, `email_cal_str` and `email_attachments` only where `email_sensitive` is 1 - every email before the update, as before. `mailQueueClearSensitive()` (nightly) clears a failed or cancelled one a day after it was queued. Retry (`mailQueueCan()`, `mailQueueAct()`) needs `email_content`, and Admin > Mail Queue reads `email_content = '' AS email_cleared` for it. The update marks the emails waiting or being sent as sensitive, as they would have been cleared. - `emailMessageHtml()` styled images and paragraphs with a lookahead across each tag (`(?![^>]*\bstyle=)`). On a data: image of 750 KB or more - its base64 is a million characters - that ran out of `pcre.backtrack_limit`, `preg_replace()` returned `null` and the message came out ''. It now works a tag at a time (`/<(img|p)\b([^>]*)>/`, which never backtracks into a tag) and keeps its input should a pattern fail. The same kind of scan through a tag to an attribute is replaced in `documentTemplateInlineImages()` and in the template import's alt and uploads clean-up (`functions/document_template_transfer.php`), and `clientExportLocalImages()` stops at the first `src=` and keeps its input on failure. - `emailInlineImages()` (`functions/email.php`), called by `emailQueue()` for each email it queues, takes every `` whose `src` is a data: picture (checked with `getimagesizefromstring()`) out to `uploads/tmp/mail_images/.` - written once, whoever it goes to - and points it at `cid:@itflow`. Each goes in the email's attachment manifest with a `cid` (`addToMailQueue()` keeps it), and `cron/mail_queue.php` attaches it with `addEmbeddedImage()`, so the message is `multipart/related`. A meeting request with pictures goes as an attached `invite.ics`, as one with files already did, since PHPMailer leaves the calendar part out of a message with inline parts. `mailQueueAttachments()` splits a manifest into files and pictures - the list's paperclip and the email's attachments are files only - and `mailQueueShowImages()` puts the pictures back as data to show the email in Admin > Mail Queue. `mailQueueImageCleanup()` (nightly) deletes a picture no queued email points at once it is a day old. - `userSignedInAgent()` (`functions/user.php`) is the agent signed in to ITFlow in this browser - their id, or 0 - taking the session as `includes/load_user_session.php` does: an active, unarchived agent whose session stamp still matches their password. `billingGuestViewed()` and `contractSignatureViewed()` record nothing for a link opened in such a browser, as the portal's View as contact already didn't. - `dashboardCashFlow()` covers January to December of the picked year (`year-YYYY`) or of this one for the other periods, labels its months by name alone, and returns `year` in place of `extended`. Other monthly charts still use `dashboardChartMonths()`. - Reports: `geography` in `reportCatalog()` (Clients & Documentation, `module_client`), `agent/reports/geography.php`. The outlines are `includes/maps/world.json`, `us.json` and `ca.json` - Natural Earth 1:50m (public domain), simplified and projected ahead of time (Equal Earth; Albers USA; Lambert conformal conic) to SVG paths in whole units, `{source, width, height, regions: {code: {name, d, dot}}}` keyed by ISO 3166-1 alpha-2 for countries and ISO 3166-2 (`US-PA`) for states and provinces, `dot` marking a place too small to see. In `functions/reports.php`: `reportGeoPlace()` reads a location's country (ITFlow's list through `settingsLocalizationArrays()`, the map's names, ISO codes and a few short forms; blank is `company_country`), state (postal code or name, for a country in `REPORT_GEO_MAPS`) and city into keys; `reportGeoLocations()`, `reportGeoGroup()`, `reportGeoMapHtml()` (inline SVG, each place's `--heat` from the square root of its share of the most, mixed into the accent as `.itflow-report-heat` is) and `reportGeoLegendHtml()`. Another country's states are a JSON file in the same shape and a line in `REPORT_GEO_MAPS`. - Reports: Export > PDF (`?export=pdf`) draws the report page as usual: `inc_report_layout.php` calls `reportPdfStart()`, which holds the output and registers `reportPdfFinish()` to make it a PDF as the page ends (or send it as it is after a fatal error, or when there is no `.itflow-report` on it). `ReportPdfWriter` (`functions/report_pdf.php`, loaded after TCPDF) reads the page's HTML back with DOMDocument and lays it out with TCPDF: `.itflow-report-head` as the title bar, `.itflow-report-stats` as a grid of cells, each `.card` as a section, tables with their columns sized by what is in them, `.itflow-report-heat` and `.itflow-dash-bars` shaded, the geography map redrawn from its paths with `ImageSVG()`, and Bootstrap's text, weight and badge classes turned into inline styles; `.d-print-none`, icons, avatars and meters are left out. Charts are drawn only in the browser, so `js/reports.js` draws each again off the page in the light theme (`drawChart()` now takes extra Chart options and returns the chart) and posts them as PNG data URLs in `charts[]`, in page order, with the theme's `accent`; the server keeps only PNGs. `reportTable()` lists every row, up to `EXPORT_PDF_MAX_ROWS`, for a PDF. `reportHeader()`'s Export menu has CSV (per table) then PDF, and takes `pdf` => false to leave the PDF out - it is out by default where `export` is false, and Client Review offers it once a client is picked. - Reports: `tax_package` in `reportCatalog()` (Finance, `module_financial`, `accounting`) and `agent/reports/tax_package.php`. `?start=` is the month the tax year starts (by `company_country` from `TAX_PACKAGE_START` when not given), `?year=` the year it starts in, `?rate=` the mileage rate and `?over=` the 1099 threshold (a US company with a January year; 600 before 2026, 2,000 from). The figures come from `reportIncomeByCategory()`, `reportExpensesByCategory()`, `taxReportSales()` on both bases, `taxReportPurchases()` and `accountBalanceSql()`; what was owed on an invoice at year end is `taxPackageOwedSql()`, which takes an invoice marked Paid that no payment covers as settled. Download package (`?export=package`) calls `reportPdfStart()` with a sender, so the page is drawn and made a PDF as usual and `taxPackageSend()` then builds the ZIP in `uploads/tmp` (removed when the request ends): the summary, the page's tables through the new `reportCsvData()` (what `reportCsv()` now sends), the Income, Expenses, Invoices and Trips registers, and `Receipts/` from `expenseReceiptPath()`. `reportPdfStart(callable $send = null)` can be called more than once, `reportPdfRequested()` is true for `pdf` and `package`, and `reportTable()` takes `pdf_whole` => false to keep its `limit` in a PDF. In report PDFs a table wider than the page now wraps only its text columns, down to their longest word, so figures stay on one line. - `sendQueueEmail()` (`cron/mail_queue.php`) puts a calendar file in the message as its own `text/calendar` part (`$mail->Ical`) only for a meeting - `METHOD:REQUEST` or `CANCEL` with an `ORGANIZER` and an `ATTENDEE` - and attaches anything else as `invite.ics`. `createiCalStrCancel()` has neither, so a ticket's cancellation now goes as an attachment like its `PUBLISH` booking: Exchange Online makes the part into a meeting as it takes the message, and refused one with nobody in it. A PHPMailer exception from `send()` is thrown again with the SMTP server's last reply added (`getSMTPInstance()->getError()`), so `email_error` keeps it. - `agent/ticket.php`: a link marked `data-task-toggle` (a task's checkbox, and Mark incomplete) is followed with `fetch` instead of navigating. The post handler is unchanged: its redirect back to the ticket is the answer, and its `table#tasks` rows, `.ticket-task-count` and `[data-ticket-resolve]` button (both forms of Resolve carry it) replace the page's own, with its flash toast. Only the latest click's answer is used; the rows are replaced inside the tbody so SortableJS reordering keeps working; a link that lands elsewhere goes there, and one that can't be reached is followed as before. - Banners: `functions/agent_banner.php`. They are kept in `portal_announcements` with the new `announcement_audience` (`portal` or `agents`), sharing `PORTAL_ANNOUNCEMENT_TONES`, `portalAnnouncementState()`, `portalAnnouncementBodyHtml()` and the form, moved to `includes/announcement_form.php` (with `$announcement_for_agents`, and `$announcement_client_fixed` for one client's). `portalAnnouncementFromPost()` and `portalAnnouncementSetSql()` moved from `admin/post/portal_announcement.php` to `functions/portal.php` as `announcementFromPost()` and `announcementSetSql()`, and `portalAnnouncementsFor()` and Admin > Client portal read only the `portal` ones (`portalAnnouncementsOnlySql()`). `agentBannersHtml($client_id)` draws them, each once a page, from `includes/inc_alert_feedback.php` with the page's `$client_id`; `ticket.php`, `invoice.php`, `quote.php`, `recurring_invoice.php` and `project.php` opened without `client_id` set `$agent_banners_later` and call it with the record's client. `agent/post/agent_banner.php` has `add_agent_banner`, `edit_agent_banner`, `archive_agent_banner`, `restore_agent_banner`, `delete_agent_banner` and `hide_agent_banner` (a 204, sent by the close button), checked with `agentBannerCanEdit()` - an admin, or `module_client` at 2 with access to the client for a client's. The windows are `agent/modals/agent_banner/`, used by `admin/agent_banners.php` too. Database 3.7.2: `portal_announcements.announcement_audience` and `announcement_dismissals` (announcement, user, when); a dismissal hides a banner while it is newer than `announcement_updated_at`, and never one in `danger`. Nothing shows until the update has run (`agentBannersReady()`). - `applyTicketSla()` (`functions/sla.php`) keeps `ticket_response_sla_alert_stage` and `ticket_resolution_sla_alert_stage` when it re-stamps a ticket: 2 while the new due time has passed (with its `*_sla_met` at 0), 1 unless the due time moved more than a minute later; 0 otherwise, as before. It reset both to 0, so `restampOpenSlaTickets()` and a priority change made `cron/ticket_sla.php` alert every open breach again. From Mountaineer IT's build of ITFlow. - `js/ajax_modal.js` loads only same-origin URLs: it falls back to a trigger's `href`, so an `` in purified HTML fetched another site's JSON and ran its scripts. The HTMLPurifier setups in `agent/ticket.php`, `agent/modals/ticket/ticket.php` and `documentHtmlPurify()` set `Attr.ForbiddenClasses` to `ajax-modal`. `generateUserSessionKey()`'s cookie without `$config_https_only` is now `httponly`, SameSite Lax. From Mountaineer IT's build of ITFlow. - `.htaccess` sets `X-Content-Type-Options: nosniff`, `Referrer-Policy: same-origin` and `Content-Security-Policy: frame-ancestors 'self'` (mod_headers; HSTS is left to the web server). `uploads/.htaccess` adds `nosniff` and `Content-Security-Policy: script-src 'none'; object-src 'none'; base-uri 'none'`. `backupAssertUploadsGuards()` writes the shipped `uploads/.htaccess` (it wrote `php_flag` outside ``, a 500 under PHP-FPM), and `BACKUP_UPLOADS_DENY_GUARD` guards its `php_flag` the same way. On nginx, `add_header` the same three for the app and the two for `/uploads/`. From Mountaineer IT's build of ITFlow. - `client/includes/check_login.php` ends a portal session whose contact or client is archived or when `config_client_portal_enable` is off (not View as contact). `client/login_microsoft.php` checks the switch and `contact_archived_at`, with curl timeouts. `create_stripe_checkout` keeps the session id in `$_SESSION['stripe_checkout_session_id']` and `stripe_save_card` takes only that one, and only for the client's own Stripe customer. `client_upload_document` takes the type from `finfo`. From Mountaineer IT's build of ITFlow. - `cron/ticket_email_parser.php` `addReply()`: a sender who is no contact of the client, watcher or active agent (user_type 1) is a stranger - internal note, no status change, no attachments, the assignee mail as text, no `ticket_reply_client` action. An agent's mail is an internal note by their user id. No `ticketMailClosedReply()` to an address matching the new-ticket bounce pattern. The subject is cut to 500 before escaping, and attachment names to 255 and escaped once. From Mountaineer IT's build of ITFlow. - `enable_mfa` (`agent/user/post/profile.php`) refuses while `user_token` is set, and `mfa_enforcement.php` sends a user who has one on. `login.php` tells a typed code from none with `$code_given`. `send_bulk_mail_now` and `bulk_send_client_email` need `module_client` at 2. `bulk_archive_contacts` archives a contact's user only when it archives the contact. `complete_task` and `complete_all_tasks` leave tasks with a pending or declined `task_approvals` row open. From Mountaineer IT's build of ITFlow. - Every way out of Resolved into a working status - `add_ticket_reply` and `bulk_ticket_reply` (`agent/post/ticket.php`), `add_ticket_comment` (`client/post.php`) and `ticket_replies/create` - sets `ticket_resolved_at` to NULL and calls `resetTicketResolutionSla()` after `syncTicketSlaClock()`. `addReply()` in `cron/ticket_email_parser.php` calls `resetTicketResolutionSla()` only when the ticket was Resolved, and `syncTicketSlaClock()` otherwise. The portal's `resolve_ticket` refuses a ticket with `ticket_resolved_at` set or `ticketOpenTaskCount()` above 0, and `close_ticket` one with no `ticket_resolved_at`. From Mountaineer IT's build of ITFlow. - `ticket_replies/create` answers 400 (`apiFormRefuse()`) for a closed ticket, a `ticket_status` not in `ticketReplyStatuses()`, or Resolved while `ticketOpenTaskCount()` is above 0, and calls `syncTicketSlaClock()` after a status change. `tickets/update` calls `applyTicketSla()` when `ticket_priority` changes. `ticketMergeInto()` with `$move_replies` moves the replies' `ticket_attachments` rows to the parent and their files from `uploads/tickets//` to `uploads/tickets//`, giving one whose name is taken there a new `randomString(32)` name. From Mountaineer IT's build of ITFlow. - `add_payment` and `add_bulk_payment` (`agent/post/payment.php`) no longer read `balance` from the form, and the field is gone from both windows. `add_payment` checks `invoiceCanPay()` on `invoiceState()` and compares in cents; `add_bulk_payment` sums each open invoice's balance in cents and pays each `min()` of what is left and what it owes. Both set the status with `updateInvoiceStatusFromPayments()`. `add_payment_stripe` takes `pay_token` (32 hex characters, a new hidden field in Charge Saved Card), holds `GET_LOCK('itflow_invoice_pay_', 30)` from reading the invoice again to booking, charges the balance with the idempotency key `itflow-agent--`, and sets the status with `updateInvoiceStatusFromPayments()`. From Mountaineer IT's build of ITFlow. - Autopay (`cron/nightly_tasks.php`) takes Partial invoices, reads the invoice again before charging, charges `invoice_amount` less `invoicePaid()` and sets the status with `updateInvoiceStatusFromPayments()`. `stripe_create_pi` (`guest/guest_ajax.php`) answers every refusal as JSON `{"error": ...}`, compares the balance in cents and checks `billingOnlinePayAllowed()`; `guest_pay_invoice_stripe.php` checks `invoiceCanPay()` and `billingOnlinePayAllowed()` before showing the form. The guest receipt and `billingQuoteAnswer()`'s notice go on `billingEmailReady()` rather than `config_smtp_host`. `add_invoice_recurring` copies `invoice_discount_amount`. From Mountaineer IT's build of ITFlow. - `js/guest_pay_invoice_stripe.js` shows the `error` `stripe_create_pi` answers, and toggles `d-none` on the message, the spinner and the button text - the `hidden` class it toggled isn't in Bootstrap 5, and the message started as `d-none`, so it never showed. - `includes/filter_header.php` takes `page` as at least 1, and a custom range with `dtf` and no `dtt` as ending `2099-12-31`, as All time does. `admin/modules.php` sorts only on `module_name` or `module_description`. `index.php` sends a session with `client_logged_in` to `/client/` before checking `logged`, which the portal sign-in sets too. `agent/custom/post.php` no longer requires `post/ai.php`, and it and `agent/user/post.php` read `HTTP_REFERER ?? ''`. `api/v1/validate_api_key.php` takes a body that doesn't decode to an array as `[]`, and clamps `limit` to at least 1 and `offset` to at least 0 - with no upper limit, unlike Mountaineer IT's 1000. `clients/delete` removes `uploads/clients/` from `__DIR__`. From Mountaineer IT's build of ITFlow. - The cron dispatcher records a `CronJobStopped` with a code other than 0 (`cronJobStop($message, 1)`) as `Failed`, with its message as `cron_job_last_error` ("Stopped with an error - see App Logs" when it has none), and logs it to App Logs. `persistMailOauthTokens()` (`cron/mail_queue.php`) also sets the run's globals. `cron/update_check.php` keeps the newest 100 `pending_commits`, each subject cut to 300 characters, fewer if the JSON is still over 60,000 bytes; `updateCheckDetails()` adds `commits`, the full count, which `admin/update.php` shows. `scripts/restore_cli.php` reads the time zone only from a settings row that is there, and `backupCurrentDatabaseVersion()` answers `Unknown` when there is no settings table. Contact anonymizing redacts the stored values, longest first; the client duplicate check escapes `%` and `_`; the asset transfer log uses `$asset_name`. From Mountaineer IT's build of ITFlow. - `add_ticket` (`agent/post/ticket.php`) takes `status`, one of `ticketPickableStatuses()` (else New, or Open when assigned, as before), into the INSERT, so `applyTicketSla()` starts the SLA clock paused for a status that pauses it. `schedule` and `onsite` are booked with `ticketSetSchedule()` after the ticket's own emails; a `schedule` that `ticketScheduleValue()` can't read turns the form away before anything is saved. From Mountaineer IT's build of ITFlow. - Database 3.7.3: `ticket_statuses.ticket_status_reply_status_id` - 0, or the status a client's reply moves a ticket in it to; `ticketStatusAfterClientReply()` takes it while it is one of `ticketStatusReplyTargets()`, so a target switched off falls back, and deleting a status clears it from the others - and `ticket_status_first_response` (0, 1 or 2, `TICKET_STATUS_FIRST_RESPONSE`), and `settings.config_ticket_assigned_message` (NULL is `TICKET_ASSIGNED_MESSAGE`). The status form posts `client_reply` as `1`, `0` or `to-`, and `first_response`. `ticketStatusMovedByAgent($ticket_id, $from, $to)` is called where an agent moves a ticket - `ticketChangeStatus()`, `ticketChangeAssignee()`, `add_ticket`, `add_ticket_reply`, `bulk_ticket_reply`, `bulk_assign_ticket`, taking a text as a ticket and `ticket_replies/create`, not API ticket creation. With the email it inserts the message, filled by `cannedResponsePlaceholders()`, as a public note and sends it with `ticketEmailContent()`'s new `assigned` kind, keeping the note and calling `setTicketFirstResponse()` only when `ticketMailSend()` queued one. From Mountaineer IT's build of ITFlow. - Database 3.7.4: `tickets.ticket_no_response_at`, the `ticket_resolved_at` of a resolution that was "no response" - `ticketIsNoResponse()` while the two match, so a reopen and a later resolve leave it behind - and `settings.config_ticket_no_response_message` (NULL is `TICKET_NO_RESPONSE_MESSAGE`). `resolve_ticket_no_response` (`agent/post/ticket.php`, window `agent/modals/ticket/ticket_resolve_no_response.php`) checks the ticket is open with its tasks done, and `ticketResolveNoResponse()` inserts the message as a public note, calls `ticketResolve()` and sends `ticketEmailContent()`'s `resolved` kind with `no_response`, the message in place of its words. `ticketMailClosed()` sends nothing for such a ticket. The Resolve button is a group with a split arrow, and the group carries `data-ticket-resolve`, so ticking a task swaps it whole. From Mountaineer IT's build of ITFlow. - Database 3.7.5: `ticket_mail_choices` - per ticket, the addresses put in or taken out of the To line where that differs from the default (the contact, watchers and `ticketColleagueRecipients()` in; the assigned agent, the client's other contacts and typed addresses out), going with the ticket. `functions/ticket_reply_recipients.php`: `ticketReplyRecipients()` lists who the To line offers, `ticketReplyRecipientsPick()` keeps the posted choice and returns `emailQueue()` recipients with why each gets it, `ticketReplyRecipientsForget()` clears it. `add_ticket_reply` sends to them when `email_to_shown` is posted with `email_to[]`, through `ticketMailReply()`'s new `$to` and `ticketMailSend()`'s `recipients` option; without it - the bulk reply, the API, an older form - to the contact and watchers as before. `change_client_ticket` takes off watchers who are neither agents nor the new client's contacts, and forgets the ticket's choices. From Mountaineer IT's build of ITFlow. - Database 3.7.6: `config_quick_ticket_on`, `_assign` ('me', 'nobody' or a user id), `_status`, `_priority`, `_category`, `_billable` (-1 is `config_ticket_default_billable`), `_timer` (make, open or off), `_primary`, `_open_tickets` and `_email_client` in `settings`, read by `quickTicketSettings()` (`functions/quick_ticket.php`). `includes/top_nav.php` has the + (an `ajax-modal` of `agent/modals/ticket/ticket_quick.php`, with `agent/js/ticket_quick.js`) and the timers menu (`js/ticket_timers.js`, loaded from `includes/footer.php`). The window posts `add_ticket` with `quick_ticket`, plain-text `details` (made HTML by `quickTicketDetailsHtml()`), `status`, `category_id`, `billable` and `quick_ticket_timer`, the browser's clock in ms; `add_ticket` skips `ticketMailCreated()` when `_email_client` is off and calls `quickTicketAfterCreate()`, which logs the history line and keeps the start in the session for `quickTicketTimerScript()`, printed on the ticket page before `agent/js/ticket_time_tracking.js`. `agent/ajax.php`: `ticket_also_open` takes `work` (who has each, when it last moved, a Work on this one button with `data-ticket-work`, up to 10, and a line when there are none), `get_client_contacts` also returns `contact_phone` and `contact_mobile`, and `ticket_timer_tickets` returns the reference, subject, client and state of the tickets behind the timers the agent can open. The timers read and write the same `-startTime`, `-pausedTime` and `ticket-timer-running-` keys, and on the ticket's own page press its `#startStopTimer`. From Mountaineer IT's build of ITFlow. - Database 3.7.7: `recurring_tickets.recurring_ticket_schedule_time` (NULL books nothing), `_schedule_onsite`, `_lead_days` and `_lead_mode` (days or month), and `recurring_invoices.recurring_invoice_lead_days` and `_due_mode` (terms or next) - `recurringAheadReady()`. The nightly job takes recurring tickets by `recurringTicketDueSql()` and recurring invoices up to `recurring_invoice_lead_days` ahead, made with `recurringInvoiceGenerate()`'s `$early` when the date is still to come. `recurringTicketRunNow()` calls `recurringTicketBook()`, which books through `ticketSetSchedule()` for the run day at the time (today for a missed run), as "Recurring ticket" from the cron; `recurringInvoiceGenerate()` dates an invoice made ahead with lead days due by `recurringInvoiceAheadDue()`. Days ahead are kept short of one step by `recurringTicketLeadDays()` and `recurringInvoiceLeadDays()` (a month is 28 days, 90 at most; 27 before the 1st of the month, month-based repeats only). The fields are `schedule_time`, `schedule_onsite`, `lead_days` and `lead_mode` on the recurring ticket windows (`agent/includes/inc_recurring_ticket_ahead.php`), and `lead_days` and `due_mode` on the recurring invoice form; a post without `lead_days` keeps what is saved. From Mountaineer IT's build of ITFlow. - Database 3.7.8: `ticket_replies.ticket_reply_work_start` and `ticket_reply_work_end`, in company time - `ticketWorkTimesReady()`. `add_ticket_reply` takes `work_date`, `work_start` and `work_end` (`ticketWorkRange()`; an end before the start is the next day, under 24 hours) for a note with time worked, and `ticketWorkTimeWorked()` makes the time worked their length unless it agrees to the minute; without them, or from the bulk reply, the API or email, they stay NULL - it ended when it was posted. `edit_ticket_reply` takes the same fields: changed times set the time worked, the same times with a new time worked move the start, times left as `ticketWorkTimesShown()` filled them on a note without any keep it without, and no time worked clears them. The reply box's time row is Time worked and When it was worked, above Status and Send; `agent/js/ticket_work_times.js` follows `#hours` / `#minutes` / `#seconds` from `ticket_time_tracking.js` (at least a minute), in company time from `#workTimes` `data-now`, and refuses the form in the capture phase, before the timer resets, when a note with time worked has no valid times. From Mountaineer IT's build of ITFlow. - Database 3.7.9: `config_cron_alert_email` (default 1), `config_cron_alert_to`, `config_cron_health_key` and `config_cron_alert_state` (JSON: `sent`, each problem's key and when it was last emailed; `waiting`, each job that is on and has never run and since when) - `cronHealthReady()`. `functions/cron_health.php`: `cronHealthProblems()` reads the heartbeat, `config_enable_cron` and each enabled registry job's row (not those a manager has paused) into problems with a key, kind (`not_running`, `off`, `failed`, `stuck` after `CRON_HEALTH_STUCK_MINUTES`, `overdue` - past two intervals and at least ten minutes over, or two hours past a daily time; a job never run is late once `waiting` is older than that), text and error. `includes/top_nav.php` shows them to admins as `#itflowCronHealth`. `cron/cron_watch.php` is the `cron_watch` job, every 5 minutes: `cronHealthWatch()` records `waiting`, then emails the problems that are new, a day old or gone with `cronHealthAlert()` through `cronHealthMail()` (`emailQueue()`, to `config_cron_alert_to`, else active admins - `cronHealthRecipients()`), leaving out `not_running` and its own; Admin > Mail previews it as `cron_alert`. `health.php` answers 200 `OK` or 503 with a line per problem, given `config_cron_health_key` as `?key=` or an `X-Health-Key` header, and 403 otherwise. `admin/post/cron.php` has `edit_cron_alerts`, `test_cron_alert` (to the addresses typed) and `renew_cron_health_key`, locked in the demo. From Mountaineer IT's build of ITFlow. - Development mode (`functions/dev_mode.php`): `$config_dev_mode` and `$config_dev_mail_to` in config.php - `devModeOn()`, `devModeMailTo()`. `edit_dev_mode` (`admin/post/backup.php`, locked in the demo) writes both with `devModeConfigSet()`, which replaces each line or adds them at the end and invalidates opcache; when config.php can't be written, Admin > Backup shows the lines to add. `sendQueueEmail()` (`cron/mail_queue.php`) sends to `devModeMailTo()` with `[DEV to ]` in front of the subject, and with no test inbox the queue is cancelled as in the demo. `includes/stripe_init.php` calls `devModeBlockStripe()`, a `\Stripe\ApiRequestor::setHttpClient()` client that throws `ApiConnectionException`. `smsSendQueued()` leaves a text queued, `rmmDeviceAct()` refuses, `managedHttpJson()` answers not ok, and `logForwardQueue()` and `logForwardSend()` send nothing. `cron/ticket_email_parser.php`, `ai_triage.php`, `sms_queue.php`, `payment_provider_fees.php`, `manager_checkin.php` and `managed_instances.php` stop with `cronJobStop("Development mode - ...")`; `cron/nightly_tasks.php` skips autopay and telemetry. `includes/top_nav.php` shows `[data-dev-mode]`, a link to `admin/backup.php#dev-mode` for admins. From Mountaineer IT's build of ITFlow. - Restoring from Maintenance > Backup (`functions/backup_restore.php`): `restore_backup` (`admin/post/backup.php`) checks the password and RESTORE, then `backupRestoreQueue()` checks the archive with `backupRestoreCheck()` (`backupInspectArchive()`, refused when its database version is newer) and the disk (three times its size), writes `restore_queued.json` beside the backups - another install's key sealed with this one's (`backupRestoreSealKey()`, AES-256-GCM) - and `restore_status.json`, and sets the Backup job's `cron_job_run_now`. `cron/backup.php` calls `backupRestoreRunQueued()` after the queued backups: it deletes the request first, refuses one older than `BACKUP_RESTORE_WAIT_MINUTES`, makes a Full Backup with source `Before restore`, runs `backupRestoreArchive()`, puts that row and the restored one back in the restored `backups` (others found again by retention), marks `Running` and `Pending` rows `Failed`, runs `scripts/update_cli.php --update_db`, records the outcome and sets `$cron_dispatch_stop_cycle`. `cron/cron.php` exits before its heartbeat while `backupRestoreInProgress()`. `cancel_restore` removes a request. Uploads: `backup_upload` in one request, or `backup_upload_start`, `backup_upload_chunk` and `backup_upload_finish` from `js/backup_restore.js` (JSON, the upload in the session, pieces of `backupRestoreChunkBytes()` appended to `upload_.part`, retried smaller when a proxy refuses), then `backupRestoreAdopt()` lists it with source `Uploaded`. The Restore window is `admin/modals/backup/backup_restore.php`, opened from a row's menu or by `?restore=`; `backupMadeBy()` words a row's source. All locked in the demo. From Mountaineer IT's build of ITFlow. - Database 3.8.0: `user_cost_rates` (`user_cost_rate_user_id`, `_from`, `_hourly`, `_created_by`, `_created_at`, one a day per agent) and `config_labor_cost_default` (NULL leaves time uncosted) - `laborCostReady()`. `functions/labor_cost.php`: `laborCostRates()`, `laborCostRateOn()` (the newest rate on or before the day, the first also before it, else the default), `laborCostRateSave()`, `laborCostRateDelete()`, `laborCostParse()`. `admin/labor_costs.php`, `admin/modals/labor_cost/labor_cost_rates.php` and `labor_cost_default.php`, handlers `add_labor_cost_rate`, `delete_labor_cost_rate` and `edit_labor_cost_default` (`admin/post/labor_cost.php`). `agent/reports/client_profitability.php` calls `laborProfitAdd()` before net - `?basis=invoiced` replaces income with `item_subtotal` less `invoice_discount_amount` on Sent, Viewed, Partial and Paid invoices by `invoice_date`, plus revenue; labor by `ticket_reply_by` and day; parts as `product_cost * item_quantity` - and `laborProfitFinish()` after it for profit, margin, `hours_month` and `break_even`; the columns, totals, basis switch (`laborProfitBasis()`, paid by default) and second stats row are there only with 3.8.0. From Mountaineer IT's build of ITFlow. - Database 3.8.1: `users.user_service_account` - `serviceAccountsReady()`, `serviceAccountIs()`, `serviceAccountSave()` (`functions/service_account.php`). `serviceAccountsOutSql($column)` adds ` AND user_service_account = 0` to the agent lists and pickers (tickets, recurring tickets, projects, contracts, calendar and events, ticket templates, bulk assign, exports, reports, client onboarding, Quick ticket, mentions, trips, expenses, labor costs, Getting Started's team, user archive's hand-over, incident response) and to `appNotify()`, `signInAdmins()`, `cronHealthRecipients()` and the last-admin checks (`userActiveAdminCount()` in `functions/user.php`, `roles.php`). Not to `apiKeyAgents()`, the API's own checks (`api/v1/enforce_api_rbac.php`) or `getActiveAgentUserCount()`. `login.php` matches agents with `user_service_account = 0`, and `includes/load_user_session.php` ends a service account's session. The switch is `service_account` with `service_account_present` on `admin/modals/user/user_form.php`'s Sign in tab, saved by `add_user` (an invite with it is refused) and `edit_user`. `admin/users.php` adds the `service` view and excludes them from the others but `archived`. From Mountaineer IT's build of ITFlow. - Database 3.8.2: `tickets.ticket_schedule_end` (NULL is `CALENDAR_TICKET_MINUTES` after the start) and `recurring_tickets.recurring_ticket_schedule_minutes` (default 60) - `ticketScheduleEndReady()`. `ticketSetSchedule($row, $schedule, $onsite, $end = null)` keeps the end (cancelling clears it) and `ticketScheduleIcs()` and `createiCalStr(..., $uid, $end)` write it as DTEND. `ticketScheduleEnd()`, `ticketScheduleMinutes()`, `ticketScheduleMinutesValue()` (15 to 1440), `ticketScheduleLengths()`, `ticketScheduleLengthText()`, `ticketScheduleWhenText()` and `ticketScheduleShortText()` word it; `ticketScheduleOverlapSql($from, $to)` finds bookings running into a range, used by the calendar's tickets source, the agent feed and `ticketScheduleConflicts()` (overlapping tickets and timed calendar events of the agent). `edit_ticket_schedule` takes `schedule_tech` (one of `ticketMentionAgents()`, given the ticket with `ticketChangeAssignee()`, the old agent sent `ticketMailScheduleAgentCancelled()`) and `schedule_minutes`; `add_ticket` and the recurring ticket handlers take `schedule_minutes`, and `recurringTicketBook()` books that long. `calendar_move` (`agent/ajax.php`) takes an `end` from a resize, or keeps the length on a move; ticket items are `durationEditable`. From Mountaineer IT's build of ITFlow. - Database 3.8.3: `recurring_tickets.recurring_ticket_by_day` and `calendar_events.event_repeat_by_day`, an RFC 5545 BYDAY value (`3WE`, `-1FR`; NULL is the same date) - `byDayReady()` and the helpers in `functions/by_day.php`: `byDayRule()`, `byDayDate($year, $month, $rule)`, `byDayText()`, `byDayOptions($date)` (the rules a date can take), `byDayForDate()` (a posted rule, kept when the date takes it), `byDayFollow()` (a rule carried to a moved date) and `byDayField()`, the Repeats on picker filled by `js/repeat_on.js`, which posts `repeat_on` with `repeat_on_field`. `recurringTicketNextRun()` takes `$by_day` for month-based frequencies, passed by every caller, and `recurringTicketByDaySql()` saves it for `add_recurring_ticket`, `edit_recurring_ticket`, the bulk next run and `recurring_tickets/create` and `update` (`repeat_on`). `calendarEventFormSet()` saves `event_repeat_by_day` from `repeat_on`, or follows `repeat_on_current`; `expandRecurringEvent()`, `calendarRepeatText()` and `icsRepeatToRrule($repeat, $interval, $until, $all_day, $timezone, $by_day, $start)` (BYDAY, with BYMONTH for yearly) use it, through `calendarEventByDay()`. `events/create` and `update` take `event_repeat_by_day`. From Mountaineer IT's build of ITFlow. - Database 3.8.4: `user_settings.user_config_calendar_color` (NULL is `calendarAgentDefaultColor()`, one of `CALENDAR_AGENT_COLORS` by user id) and `user_config_calendar_state` (JSON, `all` and `client`) - `calendarAgentSettingsReady()`. `calendarAgentColor()`, `calendarAgentColors()`, `calendarFirstName()`; `calendarAgentColorField()` (Account > Preferences, Admin > Users' Edit) posts `calendar_color` and `calendar_color_auto`, saved by `calendarAgentColorSave()` in `edit_your_user_preferences` and `edit_user`. The tickets source colors each booking by `ticket_assigned_to` and adds `agent_name` and `agent_full` (the name leaves `detail`); `calendarEventItems()` ends with `calendarEventItemsAgents()`, which colors an event by its attendee agents and leaves out of one agent's calendar an event assigned only to others. `calendarEventAgents()`, `calendarEventAgentChoices()`, `calendarEventDefaultAgents()` (New Event's `agent_id`), `calendarEventSetAgents()` and `calendarEventAgentsText()`; `assign_event` (`agent/post/event.php`) is the quick look's. `calendarLeftBehindSql()` and `calendarLeftBehindTickets()` behind `ajax.php?calendar_left_behind`, and items left behind get `itflow-cal-left-behind`. `ajax.php` `calendar_state` saves through `calendarUserStateSave()` and `calendarCleanState()` (`CALENDAR_VIEWS`); `agent/calendar.php` reads `calendarUserState()` into `data-saved-state`, which `agent/js/calendar.js` prefers to `localStorage`. `calendar_unscheduled` takes `user_id` 0 as everyone's, with `agent`. The `holidays` source reads `business_holidays`. The `timeGridSevenDays` view and `slotEventOverlap: false`. From Mountaineer IT's build of ITFlow. - Database 3.8.5: `ticket_helpers` (`ticket_id`, `user_id`, `follows_lead`, `schedule_start`, `schedule_end`, `added_by`, `added_at`; the lead stays `ticket_assigned_to`) - `functions/ticket_helpers.php`: `ticketHelpersReady()`, `ticketHelpers()`, `ticketHelperNames()`, `ticketHelpersTidy()` (a row for whoever is now the lead is cleared once a request, its booking cancelled and `ticketHelperLeadInvite()` sent), `ticketAssignedSql()` (Mine, the assigned filter and the dashboard's My tickets), `ticketHelperSave()`, `ticketHelperRemove()`, `ticketHelperMail()` (`ticketAgentEmailContent()`'s new `helper` kind; its own UID, `ticketHelperUid()`), `ticketHelpersLeadMoved()` from `ticketSetSchedule()` (their clashes join its conflicts), `ticketHelpersLeadCancelled()` from `ticketCancelSchedule()`, `ticketHelpersMailReplied()` from `ticketMailAssigneeReplied()`, `ticketHelperCalendarItems()` (kind `helper`, in the tickets source), `ticketHelperFeedItems()`, `ticketHelperDashboardItems()` and `ticketHelperConflicts()` (in `ticketScheduleConflicts()`). Helpers are `ticketMentionAgents()`. `agent/modals/ticket/ticket_helper.php`, `agent/post/ticket_helper.php` (`save_ticket_helper`, `remove_ticket_helper`), `ticketHelpersBadge()` in the list and board, and `calendar_move` with `kind` `helper` (their own time). From Mountaineer IT's build of ITFlow. - Database 3.8.6: `user_settings.user_config_timezone` (NULL is the company's) - `functions/user_timezone.php`: `timezoneUsersReady()`, `timezoneOwn()`, `timezoneOf()`, `timezoneView()`, `timezoneShifted()`, `timezoneConvert()`, `timezoneToView()` and `timezoneFromView()`; `timezoneField()` and `timezoneSave()` (`edit_your_user_preferences`, posting `timezone`). Times go out on the viewer's clock and come back in the company's: `calendar_items` and `calendar_day` turn the days asked for with `timezoneFromView()` and the items with `timezoneItems()`, `calendar_move` takes `timezoneMovePost()`, `add_event` and `edit_event` take `timezoneEventPost()`, `edit_ticket_schedule`, `add_ticket` and `save_ticket_helper` turn `scheduled_date_time` and `schedule` back, and the event form, Schedule window and helper window show `timezoneToView()` with `timezoneFormHint()`. `ticketScheduleShortText()` is on the viewer's clock with `timezoneAbbr()`; `timezoneEventWhenText()` is the quick look's; `agent/calendar.php` has `data-zone` and `timezoneNote()`, and `agent/js/calendar.js` sets `now` from it. `ticketMailSchedule($row, $cal_str, $cancelled, $when_text, $start, $end)` and the helper emails give the agent's time with `timezoneWhenFor()`. From Mountaineer IT's build of ITFlow. - Dispatch (`agent/dispatch.php`, `agent/js/dispatch.js`, `functions/dispatch.php`): `dispatchCan()` (Support at View), `dispatchCanEdit()` (`calendarCanScheduleTickets()`), `dispatchAgents()` (active agents who are admins or have Support at Modify, with `calendarAgentColor()`), `dispatchState()` / `dispatchStateSave()` (the `dispatch` key of `user_settings.user_config_calendar_state`, which `calendarUserStateSave()` now keeps: `view`, `hidden`, `weekends`), `dispatchBusinessHours()` and `dispatchWorkingDay()` from `getSlaSettings()`, `dispatchQueue($tab, $filters)` (`unassigned`, `unbooked`, `left_behind` via `calendarLeftBehindSql()`, with each tab's count), `dispatchItems($from, $to, $agent_ids)` (the tickets, helper bookings, events and holidays sources per agent, `extendedProps.agent` and `reference` added, only tickets and one-off events editable, through `timezoneItems()`), `dispatchBook()` (`ticketChangeAssignee()`, `ticketMailScheduleAgentCancelled()` for the agent who had it, then `ticketSetSchedule()`), `dispatchUnbook()` (`ticketCancelSchedule()`), `dispatchAssign()` (refused for a booked ticket), `dispatchEventMove()` (a one-off event in time and from one agent to another with `calendarEventSetAgents()`, `calendarSendInvites()` with `update` to those who have it), `dispatchWorkload()` with `dispatchWorkloadFlags()`, and `dispatchWeekStats()` (tickets given this week read from the `assigned the ticket to ` history lines). `agent/ajax.php`: GET `dispatch_queue`, `dispatch_items`, `dispatch_workload`, `dispatch_week`; POST (CSRF) `dispatch_state`, and with `dispatchCanEdit()`, after `timezoneMovePost()`, `dispatch_book`, `dispatch_unbook`, `dispatch_assign` and `dispatch_event_move` - JSON `{ok, message, conflicts}` or `{error}` with 400/403. `ticketSetSchedule()` and `ticketMailSchedule()` take `$tell_client` (default true) to leave the contact and watchers out. Day is a FullCalendar `timeGridDay` per agent in one scroller (`drop` for the queue's `FullCalendar.Interaction.Draggable`, `eventReceive` between columns, `eventDragStop` over the queue to unbook); Week and Workload use SortableJS. From Mountaineer IT's build of ITFlow. - Database 3.8.7: `quote_items.item_cost`, `item_price_method` (`markup`, `margin` or `price`) and `item_price_percent` - the names MountaineerIT's build uses - and `config_quote_price_method`, `config_quote_price_percent` and `config_quote_price_presets` - `quotePricingReady()`. `functions/quote_pricing.php`: `QUOTE_PRICE_METHODS`, `quotePricingSettings()` (read from `settings` directly, not `load_global_settings.php`), `quotePriceFromCost()`, `quotePricingFromInput()`, `quotePricingSetSql()` - `billingItemSave()` takes `pricing` with `cost`, `price_method` and `price_percent` on a quote, and gives a new line from a product its `product_cost` as a set price - `quotePricingCopySql()` (`add_quote_copy`, which now also keeps `item_product_id`, and `billingCopyLines()` to a quote), `quotePricingMethodNow()` (a markup or margin whose price was changed by hand reads as a set price), `quotePricingLineHtml()` (under the line in `includes/billing_paper.php` while `edit`) and `quotePricingFields()` with `itflowBillingPricingForm()` in `js/billing_items.js`. `billingItems()` returns the three columns for a quote; `billingMargin()` uses `item_cost` before the product's cost. The API's quote line read returns them as it returns every column. From Mountaineer IT's build of ITFlow. - Database 3.8.8: `quote_items.item_image`, `products.product_image` (paths under `uploads/`, the names MountaineerIT's build uses; their `uploads/mit_images/` files are taken as they are) and `config_quote_show_images` - `quoteImagesReady()`, `quoteImagesShown()`. `functions/quote_images.php`: `quoteImageStore()` redraws a JPG, PNG, GIF or WebP with GD at up to 800 pixels a side into `uploads/quote_images/<32 hex>.jpg|png`; `quoteImageFromUpload()`, `quoteImageFromUrl()` (the image, or a page's `og:image` / `twitter:image` / `image_src`) through `quoteImageFetch()` - http(s) on ports 80, 443, 8080 and 8443, every resolved address checked by `quoteImageIpIsPublic()` and pinned with `CURLOPT_RESOLVE`, no proxy, three redirects each checked, 8 MB and 25 seconds in all; `quoteImageSave($table, $id, $in, $files)` for `item_image` / `product_image` with `_url` and `_remove`, `quoteImageField()`, `quoteImageThumbHtml()`, `quoteImageFromProduct()` (a new quote line in `billingItemSave()`), `quoteImageCopySql()` (`add_quote_copy`, `billingCopyLines()` to a quote) and `quoteImagesDeleteFor()` (`billingItemDelete()`, `delete_quote`, deleting a client from the page or the API, the API's quote delete, demo data); `productDelete()` throws the product's away. `includes/billing_paper.php` and `billingPdfRender()` show it; the Edit Line and product windows post `multipart/form-data`, and `js/app.js` previews the file picked. From Mountaineer IT's build of ITFlow. ## [26.11.8] ### Upgrading Update from Maintenance > Update — Queue Update hands the job to cron, which updates the files and applies this release's one database change (3.6.5 to 3.6.6) in the same pass. It adds indexes to the audit log and to tickets: a few seconds on most installs, about 2 seconds for every million audit log entries on one with years of them. Nothing else is required. If clients have signed contracts with you, read the first Contracts entry under Bug Fixes: a signed copy may give shorter response times than the ones your SLAs time tickets by. From 26.11.6, the same update also brings 26.11.7 - its two database changes (3.6.3 to 3.6.5) are applied in the same pass, and an install whose database update stopped at `Duplicate column name 'software_template_id'` carries on from there - see its notes below. From 26.11.3 or earlier, it also brings 26.11.4 and its database changes. ### New Features & Updates - Invoices, quotes and recurring invoices: lines are added and changed on the page itself, and it no longer reloads each time. Under the lines there is one field in place of the row of boxes. Type a product's name or code and pick it - Enter takes the one picked out - and it goes on as a line at once, with its description, price and tax; on a quote it is billed as that product usually is, and on a recurring invoice counted per user or per device when that is how the product is set up. For a line that isn't one of your products, type what it is and press Enter, or pick Add at the bottom of the list. The new line's quantity is then ready to type over: Enter moves on to its price when it has none yet, and then back to the field for the next line. - Invoices, quotes and recurring invoices: click a line's name, description, quantity, price or tax to change it where it is. Enter, or clicking somewhere else, saves it; Escape puts it back; Tab goes on to the next. In a description Enter starts a new line, and Ctrl+Enter saves. Tax opens the list of rates. The line's amount, the totals, the amount due and the cards beside the page - balance, margin, hardware - follow as you go, and what you typed shows faded until it is saved. A line with no description shows where one goes while you are working on it. From the keyboard, Tab to any of them and press Enter. The Edit window is still in each line's menu, and is where a recurring invoice's line is set to count users, devices or license seats - a quantity that is counted can't be typed over. - Quotes: a line's menu has Billed - One time, Monthly, Quarterly or Yearly - so how often a line is billed changes in one click, and the line moves under its heading. - Backups: Maintenance > Backup is rebuilt so that its first line answers what you open it for - is this ITFlow backed up? The top of the page says when the last backup was made, what kind it was and when the next scheduled one is due. When something needs you, it says that instead: a backup is being made now, the last one didn't finish and why, there hasn't been one for a week, none has been made yet, or one has been waiting because cron isn't running. Back up now and Database only are right under it. - Backups: the page keeps itself up to date while a backup is being made, and shows it in the list as soon as it is done. It used to say it wouldn't refresh, and you reloaded to find out. - Backups: the list of backups works like every other list - it sorts by its headings and has pages - and says more about each one: who made it or that the schedule did, when it was last downloaded, and why one failed. A backup's menu copies its path on the server, which is what restoring from the command line asks for, and its SHA-256 checksum, for checking a copy kept somewhere else. A backup still waiting to be made can be taken off the queue. - Backups: the nightly backup is on the page. It shows whether the schedule is on and at what time, with Turn on and Change the time beside it, so there is no trip to Maintenance > Cron. Beside the page, At a glance has the last Full Backup and the last Database Only, how many backups are kept and the room they take, the free space left where they are kept, and whether cron is running. - Backups: the encryption key is hidden until you click the eye, with a button to copy it; it used to sit on the page in full for anyone looking at the screen. Exporting the master key opens a window that asks for your password and says what will happen before it does. - Cron: Maintenance > Cron is rebuilt so that its first line answers what you open it for - is cron running? The top of the page says when it last ran, how many jobs are on and which runs next. When something needs you, it says that instead: cron has never run on this server or has stopped, with the line to add to the server's crontab and a button that copies it; cron is switched off, with Turn cron on; or a job failed, by name. - Cron: each job says what it does, its schedule and when it next runs, when it last ran and how long that took, and how it went. A job that failed says why under its name, and goes on saying so until you dismiss it - with a note once it has run since, so an old failure doesn't read as a new one. A job that skipped its run says why too: texting isn't set up, there is no Stripe provider, nothing was queued. - Cron: the page keeps itself up to date. After Run now a job shows as queued, then running, then how it went, without a reload. And on a new server, once the cron line is in, the page says cron is running by itself. - Cron: a job's menu has Run now, Change the schedule, Turn off - which asks first - and Copy the command to run it, which copies the command that runs that one job on the server, where it shows what it does as it goes. The list sorts by its headings, and starts in the order the day runs: the every-minute jobs, then the nightly ones by time. - Cron: beside the page, At a glance has whether cron is running, when it last ran, how many jobs are on and off, any that failed, what runs next, and the time zone the schedules are in. Turn cron off, which stops every job at once for a restored backup or a test copy, asks first and says what stops. - Update, Backup and Cron: a page that is keeping itself up to date no longer reloads under you. It waits while a window or a menu is open, while you are typing in a field, and while you have text selected to copy. - SLAs: Admin > SLAs is rebuilt as a list like every other - it searches, sorts by its headings and has pages - with the settings beside it instead of stacked under it. Each SLA shows what its targets come to in business time as well as the hours typed: with a 9 to 5 day, 48 hours reads 6 business days, with 48 hours under it. It also shows the priorities it is the default for, and what uses it - open tickets, contracts and contract templates. - SLAs: a target is typed as hours and minutes, not as a count of minutes, and the window says what a day's worth comes to with your business hours. An SLA with no name or no response target, or with a resolution target shorter than its response target, is refused with the reason. - SLAs: archiving an SLA says first what stops getting it - the priorities it is the default for and the contracts that give it - and that tickets already on it keep their targets. A priority whose default has been archived says so, where it used to read None. - SLAs: holidays and closure days are views of the same list, coming up and past, searched by name, date, month or day of the week. Each shows its date and how far off it is, and one that falls on a day you're shut anyway says so. Add US holidays opens a window that says how many of each year's are already in and offers the first year with some to add. Removing a day asks first, and says what changes. - SLAs: beside the list, Default SLA by priority uses the select picker, with each SLA's targets under its name. Business hours and alerts has the business days as buttons, the hours, when to warn and who else to email, and says when cron isn't running, as no warning goes out without it. On tickets now counts the open tickets with an SLA, those close to a target and those that missed one, each a link to the tickets. - Speed: six pages read every entry of their table each time they opened, and do so no more - on an ITFlow with years behind it they now open in a fraction of the time. On a test install with eight years of data (a million audit log entries, 280,000 tickets, 70,000 invoices and 100,000 payments, income and expenses): Admin > Audit Logs from 2.5 seconds to 0.16, and to a few hundredths filtered to one person or client; Admin > Sign-ins from 0.4 to 0.17, and By IP from 1.8 to 0.23; Admin > Users from 1.1 seconds to a hundredth; Transactions from 1.1 seconds to 0.27, and one account's transactions, with the balance after each line, from 1.0 to 0.25; Income from 0.73 to 0.25; Invoices from 0.43 to 0.15. Every count, total and row is the same as before. ### Bug Fixes - Backups: the list showed only the newest 100. Older backups were still on the server, taking up room, with no way to download or delete them from the page. Every backup can now be reached. - Backups: the window for exporting the master key said the key "is not written anywhere". An encrypted copy is filed with the other backups; the window now says so, and that every agent is notified of the export. - SLAs: business hours saved with the day ending before it starts were accepted, and SLA clocks then ran around the clock without saying so - a 4-hour target given late on a Friday came due that evening. They are now refused, with how to set cover around the clock. A warning percent outside 1 to 99 is kept within it. - SLAs: the message after saving an SLA with an apostrophe in its name showed a backslash in it. - Contracts: a contract's response times - on its page, in its window and in the document the client signs - were worded in plain time, where SLA clocks count only your business hours. With a 9 to 5 day, a 48-hour resolution target read "2 days" and a 24-hour one "24 hrs", where the clock gives 6 and 3 business days. They now read as the clock counts them - "4 business hours", "6 business days" - the same as Admin > SLAs and the emails to clients. A contract already signed, or out for signature, keeps the wording it was sent with and is not marked as changed. Open the signed copy of any contract whose targets run to a business day or more: if it promises more than you meant, set the SLA's targets to what you meant in Admin > SLAs, or send the contract to be signed again. - Contracts: because the wording now follows your business hours, changing them changes what a target of a business day or more comes to. A contract signed from this release on is then marked as changed since it was signed, as it is when its SLA's targets are changed. - Dashboard: it could take seconds to open - 2 seconds on one install, over 20 on a test one - on an ITFlow with many assets that weren't made from an invoice, which is most of them. The Hardware not on assets count was to blame, and the invoices list it opens, with Hardware not on assets as its filter, was as slow. Both are back to a few hundredths of a second, and every number is the same as before. - Projects: the projects list, and its Stalled and Ready to close views, could take seconds to open - over 5 on a test install - where no ticket was on a project yet, or very few were. They open at once. - Invoices: opening an invoice read through every ticket to find the ones billed on it - three quarters of a second with 280,000 tickets. It finds them directly. - Sign-ins: people or addresses that tied on what the list was sorted by could come back in a different order each time, and so turn up on two pages or on none. They keep one order. ### Developer Updates - `agent/ajax.php` gains `billing_item_add` and `billing_item_set`, which do for the page what `post.php`'s `billing_item_save` does for the Edit Line window, with the same checks (CSRF, `module_sales` at 2, the client-scoped row, client access, `billingCanEditItems()`), and answer `{status: 'success', item_id}` or `{status: 'error', message}` - with `reload` when the document can't be changed any more. `billing_item_add` takes what `billingItemSave()` does; a line with no `tax_id` gets `taxDefaultFor()` for the client. `billing_item_set` takes `item_id`, `field` (`name`, `description`, `qty`, `price`, `tax_id`, or `frequency` on a quote) and `value`. - `billingItemSetField()` (`functions/billing.php`) changes one thing about a line: it reads the line, replaces the one value and hands the whole line to `billingItemSave()`, so stock, the discount's share of the tax and the totals follow exactly as from the Edit Line window. A value the line already has saves nothing and logs nothing. A counted quantity is refused, as is any field but the tax on a line whose rate has been deleted. It gives back what changed for the audit log, which now says it: "edited line Managed Firewall on INV-54 - quantity 1 to 2". - `js/billing_items.js` is rewritten around this. Saves go to `ajax.php` one at a time, in the order they were made, so two fields changed quickly can't overwrite each other. After a save the page asks for its own address again and takes from the answer the lines and every element marked `data-billing-live` - the totals and amount due in `includes/billing_paper.php`, and the header card, tax warning and side column on `agent/invoice.php`, `quote.php` and `recurring_invoice.php` - so how a line, a total or a card looks is still written once, in PHP, and nothing is drawn twice. Lines are matched by id and kept, a cell with a field open in it is left alone and brought up to date when the field closes, and a redraw that a later save has overtaken is dropped. When the answer is no longer editable - the change paid the invoice off, or it was answered meanwhile - the page reloads. An answer that isn't JSON (signed out, an expired token) reloads too; a server that can't be reached says so and puts the field back. - `includes/billing_paper.php`: where `edit` is set, what can be changed is wrapped by `$paper_field()` as ``, the paper carries the products (`