%# $Header: /raid/cvsroot/rt/webrt/Ticket/Attic/EditWatchers.html,v 1.1.2.5 2000/08/29 06:02:11 jesse 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 Copies

Users or addresses which should get carbon copies of correspondence on this ticket
<& /Ticket/Elements/EditWatcherList, Watchers=>$Ccs, Type=>'Cc', Domain=>'Ticket', id=>$id &>

Administrative Ccs

Users or addresses who should get copies of correspondence and private notes on this ticket
<& /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); } }