diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f707d471..620446a39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1037,6 +1037,11 @@ If you are coming from 26.08 or earlier, the database update still has to be run - Why an email failed is kept with it - the mail server's own answer, an address that isn't one, no from address, a domain with no mail server - and shown under its status and searched. Cancelling keeps who cancelled it. The alert for a failed email says why and when it is tried again, and when ITFlow gives up after the last try there is an alert for that too, each opening the Mail Queue on its tab. - Opening an email shows where it stands and why, who it is to and from, when it was queued, how many tries it has had, when it was sent or last failed, its attachments and calendar file - and the email itself as it will arrive, rather than stripped of its layout. A sent one says what it said was cleared on sending, and why. Retry now, Cancel and Delete are in the window too. - Without opening it: the Settings overview says when email failed to send in the last day, and when the queue isn't moving, and the Mail tile how many failed this week; the Mail Queue menu item carries the same count; Mail's Tests tab shows when mail was last sent and what is waiting, retrying or failed. The Mail Queue is in the search window (Ctrl K) for admins, and the test email says where to watch it go. +- **Payment Providers** (rebuilt) + - Admin > Payment Providers lists each provider with whether it is on, live or test (as its keys say), the account its payments go into, its card limit, whether its fees are recorded as expenses, its saved cards and the autopay on them, and when a card payment last came through it. Search, sort by any of them, and Saved Cards from the top. + - A provider can be turned off and on again: off, clients can't pay by card and autopay with its cards is skipped, while its cards are kept. Delete says first what goes with it - its saved cards, the autopay on them and its links to clients - and suggests turning it off instead. + - Add and Edit are one window. The secret key is no longer put into it - left empty, it stays as saved. Save checks first: keys that aren't Stripe's, one live and one test, a card limit that isn't money, or fees with no vendor or category are said beside the field, and new keys are checked with Stripe - before anything is saved, and without closing the window or losing what was typed. Fees have one switch, Record its fees as expenses, with who they are paid to and their category. The card limit is shown in your currency. + - The audit log says what changed, from what to what - "Card limit No limit → Under $2,500.00", "Mode test → live" - with the keys only as changed. ### Bug Fixes @@ -1192,6 +1197,8 @@ If you are coming from 26.08 or earlier, the database update still has to be run - Settings > Mail: a From address that wasn't an email address was saved blank, and From names lost their punctuation - "PittPC, LLC" was saved as "PittPC LLC". - Settings > Mail: a password or secret lost a space at either end when saved, and anything from a < up to the next > (or to its end). - Settings > Mail: pressing Enter on the OAuth tab went off to Microsoft to connect, rather than saving. Changing the OAuth app or its refresh token went on using the old access token until it ran out. +- Payment Providers: a Stripe key that Stripe turned away was saved anyway, with an error after; the Edit window showed the secret key; saving it logged and said an empty provider name, with PHP warnings; the Enable Expense switch did nothing; and there was no way to turn a provider off. +- Accounts: archiving the account online payments go into pointed to Admin > Settings > Online Payment, which no longer exists - it is Admin > Payment Providers. - Settings > Notifications, and recurring invoices: the note that recurring invoices are made as drafts pointed to the billing settings, but the switch is in Notifications. - Mail Queue: cancelling an email marked it Failed, and an email to a bad address or with no from address showed Failed with no time. - Mail Queue: Resend was only offered once all four tries were used up, and the next failure quietly gave a resent email three more. @@ -1760,6 +1767,7 @@ If you are coming from 26.08 or earlier, the database update still has to be run - Settings: Tickets, Projects, Quotes, Invoices and billing and Defaults use the frame. New in `functions/settings.php`: `settingsNumbering($kind)`, `settingsNumberInUse()`, `settingsNumberingCheck($kind, $post, $saved)` (prefix and next number checked against the highest in use with that prefix - skipped when both are as saved, so a clash already there doesn't block the rest of the page) and `settingsNumberingFields()` (with `[data-settings-next]` in `js/settings.js`, and `[data-settings-depends-on=name]` to fade fields while a switch is off); `settingsEmailProblem()`; `settingsStartPages()`, `settingsStartPageProblem()` and `settingsNetTerms()`. `settingsSectionStart()` takes the section's element id, so `#reminders`, `#billing-time`, `#billable-expenses` and `#mileage` still work; `settingsSelect()` takes `options_html`, `append` and `search => false`; `settingsSwitch()` takes `id`. `settingsSame()` treats NULL as 0 or empty and ignores Windows line ends; the log names accounts, calendars and categories. Values kept from a refused save are only used for five minutes. These handlers keep a setting that isn't sent (`$_POST + saved`), a switch not sent being off. Defaults' fields are renamed to their columns (`config_start_page`, `config_default_*`). The start page is escaped where it is printed. - Settings: Notifications, Security, Client portal, Single sign-on (`admin/identity_providers.php`), Mail and Logs use the frame. `settingsSearch($query, $limit)` scores settings as Find a setting does, leaving out pages for a module that is off; `agent/ajax.php?global_search` returns them as `settings` for admins and `js/global_search.js` shows them under Settings. Single sign-on's fields are renamed to their columns (`config_azure_client_id`, `config_azure_client_secret`). A field marked `quiet` in `settingsFields()` is logged as changed without its value (the login key). The Logs handler is unchanged. - Settings: Mail's Sending, Receiving, OAuth and From addresses tabs use the frame, and every Mail column is in `settingsFields()`. Its handlers save through `settingsSave()` and `settingsWrite()`, logging from -> to; `edit_mail_smtp_settings` and `edit_mail_imap_settings` share one check, and both come back to their tab when refused. A password, secret or refresh token posted empty keeps what is saved; an empty OAuth client ID forgets its secret and refresh token; a changed app or refresh token clears `config_mail_oauth_access_token` and its expiry, so it is fetched again. The access token is no longer a field. `oauth_connect_microsoft_mail` saves the same way before going to Microsoft, and `admin/oauth_microsoft_mail_callback.php` now stores only the tokens. New in `functions/settings.php`: `settingsMailProviders()`, `settingsMailEncryption()` and `settingsEnterSaves($button)` - a hidden Save placed first in a form whose first button would otherwise be another (Mail's OAuth tab, Logs). `settingsRefuse()` takes the page to go back to; `settingsInput()`, `settingsSelect()` and `settingsTextarea()` take `id`; `settingsWrite()` writes a `secret` field exactly as given, rather than through `escapeSql()`, which trims and strips tags. +- Payment Providers: new `functions/payment_provider.php` - `paymentProviderKinds()` (the providers ITFlow takes payments through and what their keys look like), `paymentProviderMode()`, `paymentProviderRow()`, `paymentProviderTies()` and `paymentProviderTiesText()`, `paymentProviderLimitText()`, `paymentProviderCheck($post, $before)`, `paymentProviderKeysChanged()`, `paymentProviderAsk($name, $secret_key)` (Stripe's account, from the secret key), `paymentProviderChangeLines()` and `paymentProviderWrite()`, which saves the keys exactly as given. `check_payment_provider` answers in JSON - `ok`, `errors` by field and the Stripe `account` - and the window asks it before saving; a key it has had taken isn't asked about again on the save, for ten minutes. New handlers `turn_payment_provider_off` and `turn_payment_provider_on` (GET with the CSRF token). `payment_provider_add.php` opens `payment_provider_edit.php` with no id. Field `record_fees` replaces `enable_expense`; `active` and `description` are new. `admin/post/payment_provider_model.php` is gone. - Removed, as nothing reached them or they couldn't run: `admin/settings_custom_fields.php` (it required a modal that no longer existed) with `admin/post/custom_field.php`, `admin/post/custom_field_model.php` and `admin/modals/custom_field/`; `admin/post/settings_ai.php` and `admin/post/settings_online_payment.php`, which wrote the `config_ai_*` and `config_stripe_*` columns dropped in 2.3.2; `admin/post/settings_online_payment_clients.php`, and `agent/client_autopay.php`, which read the dropped Stripe columns and was linked from nowhere. The `custom_fields` and `custom_values` tables stay as they are, and the client export still includes asset custom field values. - Mail Queue: new `functions/mail_queue.php` - `MAIL_QUEUE_TRIES` (4), `MAIL_QUEUE_RETRY_MINUTES` (30) and `MAIL_QUEUE_KEEP_DAYS` (90), which `cron/mail_queue.php`'s retry pass and the nightly clean-up now use too; `mailQueueTabs()`, `mailQueueState($row)`, `mailQueueCan($row, $action)`, `mailQueueAct($action, $ids)` and `mailQueueHealth()`. `email_status` 4 is Cancelled - never selected by the worker. Retry now sets status 0, no attempts and no failure time. Handlers: `retry_mail`, `cancel_mail`, `delete_mail` (GET with the CSRF token) and `bulk_retry_emails`, `bulk_cancel_emails`, `bulk_delete_emails`; `send_failed_mail` still works. The worker sets `email_failed_at` on the bad sender, bad recipient and no-MX paths. - Mail Queue: database 3.3.7 adds `email_queue.email_error` varchar(500) - why it last failed, or "Cancelled by ..."; cleared when sent or retried. The worker writes it on every failure path, through `mailQueueErrorSql()`, which leaves it out until the update has run, so an install between updating its files and its database still sends; `mailQueueErrorColumn()` does the same for reads. The retry pass's bad-recipient path now sets `email_failed_at`, so its backoff counts from that try. An alert (`appNotify`) when the retry pass gives up. The email's window shows the queued HTML in an iframe `srcdoc` with `sandbox="allow-popups allow-popups-to-escape-sandbox"` (no scripts, no same origin) and a `script-src 'none'` policy, instead of HTMLPurifier in the page. diff --git a/admin/modals/payment_provider/payment_provider_add.php b/admin/modals/payment_provider/payment_provider_add.php index 70664d8a3..c59c168b7 100644 --- a/admin/modals/payment_provider/payment_provider_add.php +++ b/admin/modals/payment_provider/payment_provider_add.php @@ -1,155 +1,9 @@ Payment Providers - Add. The same window as Edit + * (payment_provider_edit.php), with no provider yet. + */ -ob_start(); - -?> -