Files
Claude acad2614c7 Separate permission for turning customer reminders off; fix the Compose recipe
- Send appointment reminders now covers only Send now / Send again; the new
  "Turn appointment reminders off/on for customers" permission covers the
  customer page's button
- README's Compose service runs the task through the image's entrypoint, which
  installs the plugins' gems first (running bundle exec rake directly failed
  with Bundler::GemNotFound, since the Redmine container installs them at start)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-11-01 13:35:01 -05:00

20 lines
1.0 KiB
ERB

<%# Turning appointment reminders on or off for a customer, on the customer page (redmine_qbo's show_customer_view_right hook) %>
<% customer = local_assigns[:customer] %>
<% if customer && User.current.allowed_to?(:view_customer_appointments, nil, global: true) %>
<% off = ReminderOptOut.opted_out?(customer) %>
<div class="customer-reminders">
<i class="fa-regular fa-envelope"></i>
<strong><%= l(:label_appointment_reminders) %>:</strong>
<%= off ? l(:text_customer_reminders_off) : l(:text_customer_reminders_on) %>
<% if User.current.allowed_to?(:manage_customer_reminders, nil, global: true) %>
<%= button_to (off ? l(:button_reminders_on) : l(:button_reminders_off)),
(off ? customer_reminders_on_path(customer) : customer_reminders_off_path(customer)),
method: :post, form_class: 'customer-reminders-toggle' %>
<% end %>
</div>
<style>
.customer-reminders { margin: 10px 0; }
form.customer-reminders-toggle { display: inline; margin-left: 8px; }
</style>
<% end %>