=== Staff Schedule and Work Roster ===
Contributors: kentstudiotoolbox
Tags: staff scheduling, employee schedule, shift planning, availability, roster
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 8.1
Stable tag: 1.8.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A complete staff scheduler, staff enter their availability and you see it right on the schedule builder where you build the work schedule or roster.

== Description ==

Staff Schedule and Work Roster is a self-contained staff scheduling portal for a small team — everything runs on your own WordPress site. Staff paint their weekly availability and it appears directly on your builder, so every shift is planned around who is actually free: that is the assist — no spreadsheets, no back-and-forth.

**Staff Schedule and Work Roster Pro** is a separate add-on you install alongside this one: it adds ✨ Assignment assist (one click drafts the week from availability), ▤ week templates, a full-schedule team calendar feed, and a read-only POS integration — see the plugin's Settings screen or studiotoolbox.com for details.
You can explore a live demo of the Pro version for free at https://studiotoolbox.com


**Your staff** log in at `yoursite.com/staff` (works great on phones) and:

* **Paint their availability** on a weekly grid — the hours they can work, prefer, or would rather avoid.
* **Request time off**, with manager approval and clear statuses.
* **See their published shifts** — theirs and the whole team's — and subscribe their phone's calendar app to them.
* **Trade shifts** on a board: put a shift up to drop or swap, claim or offer, with qualification and clash checks built in.

**You** build each week in a drag-and-drop schedule builder in wp-admin:

* Day cards with stackable shift lanes and event markers, guided by everyone's painted availability.
* Drag a name onto a shift to assign it — the builder warns about conflicts but never blocks your call.
* **Publish** to email every staff member their shifts; after that, only future days accept edits, and one click emails just the people whose shifts changed.
* One Approvals screen for time-off requests and shift trades, with a decision history.
* Week totals balance shifts and hours across the team, side by side with last week.

**A fresh install arrives with something to explore.** You start with a handful of sample staff who have painted availability, this week already scheduled and published, and next week laid out as an unassigned draft to practise on — so you can click through the builder, the portal, and a trade before adding your own team. It only happens on a genuinely new install (a site that already has staff or schedules is never touched), and one click in **Settings → Sample data** removes all of it.


== Installation ==

1. Install and activate the plugin (Plugins → Add New).
2. Click the **Settings** link on the plugin's row in the Plugins list, then set your day window, timezone, and active days.
3. Add your team under **Schedules → Staff users** — each person is emailed a temporary password.
4. Point staff at `yoursite.com/staff`, and build your first week under **Schedules → Builder**.

Your staff access `yoursite.com/staff` so the permalink structure for your site can not be "Plain". The `/staff` will show a 404 if you have Plain permalinks selected, and you'll have to choose another type. (Settings → Permalinks → Save Changes).

== Screenshots ==

1. The schedule builder — drag staff onto stackable shift lanes, with each person's painted availability shown right on the day so you plan around who is actually free.
2. The availability painter — staff mark the hours they can work, prefer, or would rather avoid on a weekly grid; it feeds straight into the builder.
3. A staff member's portal on their phone — their published shifts, the whole team's week, and a time-off request.
4. The tradeboard — staff put a shift up to drop or swap and claim open ones, with clash and qualification checks built in.
5. The Approvals screen — pending time-off and shift trades in one place, with a decision history.
6. Settings — day window, timezone, week start, and the Pro add-on overview.

== Frequently Asked Questions ==

= Do my staff need WordPress accounts? =

They get portal-only accounts the plugin creates for them — they log in at `/staff` and never see wp-admin.

= What does publishing do? =

Publishing emails every scheduled staff member their shifts and locks that week's availability painting. Afterwards only future days can be edited, and you can notify just the people whose shifts changed.

= Can staff swap shifts themselves? =

Yes — the tradeboard lets them put a shift up to drop or trade, a day or more ahead. Depending on your setting, trades complete automatically or wait for your approval.

= What's the sample data, and how do I get rid of it? =

A new install comes with a few example staff, painted availability, and two weeks of schedule (this week published and assigned, next week an unassigned draft) so the plugin isn't empty on day one. Remove it in one click under **Settings → Sample data** once your own team is in. It's only ever added to a brand-new install; a site that already has staff or schedules never gets it.

= Emails aren't arriving — is the plugin broken? =

Delivery depends on your site's mail setup. Install an SMTP plugin (e.g. WP Mail SMTP) pointed at your mail provider; the plugin queues and batches its mail so publishing is never slow.

= What's in Pro? =

✨ Assignment assist (automatic schedule drafting from availability), weekly templates, the team calendar feed, and the POS integration. Pro is a separate add-on that installs alongside this plugin — you keep this one exactly as it is, and nothing is replaced. The free plugin is fully functional with no usage limits.

== Changelog ==

= 1.8.4 =
* Improvements to the handling and removal of the sample data displayed during first install.
* The week start is no longer set forever when the first assigned shift is created. A setting will allow you to change it but it is a destructive change, all schedules and availability are lost.
* Shows a hint card in the builder window to help a new user make new shifts by double-clicking.

= 1.8.3 =
* Live updating in the builder when staff update availability.

= 1.8.2 =
* Internal. No functional changes.

= 1.8.1 =
* Builder: drag a shift to another lane. Dropping it onto another shift bumps that one down a lane, and empty lanes close up afterwards; the ＋ add-lane row doubles as "move to a new lane". Works for events too.
* Sample data: a fresh install now arrives with next week published and fully assigned (8 example staff, events, a visible availability conflict, one open shift to fill) and the week after as an unassigned draft to practise on — each week with its own availability.

= 1.8.0 =
* The builder opens on the week you're actually building — a bare open skips a published current week and lands on the next one.
* Staff portal: the week selector lists the two previous weeks (view-only); the availability painter fits the whole day on screen in landscape; the hours summary sits below the grid; the how-to tip is dismissible; time off is requested as From – To dates.
* The team calendar feed is now part of the Pro add-on; the free plugin serves each person's own feed.
* Pro: Assignment assist fills the whole schedule — the weekly shift target is a minimum, not a ceiling; one shift per person per day still holds.
* Pro: an Assist debug snapshot in Settings for support conversations.
* Fixed: the Settings page refused administrators; stray grab cursor over names on a locked published week.
* Security: deactivating a staff member ends their live sessions and calendar link immediately; time-off requests require a staff account.

= 1.7.1 =
* Maintenance release — no functional changes.

= 1.7.0 =
* Editing a published week is now deliberate: it opens read-only, you unlock a single future day with a password confirmation, and staged edits save and email the affected staff in one Commit & email step. Past days and today stay locked.
* Schedule history: from the moment a week is published it keeps an append-only log — publishes, notifications, trades, time-off decisions — plus a full as-published snapshot per publish, shown in a History panel on the builder.
* Approving time off that would leave a published shift without its person is no longer silent: the Approvals screen lists each affected shift with eligible cover, and the reassignment happens together with the approval.
* New installs start with example staff and two weeks of schedule so the builder has something to show; remove it in one click from Settings.
* The opt-in "delete all plugin data when uninstalled" wipe is now complete.
* Grid settings refuse a change that would strand stored shifts or availability; widening always passes.
* Simultaneous decisions on the same trade or time-off request settle to exactly one outcome — one decision, one email, one history entry.
* The login lockout tracks one counter per account, whether you type the username or the email.
* Fixed: a phantom "Saved" when editing a past day of a published week; a swap claim now hands back the shift the claimer actually picked (and shows it at every review step); Assignment assist no longer reshuffles an already-published week.

= 1.6.0 =
* Configurable week start day: choose which weekday your schedule weeks begin on (Settings → "Week starts on"). Set it before you start scheduling — it locks once schedules or availability exist.

= 1.5.5 =
* Maintenance release — no functional changes.

= 1.5.4 =
* Maintenance release — no functional changes.

= 1.5.3 =
* Settings → POS integration shows a connection health line; the POS endpoint gained a version-compatibility handshake.

= 1.5.2 =
* Schedule builder: naming a week template uses an inline field instead of a browser popup.

= 1.5.1 =
* Sales-demo sandbox improvements only; no changes for regular sites.

= 1.5.0 =
* Free and Pro editions: Assignment assist, week templates, the team calendar feed, and the POS integration are Pro features. Data carries over untouched in both directions.
* The schedule builder shows a clear message when a save is rejected instead of retrying silently.

== Upgrade Notice ==

= 1.8.4 =
Better handling of the sample data. Live availability updates. The week start day can now be changed.

