[Rt-commit] rt branch, 4.0/status-of-created-reminders, created. rt-4.0.13-49-ga903402

Thomas Sibley trs at bestpractical.com
Wed May 29 15:05:05 EDT 2013


The branch, 4.0/status-of-created-reminders has been created
        at  a9034026f9a20d00520239a87caccc405ea1a70e (commit)

- Log -----------------------------------------------------------------
commit a9034026f9a20d00520239a87caccc405ea1a70e
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Wed May 29 11:48:00 2013 -0700

    Create new reminders in the configured "reminder_on_open" status
    
    Otherwise reminders are created in the lifecycle's "on_create" status.
    Completing reminders in this case requires a transition between the
    "on_create" status (often "new") and the "reminder_on_resolve" status,
    which may not be present outside of the stock configuration.
    
    Additionally, creating reminders in a status other than the open status
    means reminders start in a state that they can never return to;
    re-opening a completed reminder returns to the open status, not the
    create state.
    
    Reminders don't need the complexity of a full lifecycle, and a two-state
    system of "open"/"complete" is fine.
    
    This does require that the reminder_on_open status is valid at creation
    (i.e. can transition from "").  That requirement is less onerous than
    requiring a transition directly from a new state to an inactive state.

diff --git a/lib/RT/Reminders.pm b/lib/RT/Reminders.pm
index 719523b..be716a0 100644
--- a/lib/RT/Reminders.pm
+++ b/lib/RT/Reminders.pm
@@ -134,6 +134,7 @@ sub Add {
         RefersTo => $self->Ticket,
         Type => 'reminder',
         Queue => $self->TicketObj->Queue,
+        Status => $self->TicketObj->QueueObj->Lifecycle->ReminderStatusOnOpen,
     );
     $self->TicketObj->_NewTransaction(
         Type => 'AddReminder',
diff --git a/t/web/reminders.t b/t/web/reminders.t
index af7e2fb..5102351 100644
--- a/t/web/reminders.t
+++ b/t/web/reminders.t
@@ -51,10 +51,10 @@ is($col->Count, 1, 'got a reminder');
 my $reminder = $col->First;
 is($reminder->Subject, "baby's first reminder");
 my $reminder_id = $reminder->id;
-is($reminder->Status, 'new');
+is($reminder->Status, 'open');
 
-$ticket->SetStatus('new');
-is( $ticket->Status, 'new', 'changed back to new' );
+$ticket->SetStatus('open');
+is( $ticket->Status, 'open', 'changed back to new' );
 
 $m->goto_ticket($ticket->id);
 $m->text_contains('New reminder:', "can create a new reminder");
@@ -72,7 +72,7 @@ DBIx::SearchBuilder::Record::Cachable->FlushCache;
 $reminder = RT::Ticket->new($user);
 $reminder->Load($reminder_id);
 is($reminder->Subject, 'changed the subject');
-is($reminder->Status, 'new');
+is($reminder->Status, 'open');
 
 $m->goto_ticket($ticket->id);
 $m->form_name('UpdateReminders');

-----------------------------------------------------------------------


More information about the Rt-commit mailing list