[rt-devel] RT2 bugs and comments
Arthur de Jong
arthur at West.NL
Mon Mar 26 10:13:13 EST 2001
> I modified several files (Ticket/Elements/EditPeople,
> Ticket/Elements/EditWatchers, Ticket/Elements/ShowPeople and
> Ticket/Update.html) to show the Cc's and AdminCc's for the queue alongside
> the list of Cc's and AdminCc's for the ticket. I did a grep on all the
> files and I think these are all the files displaying this info. See
> attached files for my version of the file.
Oops I thought that join was smart but not smart enough.
join(", ",($Ticket->CcAsString,$Ticket->QueueObj->CcAsString))
should be:
join(", ",@{$Ticket->Cc->Emails},@{$Ticket->QueueObj->Cc->Emails})
unless someone known a better neat perl construct. Sorry about that. We might
even introduce sorting or filtering out of double addresses?
New and improved Ticket/Elements/ShowPeople, Ticket/Update.html and patchfile
included. Sorry about that.
-- arthur de jong - arthur at west.nl - west consulting b.v. --
-------------- next part --------------
Owner<BR>
<B><%$Ticket->OwnerObj->Name%></B><BR>
Requestors<BR>
<B><%$Ticket->RequestorsAsString%></B><BR>
Cc<BR>
<B><% join(", ",@{$Ticket->Cc->Emails},@{$Ticket->QueueObj->Cc->Emails}) %></B><BR>
AdminCc<BR>
<B><% join(", ",@{$Ticket->AdminCc->Emails},@{$Ticket->QueueObj->AdminCc->Emails}) %></B>
<%ARGS>
$Ticket => undef
</%ARGS>
-------------- next part --------------
<& /Elements/Header, Title=>"Update Ticket ".$Ticket->Id.": ".$Ticket->Subject &>
<& /Ticket/Elements/Tabs, Ticket => $Ticket &>
<& /Elements/TitleBoxStart, title => 'Update ticket '.$Ticket->Id &>
<FORM ACTION="Display.html" METHOD=POST>
<TABLE>
<TR>
<TD VALIGN=TOP ALIGN=RIGHT>Interested Parties
</TD>
<TD>
<ul>
<li> Requestor: <% $Ticket->RequestorsAsString %>
<li> Cc: <% join(", ",@{$Ticket->Cc->Emails},@{$Ticket->QueueObj->Cc->Emails}) %>
<li> AdminCc: <% join(", ",@{$Ticket->AdminCc->Emails},@{$Ticket->QueueObj->AdminCc->Emails}) %>
</ul>
</TD>
</TR>
</TABLE>
Status:
<& /Elements/SelectStatus, Name=>"SetStatus", Default => $Ticket->Status() &>
Owner:
<& /Elements/SelectOwner, Name=>"SetOwner", Default => $Ticket->OwnerObj->Id(), Queue => $Ticket->QueueObj &>
Time Worked:
<input size=4 name="UpdateTimeWorked"> minutes<br>
<hr>
Update Type: <select name="UpdateType">
<option value="private" <%$CommentDefault%>>Comments (Not sent to requestors)</option>
<option value="response" <%$ResponseDefault%>>Response to requestors</option>
</select>
<br>
Subject: <input name="UpdateSubject" size=60 value="Re: <% $Ticket->Subject %>"> <br>
<& /Elements/MessageBox, Name=>"UpdateContent", QuoteTransaction=>$ARGS{QuoteTransaction} &>
<INPUT TYPE=HIDDEN NAME=id VALUE="<%$Ticket->Id%>"><br>
<& /Elements/TitleBoxEnd &>
<& /Elements/Submit &>
</FORM>
<%INIT>
## Things needed in the template - we'll do the processing here, just
## for the convinience:
my $CommentDefault=$Action eq "Comment" ? "SELECTED" : "";
my $ResponseDefault=$Action eq "Respond" ? "SELECTED" : "";
use RT::Ticket;
my $Ticket=RT::Ticket->new($session{'CurrentUser'});
$Ticket->Load($id) || Abort ("Couldn't load ticket.");
</%INIT>
<%ARGS>
$id => undef
$Action => undef
</%ARGS>
-------------- next part --------------
diff -Naur WebRT.1-3-62/html/Arthur/autohandler WebRT/html/Arthur/autohandler
--- WebRT.1-3-62/html/Arthur/autohandler Thu Jan 1 01:00:00 1970
+++ WebRT/html/Arthur/autohandler Mon Mar 26 16:00:00 2001
@@ -0,0 +1,35 @@
+<%INIT>
+if (defined ($user) && defined ($pass)){
+my %cookies = fetch CGI::Cookie;
+ #TODO if the password is the user's password
+ $session{'CurrentUser'} = new RT::CurrentUser();
+ unless ($session{'CurrentUser'}->Load($user)) {
+ &mc_comp("/Elements/Error", Why => "User Unknown");
+ $m->abort;
+ }
+ unless ($session{'CurrentUser'}->IsPassword($pass)) {
+ $session{'CurrentUser'} = undef;
+ &mc_comp("/Elements/Error", Why => "Wrong Password");
+
+ $m->abort;
+ }
+
+ $RT::Logger->log(level=>'info', message=>"$user successfully logged in");
+
+ $m->call_next;
+}
+elsif (defined $session{'CurrentUser'}){
+ $RT::Logger->debug($session{CurrentUser}->Name." accessing ".$r->uri);
+
+ $m->call_next;
+}
+else {
+ $RT::Logger->log(level=>'debug',
+ message=>$r->uri. " accessed by somebody who hasn't logged in");
+$m->comp('/Login.html');
+ }
+</%INIT>
+<%ARGS>
+$user => undef
+$pass => undef
+</%ARGS>
diff -Naur WebRT.1-3-62/html/Elements/SelectDate WebRT/html/Elements/SelectDate
--- WebRT.1-3-62/html/Elements/SelectDate Mon Mar 26 11:49:55 2001
+++ WebRT/html/Elements/SelectDate Mon Mar 26 12:15:53 2001
@@ -5,8 +5,6 @@
($current <= 0)) {
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
localtime($current);
- $mon++;
- $year+=1900;
$Default = sprintf("%04d-%02d-%02d %02d:%02d",
$year+1900,$mon+1,$mday,
diff -Naur WebRT.1-3-62/html/Ticket/Elements/EditDates WebRT/html/Ticket/Elements/EditDates
--- WebRT.1-3-62/html/Ticket/Elements/EditDates Mon Mar 26 11:50:00 2001
+++ WebRT/html/Ticket/Elements/EditDates Mon Mar 26 12:11:10 2001
@@ -3,7 +3,7 @@
Starts:
</TD>
<TD>
-<& /Elements/SelectDate, menu_prefix => 'Starts', current => 0 &>
+<& /Elements/SelectDate, menu_prefix => 'Starts', current => $TicketObj->StartsObj->Unix &>
(<% $TicketObj->StartsObj->AsString %>)
</TD>
</TR>
@@ -12,7 +12,8 @@
Started:
</TD>
<TD>
-<& /Elements/SelectDate, menu_prefix => 'Started', current => 0 &> (<%$TicketObj->StartedObj->AsString %>)
+<& /Elements/SelectDate, menu_prefix => 'Started', current => $TicketObj->StartedObj->Unix &>
+ (<%$TicketObj->StartedObj->AsString %>)
@@ -24,7 +25,8 @@
Last Contact:
</TD>
<TD>
-<& /Elements/SelectDate, menu_prefix => 'Told', current => 0 &> (<% $TicketObj->ToldObj->AsString %>)
+<& /Elements/SelectDate, menu_prefix => 'Told', current => $TicketObj->ToldObj->Unix &>
+ (<% $TicketObj->ToldObj->AsString %>)
</TD>
</TR>
@@ -34,7 +36,8 @@
</TD>
<TD>
-<& /Elements/SelectDate, menu_prefix => 'Due', current => 0 &> (<% $TicketObj->DueObj->AsString %>)
+<& /Elements/SelectDate, menu_prefix => 'Due', current => $TicketObj->DueObj->Unix &>
+ (<% $TicketObj->DueObj->AsString %>)
</TD>
</TR>
diff -Naur WebRT.1-3-62/html/Ticket/Elements/EditPeople WebRT/html/Ticket/Elements/EditPeople
--- WebRT.1-3-62/html/Ticket/Elements/EditPeople Mon Mar 26 11:50:01 2001
+++ WebRT/html/Ticket/Elements/EditPeople Mon Mar 26 14:13:56 2001
@@ -25,6 +25,12 @@
Administrative Cc:
<& EditWatchers, TicketObj => $Ticket, Type => 'admincc' &>
+Queue Cc:
+<& EditWatchers, TicketObj => $Ticket, Type => 'queuecc' &>
+
+Queue Admin Cc:
+<& EditWatchers, TicketObj => $Ticket, Type => 'queueadmincc' &>
+
</TD>
</TR>
</TABLE>
@@ -34,4 +40,4 @@
$UserOp => undef
$UserString => undef
$Ticket => undef
-</%ARGS>
\ No newline at end of file
+</%ARGS>
diff -Naur WebRT.1-3-62/html/Ticket/Elements/EditWatchers WebRT/html/Ticket/Elements/EditWatchers
--- WebRT.1-3-62/html/Ticket/Elements/EditWatchers Mon Mar 26 11:50:00 2001
+++ WebRT/html/Ticket/Elements/EditWatchers Mon Mar 26 16:03:10 2001
@@ -11,7 +11,9 @@
%while (my $watcher=$watchers->Next) {
<li>
+%if ($deletable) {
<INPUT TYPE=CHECKBOX NAME="DelWatcher<%$watcher->id%>" UNCHECKED>
+%}
%#If there's a principal backing this user, lets give a link to their
%# account
%if ($watcher->IsUser) {
@@ -24,16 +26,25 @@
%}
</ul>
<%INIT>
-my ($watchers, $watcher, $set);
+my ($watchers, $watcher, $set, $deletable);
+$deletable = 1;
if ($Type =~ /^request/i) {
$watchers = $TicketObj->Requestors;
}
-elsif ($Type =~ /^admin/i) {
+elsif ($Type =~ /^admincc/i) {
$watchers = $TicketObj->AdminCc;
}
elsif ($Type =~ /^cc/i) {
$watchers = $TicketObj->Cc;
}
+elsif ($Type =~ /^queueadmincc/i) {
+ $watchers = $TicketObj->QueueObj->AdminCc;
+ $deletable = 0;
+ }
+elsif ($Type =~ /^queuecc/i) {
+ $watchers = $TicketObj->QueueObj->Cc;
+ $deletable = 0;
+ }
else { $watchers = $TicketObj->Watchers;
}
</%INIT>
@@ -41,6 +52,3 @@
$TicketObj => undef
$Type => undef
</%ARGS>
-
-
-
diff -Naur WebRT.1-3-62/html/Ticket/Elements/ShowPeople WebRT/html/Ticket/Elements/ShowPeople
--- WebRT.1-3-62/html/Ticket/Elements/ShowPeople Mon Mar 26 11:50:01 2001
+++ WebRT/html/Ticket/Elements/ShowPeople Mon Mar 26 17:03:28 2001
@@ -3,9 +3,9 @@
Requestors<BR>
<B><%$Ticket->RequestorsAsString%></B><BR>
Cc<BR>
- <B><%$Ticket->CcAsString%></B><BR>
+ <B><% join(", ",@{$Ticket->Cc->Emails},@{$Ticket->QueueObj->Cc->Emails}) %></B><BR>
AdminCc<BR>
- <B><%$Ticket->AdminCcAsString%></B>
+ <B><% join(", ",@{$Ticket->AdminCc->Emails},@{$Ticket->QueueObj->AdminCc->Emails}) %></B>
<%ARGS>
$Ticket => undef
</%ARGS>
diff -Naur WebRT.1-3-62/html/Ticket/Update.html WebRT/html/Ticket/Update.html
--- WebRT.1-3-62/html/Ticket/Update.html Mon Mar 26 11:49:59 2001
+++ WebRT/html/Ticket/Update.html Mon Mar 26 17:08:53 2001
@@ -12,8 +12,8 @@
<TD>
<ul>
<li> Requestor: <% $Ticket->RequestorsAsString %>
-<li> Cc: <% $Ticket->CcAsString %>
-<li> AdminCc: <% $Ticket->AdminCcAsString %>
+<li> Cc: <% join(", ",@{$Ticket->Cc->Emails},@{$Ticket->QueueObj->Cc->Emails}) %>
+<li> AdminCc: <% join(", ",@{$Ticket->AdminCc->Emails},@{$Ticket->QueueObj->AdminCc->Emails}) %>
</ul>
</TD>
</TR>
More information about the Rt-devel
mailing list