Appointment statuses in the plugin settings; call-outs as their own entry

Statuses (name, colour, counts toward hours, order) are set up on the plugin's settings page
instead of being hard-coded. Appointments keep a fixed key, so renaming is safe; removing a status
in use asks which status to move its appointments to (done on save by a SettingsController hook).
Colours come from the settings everywhere statuses show, which also fixes Cancelled never being
coloured (cancelled/canceled mismatch).

Call-outs (an employee off work) are their own kind of entry (event_type 'call_out') with an
employee, date, days and notes, added from a button on each calendar day. They sit at the top of
the day in red stripes and never count toward hours. Migration 004 converts Call_Out appointments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rickyandClaude Opus 5.5 committed 2026-11-02 20:22:52 -05:00
1 parent f2a16b1821
commit 31356ac3fb
23 files changed
+536 -252

No files matched your search

@@ -35,7 +35,7 @@
<label for="status"><%= l(:field_status) %></label>
<%= select_tag :status,
options_for_select(CustomerAppointment::STATUSES.map { |s| [s.humanize, s] }, @status),
options_for_select(CustomerAppointment.status_options + [[l(:label_call_out_plural), CustomerAppointment::CALL_OUT]], @status),
include_blank: l(:label_all_statuses) %>
<label for="from"><%= l(:label_date_from) %></label>
@@ -80,11 +80,7 @@
<td><%= link_to_user(appointment.user) if appointment.user %></td>
<td><%= appointment.duration %> <%= l(:label_days) %></td>
<td>
<% if appointment.status.present? %>
<span class="status-badge status-<%= appointment.status.to_s.parameterize %>">
<%= appointment.status.to_s.humanize %>
</span>
<% end %>
<%= appointment_status_badge(appointment) %>
</td>
</tr>
<% end %>