Repository navigation
Releases: xenroth/xen-inventory
Release list
v1.8.18 - Patch Release
= 1.8.18 — 2026-06-02 =
== Added ==
-
[Item Detail Page — Full Transaction History]
The borrow history table on the single-item detail page now shows ALL
transactions for the item, including returned records. Previously, fully
returned borrows (action changed to 'returned') and partial-return rows
were invisible once a return was processed. The table now includes an
"Action" column with a Borrowed/Returned badge, and partial returns are
annotated with "Partial ← #N" referencing the original borrow log ID.
Rows are ordered by most recent transaction (COALESCE date_returned,
date_borrowed) descending.
Affected:includes/models/class-inventory-log.php(get_public_logs_for_item),
includes/frontend/views/page-item.php. -
[Borrow History — Separate Borrow Notes and Return Remarks columns]
The single "Notes" column in all borrow history views has been split
into two distinct columns: "Borrow Notes" (notes recorded at the time
of borrowing) and "Return Remarks" (notes recorded at the time of
returning). This applies to the admin Borrow Log, the item meta-box
borrow history, the single-item detail page history table, and all
double-click detail modals across admin and frontend.
Affected:includes/admin/views/borrow-log.php,
includes/admin/views/meta-box-borrow-history.php,
includes/frontend/views/page-item.php,
assets/js/admin.js,assets/js/frontend.js.
== Fixed ==
- [Return Log — Reverse Chronological Order]
Confirmed and documented that the Return Log admin page orders entries
by date_returned DESC (most recent return at the top), ensuring the
most recent return transactions always appear first.
Affected:includes/models/class-inventory-log.php(get_return_logs).
v1.8.17 - Patch Release
= 1.8.17 — 2026-06-01 =
== Added ==
-
[Return Log — Return Type filter]
New "Return Type" dropdown added to the Return Log filter bar (Full /
Partial). Selecting "Partial" shows only partial-return rows
(source_log_id IS NOT NULL); "Full" shows only full-return rows
(source_log_id IS NULL). Submitting the filter resets pagination to page 1.
Affected:includes/admin/views/return-log.php,
includes/models/class-inventory-log.php,
includes/core/class-ajax-handlers.php. -
[Return Log — Top Pagination (tablenav)]
Pagination links now appear above the table as well as below it,
matching the standard WordPress admin list-table pattern.
Affected:includes/admin/views/return-log.php. -
[Return Log — Double-click Row Detail Modal]
Double-clicking any row in the Return Log now opens a read-only detail
modal showing: Item, Borrower (WP), Entity/Name, Contact, Tags, Return
Type, Source Borrow #, Qty Returned, Condition, Return Remarks, Returned
By, Borrow Date, Return Date, and Borrow Notes.
Affected:includes/admin/views/return-log.php,
assets/js/admin.js.
== Fixed ==
- [Dashboard Recent Activity — Return ordering]
The "Recent Activity" table on the Dashboard was ordering all rows by
date_borrowed DESC. Returned items (especially partial returns, which
insert a new row with the original borrow date) would not surface to the
top of the list after being processed.
Fix: Changed ORDER BY toCOALESCE(date_returned, date_borrowed) DESC, id DESC. Rows with a return date now sort by that date; open borrows
continue to sort by borrow date. Newly returned items appear at the top
of Recent Activity immediately.
Affected:includes/admin/views/dashboard.php.
== Changed ==
- [Dashboard What's New — trimmed to latest 3 versions]
The What's New card now lists only v1.8.17 (current), v1.8.16, and
v1.8.15 as collapsible details. All older version entries have been
removed to keep the card concise.
Affected:includes/admin/views/dashboard.php.
v1.8.16 - Patch Release
= 1.8.16 — 2026-06-01 =
== Added ==
-
[Partial Return Traceability — source_log_id]
When a borrowed item with multiple units is only partially returned, the
newly-created 'returned' log row now records which original borrow it came
from via a newsource_log_idcolumn in the database table.Previously, partial return rows appeared in the Return Log with no link
back to the originating borrow — you could see that units were returned
but not which borrow transaction they belonged to.Changes:
-
DB schema:
source_log_id BIGINT(20) UNSIGNED DEFAULT NULLadded to
wp_xen_inventory_logs.dbDeltaadds the column automatically on the
next admin page load after updating.
Affected:includes/core/class-activator.php. -
Model —
partial_return(): storessource_log_id = $log_id(the
original open borrow row's primary key) on every partial-return insert.
update_log()now acceptssource_log_idas an editable field.
Affected:includes/models/class-inventory-log.php. -
Return Log admin page: new Return Type column.
- Partial returns show an orange
Partialbadge and a
← Borrow #Nlink that opens the item's edit/history page. - Full returns (via close_log) show a green
Fullbadge.
Affected:includes/admin/views/return-log.php.
- Partial returns show an orange
-
Item Borrow History meta box: 'returned' rows that carry a
source_log_idnow displayPartial ← #Nbeneath the action badge so
admins can immediately see the origin borrow ID without leaving the
item edit screen.
Affected:includes/admin/views/meta-box-borrow-history.php. -
Return Log CSV export: two new columns added — Return Type
(Partial / Full) and Source Borrow # (the originating log ID, or
blank for full returns).
Affected:includes/core/class-ajax-handlers.php. -
CSS: added
.xen-badge--partial(amber-orange) badge style.
Affected:assets/css/admin.css.
-
v.1.8.15 - Patch Release
= 1.8.15 — 2026-06-01 =
== Fixed ==
-
[Date/Time — Root Cause: Double UTC Conversion on Saved Return Dates]
The real source of "June 2, 3:10 AM" when local time was 7:12 PM was a
round-trip mismatch in how user-entered return datetimes are stored and
read back:date_borrowedis auto-generated withcurrent_time('mysql', true)→
stored as UTC.date_returnedentered via adatetime-localinput is LOCAL time (the
browser never sends a timezone), but was stored as-is without conversion.- PHP reads every
date_returnedback withstrtotime( $value . ' UTC' ),
which is correct for auto-generated UTC values but incorrect for
user-entered local values — it treated 7:12 PM local as 7:12 PM UTC,
thenwp_date()added the +8h offset again → 3:12 AM next day.
Fix: Inreturn_item()andupdate_borrow()(class-ajax-handlers.php),
after sanitising the submitteddate_returnedstring, it is now converted
from the site's local timezone to UTC (new DateTime($val, wp_timezone())
→setTimezone('UTC')) before being passed toclose_log()/
update_log(). This ensures everydate_returnedrow in the DB is UTC,
consistent with the auto-generated fallback.
Affected:includes/core/class-ajax-handlers.php.
-
[Date/Time — Edit Form Pre-fill Shows UTC Instead of Local Time]
All three datetime-local inputs that pre-filldate_returnedwhen editing
a borrow record were calling plain string-reformat helpers that strip
seconds and replace the space with "T" — no timezone conversion. Users
editing a returned record would see the UTC time in the field (e.g.
11:12 AM) instead of local time (7:12 PM), making edits confusing.
Fix: NewutcToDatetimeLocal()/utcToDatetimeLocalVal()helpers added
toadmin.js,frontend.js, andcalendar.js. They apply
xenInventoryAdmin.utcOffsetMinutes/xenInventory.utcOffsetMinutes/
xenCalendar.utcOffsetMinutesto shift the UTC DB string to local time
before populating the input.date_duepre-fills are unchanged (stored
in local time already).
utcOffsetMinutesadded to thexenCalendarlocalised object in
includes/frontend/class-assets.php(was already present in admin and
frontend script objects).
Affected:assets/js/admin.js,assets/js/frontend.js,
assets/js/calendar.js,includes/frontend/class-assets.php.
v1.8.14 - Patch Release
= 1.8.14 — 2026-06-01 =
== Fixed ==
- [Date/Time Display — JavaScript Modals & Inline Edit] Three remaining
UTC-as-local display bugs inadmin.js:- Audit Log double-click detail modal — the "Date / Time" row was showing
the raw UTCcreated_atstring (d.createdAt) without any conversion.
Fixed: now usesformatUtcDateAmPm( d.createdAt )to display the correct
local time with AM/PM format. - Borrower List double-click summary modal — the "Last Borrowed" row was
showing the raw UTClast_borrowedstring fromdata-last-borrowed.
Fixed: now usesformatUtcDateAmPm( data.lastBorrowed ). - Borrow Log / Borrowers inline-edit save callback — after saving an edit
that includes a return date, the "Returned" cell was updated inline with
formatDisplay( dateReturned )which callsformatDateAmPmand treats
the UTC DB value as local time. Fixed: now uses
formatUtcDateAmPm( dateReturned )so the displayed time shifts to the
correct local timezone.
- Audit Log double-click detail modal — the "Date / Time" row was showing
v.1.8.13 - Patch Release
= 1.8.13 — 2026-06-01 =
== Fixed ==
- [Date/Time Display — All Views] All PHP date rendering across the plugin was
usingstrtotime()on UTC-stored datetime strings (date_borrowed,
date_returned,created_at,last_borrowed) without a timezone indicator.
This causedstrtotime()to treat the UTC values as local PHP server time,
displaying times offset by the UTC difference. Fix: appendedUTCto all
suchstrtotime()calls so PHP parses them correctly as UTC;wp_date()
then converts the timestamp to the site's configured local timezone before
display. Affected files:borrow-log.php,return-log.php,dashboard.php,
borrowers.php,meta-box-borrow-history.php,audit-log.php,
page-item.php,inventory-display.php,class-ajax-handlers.php. - [Date/Time Display — Missing Time Component] Several table columns showing
date_borrowed,date_returned, andlast_borrowedwere formatted with
date-only format (get_option('date_format')) omitting the time. Fix: added
g:i A(12-hour AM/PM) to the format string for all those columns. Also
added time to the inline "due" date shown on item cards in the inventory
display and to the "Due Date" column in CSV exports.
v1.8.12 - Patch Release
= 1.8.12 — 2026-06-01 =
== Fixed ==
- [Borrow Form — Item Single View — Expected Return Date] The "Expected Return
Date" field in the Borrow modal on the single item detail page
(/inventory-item/{slug}/) was a date-only input (type="date"), so the time
component was never collected or stored for borrows initiated from that page.
The equivalent field on the main inventory display page already used
type="datetime-local"and the label "Expected Return Date & Time".
Fix: changed the input inpage-item.phptotype="datetime-local", updated
theminattribute format toY-m-d\TH:i, and updated the label to
"Expected Return Date & Time" to matchinventory-display.php.
Affected:includes/frontend/views/page-item.php.
v1.8.11 - Beta Release
= 1.8.11 — 2026-06-01 =
== Fixed ==
- [Return Modal — Return Date & Time] The "Return Item" confirmation modal on
the frontend inventory display page and the single item detail page was
missing the "Return Date & Time" field, so returns always defaulted to the
current server time with no way to record a past or specific return datetime.
Root cause: the frontend Return Confirmation Modal HTML and the
xen-return-confirm-submitAJAX handler infrontend.jsomitted the
date_returnedfield that the admin return modal already supports.
Fix: adatetime-localinput and an "⏱ Now" shortcut button are added to
the Return modal in bothinventory-display.phpandpage-item.php. The
frontend.jssubmit handler now clears the field on modal open, handles the
"Now" button click, and passesdate_returnedin the AJAX POST to
xen_return_item(the backend already accepted this parameter).
Affected:includes/frontend/views/inventory-display.php,
includes/frontend/views/page-item.php,assets/js/frontend.js.
v1.8.10 - Beta Release
= 1.8.10 — 2026-06-01 =
== Fixed ==
- [Borrow Record Views — Borrowed / Returned Time] The "Borrowed" and
"Returned" datetime values shown in all detail modals (admin borrow-record
dblclick modal, admin borrower overview modal, frontend borrow-detail modal)
now display the correct local time instead of UTC.
Root cause:date_borrowedanddate_returnedare auto-generated and
stored as UTC in the database, but the JavaScript helpers (formatDateAmPm)
were rendering the raw UTC string without any timezone conversion, showing
the wrong time (offset by the site's UTC offset).
Fix: a newformatUtcDateAmPm()JavaScript helper is introduced in both
admin.jsandfrontend.js. It appends 'Z' to the UTC DB string so the
browser parses it as UTC, then shifts by the site's UTC offset (passed from
PHP asutcOffsetMinutesin the localised script objects) to produce the
correct local display time.formatDateAmPm()is retained unchanged for
date_due, which is stored in local time.
Affected: PHPwp_localize_scriptcalls in admin and frontendclass-assets.php.
v1.8.9 - Beta Release
= 1.8.9 — 2026-06-01 =
== Fixed ==
- [Borrow History — Due Date] Due dates displayed in all borrow history tables
and detail modals were shifted by the site's UTC offset. The root cause was
thatdate_dueis stored in the site's local timezone (direct user input),
butstrtotime()treated it as UTC, causingwp_date()to apply the offset
a second time. All 11 call sites now use
(new DateTime($date_due, wp_timezone()))->getTimestamp()so the timestamp
is computed correctly before formatting.
Affected views: Admin Borrow Log, Admin Borrowers (detail table + overdue
count), Admin Item Borrow History meta box, Admin Dashboard activity feed,
Frontend Active Borrows list, Frontend My Borrow History table,
Frontend Item Detail borrow history, and the CSV export.
== Changed ==
- [All Borrow Record Views — Time Display] All datetime values shown in borrow
record tables, detail modals, and the borrower overview modal now use
12-hour AM/PM format (e.g. "2:30 PM") instead of military 24-hour format.
Applies to: due date, returned date, and borrowed date columns and popups
across the admin (Borrow Log, Borrowers, Borrow History meta box, Dashboard,
Return Log, Audit Log) and the frontend (inventory display, item detail page,
My Borrow History, My Active Borrows, and all read-only detail modals).