diff --git a/CHANGELOG.md b/CHANGELOG.md index 57c658b34..8aff90a97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,10 +52,12 @@ Update from Maintenance > Update — Queue Update hands the job to cron, which u - 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: client and asset imports read a file by its headings, so the columns can be in any order and any can be left out - only the name is needed. A file exported from the clients or assets list imports as it is, a file separated by semicolons works too, and files made from the old templates still import. -- Imports: clients take everything their export has, and more - 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, as the exports write it, keeps its country code. A client with no location or contact in the file no longer gets an empty one. -- Imports: assets take everything their export has, and more - Status, Primary IP (or DHCP), Primary MAC, Network, Link, Second Link and Client Link, Vendor, Order Reference, Install Date, Warranty Expire and Tags, besides what they took before. Assigned To, Location, Vendor and Network are the client's own, by name - Assigned To by email too. A row with no name is skipped instead of making a nameless asset. -- Imports: when one is done it says what couldn't be used - a date that isn't YYYY-MM-DD, a contact, vendor or tax rate it couldn't find, a heading it doesn't take. Long notes are no longer cut off. +- 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. ### Bug Fixes @@ -98,7 +100,7 @@ Update from Maintenance > Update — Queue Update hands the job to cron, which u - `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. -- `functions/import.php` reads an import's CSV by its headings: `importColumns()` names the clients' and assets' columns (key, label - the template's and the export's heading - and other headings taken for it, with the assets' details from `ASSET_SPECS`), `importCsvRows()` checks the upload and gives each row by key, sniffing comma or semicolon and skipping a byte-order mark, with no line length limit. A file whose headings match none of them and has the old template's column count is read by position (`importLegacyColumns()`). `importTemplateDownload()` writes the template from the same list, and the import windows list it with `importHeadingsText()`. Helpers for the cells: `importYes()`, `importDate()`, `importList()`, `importPhone()` (a + number split into dial code and number, by `phoneFormatRules()`), `importTagIds()`, `importTaxId()` and `importClientRecordId()`. The template downloads now need read access to Clients or Support. +- 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. ## [26.11.8] diff --git a/Clients-Template.csv b/Clients-Template.csv new file mode 100644 index 000000000..ed2699d8e --- /dev/null +++ b/Clients-Template.csv @@ -0,0 +1 @@ +"Client Name",Industry,Referral,Website,Lead,Abbreviation,Currency,"Tax ID","Tax Rate","Tax Exempt","Exemption Certificate","Exemption Expires","Hourly Rate","Payment Terms",Tags,Notes,"Primary Location Name","Location Phone","Location Address",City,State,"Postal Code",Country,"Primary Contact Name",Title,"Contact Phone",Extension,"Contact Mobile","Contact Email" diff --git a/agent/assets.php b/agent/assets.php index 88565941e..667e910cd 100644 --- a/agent/assets.php +++ b/agent/assets.php @@ -233,7 +233,7 @@ $search_noun = $type_filter ? $asset_type_tabs[$type_filter]['label'] : 'assets'