%# $Header: /raid/cvsroot/rt/webrt/Ticket/Attic/EditWatchers.html,v 1.1.2.4 2000/07/21 02:13:08 tobiasb Exp $ %# Copyright 2000 Tobias Brox %# Request Tracker is Copyright 1996-2000 Jesse Vincent %# This template is for deleting and adding watchers to a ticket. <& /Elements/Header, Title => "Edit Watchers for Ticket #".$Ticket->Id &> Back to ticket display (#<%$Ticket->id%>, <%$Ticket->Subject || "[no subject]"%>) %# Edit Requestors

Requestor(s)

The Requestor is usually only the one person that initiated the Ticket, but more requestors can be added. The Requestor(s) will (dependent on the RT configuration) get correspondance sent to them. With the default RT configuration, RT should be transparent to the requestor(s). Be aware that things might go a bit wrong when multiple requestors and/or Ccs are used; persons replying to mail might typically send reply to all receipients - which is bad because RT might duplicate the reply to those persons. <& /Ticket/Elements/EditWatcherList, Watchers=>$Requestors, Type=>'Requestor', Domain=>'Ticket', id=>$id &> %# Edit Cc receipients

Carbon/Courtesy Copies

In RT2, a Cc watcher is principially the same as a requestor, only that they will be listed on the Cc-line in the emails sent, not the To-line. <& /Ticket/Elements/EditWatcherList, Watchers=>$Ccs, Type=>'Cc', Domain=>'Ticket', id=>$id &>

Admin Ccs

The Admin Cc is typically some person witch is familiar with RT. He will either be a bcc receipient on mail sent by RT, or he will get private copies, often with extended information from RT. <& /Ticket/Elements/EditWatcherList, Watchers=>$AdminCcs, Type=>'AdminCc', Domain=>'Ticket', id=>$id &>

Queue Watchers for <%$Queue->QueueId%>

CcsAdminCcs
<& /Ticket/Elements/EditWatcherList, Watchers=>$QueueCc, Type=>'Cc', Domain=>'Queue', id=>$id &> <& /Ticket/Elements/EditWatcherList, Watchers=>$QueueAdminCcs, Type=>'AdminCc', Domain=>'Queue', id=>$id &>
<%ARGS> $id => undef $action => undef $WatcherId => undef $RealName => undef $Address => undef $WatcherType => undef $Domain => 'Ticket' <%INIT> require RT::Ticket; my $Ticket = RT::Ticket->new($session{'CurrentUser'}); # Can we load it? unless ($Ticket->Load($id)) { &mc_comp("/Elements/Error" , Why => "Ticket couldn't be loaded"); $m->abort; } # We'll extract the variables we need here, for easiness: my $Queue=$Ticket->QueueObj; my $Requestors=$Ticket->Requestors; my $Ccs=$Ticket->Cc; my $AdminCcs=$Ticket->AdminCc; my $QueueCc=$Queue->Cc; my $QueueAdminCcs=$Queue->AdminCc; # Actions from the web user? if ($action) { my $WatcherObj; if ($WatcherId) { $WatcherObj=RT::Watcher->new($session{CurrentUser}); $WatcherObj->Load($WatcherId) or die "Can't load watcher item"; } if ($action eq "update") { die "No watcher to modify" unless $WatcherObj; $WatcherObj->SetEmail($Address); } elsif ($action eq "delete") { die "No watcher to delete" unless $WatcherObj; $WatcherObj->Delete; } elsif ($action eq "add") { my $d=eval "\$$Domain"; die "Domain $Domain didn't eval" unless $d; $d->AddWatcher(Type => $WatcherType, Email => $Address); } }