From 3ef62a0570055da710328937e7f65dbb2c027c62 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 12 Aug 2002 06:17:09 +0000 Subject: import rt 2.0.14 --- rt/webrt/Ticket/Attachment/dhandler | 27 ++++ rt/webrt/Ticket/Create.html | 199 ++++++++++++++++++++++++++++ rt/webrt/Ticket/Display.html | 152 +++++++++++++++++++++ rt/webrt/Ticket/Elements/AddWatchers | 54 ++++++++ rt/webrt/Ticket/Elements/EditBasics | 62 +++++++++ rt/webrt/Ticket/Elements/EditDates | 46 +++++++ rt/webrt/Ticket/Elements/EditKeywordSelects | 45 +++++++ rt/webrt/Ticket/Elements/EditLinks | 109 +++++++++++++++ rt/webrt/Ticket/Elements/EditPeople | 37 ++++++ rt/webrt/Ticket/Elements/EditWatchers | 46 +++++++ rt/webrt/Ticket/Elements/ShowBasics | 29 ++++ rt/webrt/Ticket/Elements/ShowDates | 54 ++++++++ rt/webrt/Ticket/Elements/ShowDependencies | 18 +++ rt/webrt/Ticket/Elements/ShowHistory | 43 ++++++ rt/webrt/Ticket/Elements/ShowKeywordSelects | 26 ++++ rt/webrt/Ticket/Elements/ShowLinks | 61 +++++++++ rt/webrt/Ticket/Elements/ShowMemberOf | 12 ++ rt/webrt/Ticket/Elements/ShowMembers | 22 +++ rt/webrt/Ticket/Elements/ShowPeople | 12 ++ rt/webrt/Ticket/Elements/ShowReferences | 27 ++++ rt/webrt/Ticket/Elements/ShowRequestor | 35 +++++ rt/webrt/Ticket/Elements/ShowSummary | 61 +++++++++ rt/webrt/Ticket/Elements/ShowTransaction | 162 ++++++++++++++++++++++ rt/webrt/Ticket/Elements/Tabs | 126 ++++++++++++++++++ rt/webrt/Ticket/Elements/ToolBar | 3 + rt/webrt/Ticket/History.html | 30 +++++ rt/webrt/Ticket/Modify.html | 39 ++++++ rt/webrt/Ticket/ModifyAll.html | 124 +++++++++++++++++ rt/webrt/Ticket/ModifyDates.html | 26 ++++ rt/webrt/Ticket/ModifyLinks.html | 31 +++++ rt/webrt/Ticket/ModifyPeople.html | 38 ++++++ rt/webrt/Ticket/Update.html | 110 +++++++++++++++ 32 files changed, 1866 insertions(+) create mode 100644 rt/webrt/Ticket/Attachment/dhandler create mode 100755 rt/webrt/Ticket/Create.html create mode 100755 rt/webrt/Ticket/Display.html create mode 100755 rt/webrt/Ticket/Elements/AddWatchers create mode 100755 rt/webrt/Ticket/Elements/EditBasics create mode 100755 rt/webrt/Ticket/Elements/EditDates create mode 100644 rt/webrt/Ticket/Elements/EditKeywordSelects create mode 100755 rt/webrt/Ticket/Elements/EditLinks create mode 100755 rt/webrt/Ticket/Elements/EditPeople create mode 100755 rt/webrt/Ticket/Elements/EditWatchers create mode 100755 rt/webrt/Ticket/Elements/ShowBasics create mode 100755 rt/webrt/Ticket/Elements/ShowDates create mode 100755 rt/webrt/Ticket/Elements/ShowDependencies create mode 100755 rt/webrt/Ticket/Elements/ShowHistory create mode 100644 rt/webrt/Ticket/Elements/ShowKeywordSelects create mode 100755 rt/webrt/Ticket/Elements/ShowLinks create mode 100755 rt/webrt/Ticket/Elements/ShowMemberOf create mode 100755 rt/webrt/Ticket/Elements/ShowMembers create mode 100755 rt/webrt/Ticket/Elements/ShowPeople create mode 100755 rt/webrt/Ticket/Elements/ShowReferences create mode 100644 rt/webrt/Ticket/Elements/ShowRequestor create mode 100755 rt/webrt/Ticket/Elements/ShowSummary create mode 100755 rt/webrt/Ticket/Elements/ShowTransaction create mode 100755 rt/webrt/Ticket/Elements/Tabs create mode 100755 rt/webrt/Ticket/Elements/ToolBar create mode 100755 rt/webrt/Ticket/History.html create mode 100755 rt/webrt/Ticket/Modify.html create mode 100755 rt/webrt/Ticket/ModifyAll.html create mode 100755 rt/webrt/Ticket/ModifyDates.html create mode 100755 rt/webrt/Ticket/ModifyLinks.html create mode 100755 rt/webrt/Ticket/ModifyPeople.html create mode 100755 rt/webrt/Ticket/Update.html (limited to 'rt/webrt/Ticket') diff --git a/rt/webrt/Ticket/Attachment/dhandler b/rt/webrt/Ticket/Attachment/dhandler new file mode 100644 index 000000000..0d646cc0b --- /dev/null +++ b/rt/webrt/Ticket/Attachment/dhandler @@ -0,0 +1,27 @@ +<%perl> + my ($ticket, $trans,$attach, $filename); + my $arg = $m->dhandler_arg; # get rest of path + if ($arg =~ '^(\d+)/(\d+)') { + $trans = $1; + $attach = $2; + } + else { + Abort("Corrupted attachment URL."); + } + my $AttachmentObj = new RT::Attachment($session{'CurrentUser'}); + $AttachmentObj->Load($attach) || Abort("Attachment '$attach' could not be loaded"); + + + unless ($AttachmentObj->id) { + Abort("Bad attachment id. Couldn't find attachment '$attach'\n"); + } + unless ($AttachmentObj->TransactionId() == $trans ) { + Abort("Bad transaction number for attachment. $trans should be".$AttachmentObj->TransactionId() ."\n"); + + } + my $content_type = $AttachmentObj->ContentType || 'text/plain'; + SetContentType($content_type); + $m->out($AttachmentObj->Content); + $m->abort; + + diff --git a/rt/webrt/Ticket/Create.html b/rt/webrt/Ticket/Create.html new file mode 100755 index 000000000..2c61de03a --- /dev/null +++ b/rt/webrt/Ticket/Create.html @@ -0,0 +1,199 @@ +%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Ticket/Attic/Create.html,v 1.1 2002-08-12 06:17:09 ivan Exp $ +%# Copyright 1996-2000 Jesse Vincent + +<& /Elements/Header, Title => "Create a new ticket" &> +<& /Elements/Tabs, current_toptab => "Ticket/Create.html" &> +
+ + + + +[Show basics] [Show details] +
+<& /Elements/TitleBoxStart, contentbg => "#cccccc", title => "Create a new ticket"&> +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Queue<% $QueueObj->Name %> + +Status: + +<& /Elements/SelectStatus, Name => "Status", Default=> 'new' &> + +Owner: + +<& /Elements/SelectOwner, Name => "ValueOfOwner", QueueObj => $QueueObj &> +
+Requestors: + + +
+Cc: + + +
+Admin Cc: + + +
+Subject: + + +
+Attach file: + + +
+Describe the issue below:
+<& /Elements/MessageBox, QuoteTransaction => $QuoteTransaction &> + +
+
+
+<& /Elements/TitleBoxEnd &> +<& /Elements/Submit, Label => "Create"&> + +










+










+










+










+










+ + + [Show basics] [Show details] +
+ + + + + + +
+ + <& /Elements/TitleBoxStart, title => 'The Basics', + title_class=> 'inverse', + color => "#993333" &> + + + + + +
Priority:
Final Priority:
Time Worked:
Time Left:
+<& /Elements/TitleBoxEnd &> +
+
+ + + <& /Elements/TitleBoxStart, + title_class=> 'inverse', + title => "Keyword Selections", color => "#993300" + &> + +% while ( my $KeywordSelect = $KeywordSelects->Next ) { +% my $Descendents = $KeywordSelect->KeywordObj->Descendents; + +% } + +
+ <% $KeywordSelect->Name %> + + +
+<& /Elements/TitleBoxEnd &> + +
+<& /Elements/TitleBoxStart, title => "Dates", + title_class=> 'inverse', + color => "#663366" &> + + + + +
Starts:
Due:
+<& /Elements/TitleBoxEnd &> +
+<& /Elements/TitleBoxStart, title => 'Relationships', + title_class=> 'inverse', + titleright => '', color=> "#336633" &> + +(Enter ticket ids or URLs, seperated with spaces) + + + + + + + + + +
Depends on
Depended on by
Parents
Children
Refers to
Referred to by
+<& /Elements/TitleBoxEnd &> +
+ +
+<& /Elements/Submit, Label => "Create"&> +
+









+










+










+










+










+ +<%INIT> +my $QueueObj = new RT::Queue($session{'CurrentUser'}); +$QueueObj->Load($Queue) || Abort("Queue could not be loaded."); +my $KeywordSelects = $QueueObj->KeywordSelects; + + + +<%ARGS> +$DependsOn => undef +$DependedOnBy => undef +$MemberOf => undef +$QuoteTransaction => undef +$Queue => undef + diff --git a/rt/webrt/Ticket/Display.html b/rt/webrt/Ticket/Display.html new file mode 100755 index 000000000..cb0dc2501 --- /dev/null +++ b/rt/webrt/Ticket/Display.html @@ -0,0 +1,152 @@ +%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Ticket/Attic/Display.html,v 1.1 2002-08-12 06:17:09 ivan Exp $ +%# Copyright 1996-2000 Jesse Vincent + +<& /Elements/Header, Title => "Ticket #".$Ticket->Id ." ".$Ticket->Subject &> +<& /Ticket/Elements/Tabs, Ticket => $Ticket, current_tab => 'Ticket/Display.html?id='.$Ticket->id &> + +<& /Elements/ListActions, actions => \@Actions &> + +<& /Ticket/Elements/ShowSummary, Ticket => $Ticket &> + + +
+<& /Ticket/Elements/ShowHistory , + Ticket => $Ticket, + Collapsed => $ARGS{'Collapsed'}, + ShowHeaders => $ARGS{'ShowHeaders'} &> + + +<%ARGS> +$id => undef +$Create => undef +$ShowHeaders => undef +$Collapsed => undef + + +<%INIT> + + + my ($linkid, $message, $tid, $Ticket, @Actions); + +$Ticket = new RT::Ticket($session{'CurrentUser'}); + +unless ($id) { + Abort('No ticket specified'); +} + +if ($ARGS{'id'} eq 'new') { + # {{{ Create a new ticket + + my $Queue = new RT::Queue($session{'CurrentUser'}); + unless ($Queue->Load($ARGS{'Queue'})) { + Abort('Queue not found'); + } + + unless ($Queue->CurrentUserHasRight('CreateTicket')) { + Abort('You have no permission to create tickets in that queue.'); + } + + my $due = new RT::Date($session{'CurrentUser'}); + $due->Set(Format => 'unknown', Value => $ARGS{'Due'}); + my $starts = new RT::Date($session{'CurrentUser'}); + $starts->Set(Format => 'unknown', Value => $ARGS{'Starts'}); + + + my @Requestors = split(/,/,$ARGS{'Requestors'}); + my @Cc = split(/,/,$ARGS{'Cc'}); + my @AdminCc = split(/,/,$ARGS{'AdminCc'}); + + my $MIMEObj = MakeMIMEEntity( Subject => $ARGS{'Subject'}, + From => $ARGS{'From'}, + Cc => $ARGS{'Cc'}, + Body => $ARGS{'Content'}, + AttachmentFieldName => 'Attach'); + + + my %create_args = ( + Queue=>$ARGS{Queue}, + Owner=>$ARGS{ValueOfOwner}, + InitialPriority=> $ARGS{InitialPriority}, + FinalPriority=> $ARGS{FinalPriority}, + TimeLeft => $ARGS{TimeLeft}, + TimeWorked => $ARGS{TimeWorked}, + Requestor=> \@Requestors, + Cc => \@Cc, + AdminCc => \@AdminCc, + Subject=>$ARGS{Subject}, + Status=>$ARGS{Status}, + Due => $due->ISO, + Starts => $starts->ISO, + MIMEObj => $MIMEObj + ); + + + # we need to get any KeywordSelect- fields into %create_args.. + grep { $_ =~ /^KeywordSelect-/ && {$create_args{$_} = $ARGS{$_}}} %ARGS; + + my ($id, $Trans, $ErrMsg)= $Ticket->Create(%create_args); + unless ($id && $Trans) { + Abort($ErrMsg); + } + my @linktypes = qw( DependsOn MemberOf RefersTo ); + + foreach my $linktype (@linktypes) { + foreach my $luri (split (/ /,$ARGS{"new-$linktype"})) { + $luri =~ s/\s*$//; # Strip trailing whitespace + my ($val, $msg) = $Ticket->AddLink( Target => $luri, + Type => $linktype); + push @Actions, $msg; + } + + foreach my $luri (split (/ /,$ARGS{"$linktype-new"})) { + my ($val, $msg) = $Ticket->AddLink( Base => $luri, + Type => $linktype); + + push @Actions, $msg; + } + } + # don't try to change queue to the current queue + delete $ARGS{'Queue'}; + + push(@Actions, $ErrMsg); + unless ($Ticket->CurrentUserHasRight('ShowTicket')) { + Abort("No permission to view newly created ticket #".$Ticket->id."."); + } + # }}} +} + +else { + $Ticket = LoadTicket($ARGS{'id'}); + unless ($Ticket->CurrentUserHasRight('ShowTicket')) { + Abort("No permission to view ticket"); + } + + +if (defined $ARGS{'Action'}) { + if ($ARGS{'Action'} =~ /^(Steal|Kill|Take|SetTold)$/) { + my $action = $1; + my ($res, $msg)=$Ticket->$action(); + push(@Actions, $msg); + } +} + $ARGS{'UpdateContent'} =~ s/\r\n/\n/g; + + if ($ARGS{'UpdateContent'} && + $ARGS{'UpdateContent'} ne '' && + $ARGS{'UpdateContent'} ne "-- \n" . + $session{'CurrentUser'}->UserObj->Signature + ) { + ProcessUpdateMessage(ARGSRef=>\%ARGS, + Actions=>\@Actions, + TicketObj=>$Ticket); + } +#Process status updates +my @BasicActions = ProcessTicketBasics(ARGSRef => \%ARGS, TicketObj=>$Ticket); + +push (@Actions, @BasicActions); +} + + + + + diff --git a/rt/webrt/Ticket/Elements/AddWatchers b/rt/webrt/Ticket/Elements/AddWatchers new file mode 100755 index 000000000..053cff122 --- /dev/null +++ b/rt/webrt/Ticket/Elements/AddWatchers @@ -0,0 +1,54 @@ +
+<%$msg%>
+ +Add new watchers:
+ + +% if ($Users) { + +% while (my $u = $Users->Next ) { + +% } +% } + + + + + +
+Type + +Username +
<&/Elements/SelectWatcherType, Name => "WatcherTypeUser".$u->Id &><%$u->Name%> (<%$u->RealName%>)
+Type + +Email +
+<&/Elements/SelectWatcherType, Name => "WatcherTypeEmail1" &> + + +
+<&/Elements/SelectWatcherType, Name => "WatcherTypeEmail2" &> + + +
+<&/Elements/SelectWatcherType, Name => "WatcherTypeEmail3" &> + + +
+ +<%INIT> +my ($msg, $Users); +if ($UserString) { + $Users = new RT::Users($session{'CurrentUser'}); + $Users->Limit(FIELD => $UserField, + VALUE => $UserString, + OPERATOR => $UserOp); + } + + +<%ARGS> +$UserField => 'Name' +$UserOp => '=' +$UserString => undef + diff --git a/rt/webrt/Ticket/Elements/EditBasics b/rt/webrt/Ticket/Elements/EditBasics new file mode 100755 index 000000000..12142879e --- /dev/null +++ b/rt/webrt/Ticket/Elements/EditBasics @@ -0,0 +1,62 @@ + + + + + + + + + + + + +
+ Subject
+ +
+<& /Elements/ShadedBox, + title => 'Status', + content => $SelectStatus +&> + + +<& /Elements/ShadedBox, + title => 'Time Worked', + content => "TimeWorked."\" SIZE=5>" +&> + + +<& /Elements/ShadedBox, + title => 'Time Left', + content => "TimeLeft."\" SIZE=5>" +&> + +<& /Elements/ShadedBox, + title => 'Priority', + content => "Priority."\" SIZE=3>" +&> + + +<& /Elements/ShadedBox, + title => 'Final Priority', + content => "FinalPriority."\" SIZE=3>" +&> + + + +<& /Elements/ShadedBox, + title => 'Queue', + content => "$SelectQueue" + &> +
+ +<%INIT> +#It's hard to do this inline, so we'll preload the html of the selectstatus in here. +my $SelectStatus = $m->scomp("/Elements/SelectStatus", Name => 'Status', Default=> $TicketObj->Status); +my $SelectQueue = $m->scomp("/Elements/SelectQueue", Name => 'Queue', Default =>$TicketObj->QueueObj->Id); + + +<%ARGS> + +$TicketObj => undef + diff --git a/rt/webrt/Ticket/Elements/EditDates b/rt/webrt/Ticket/Elements/EditDates new file mode 100755 index 000000000..f04130bde --- /dev/null +++ b/rt/webrt/Ticket/Elements/EditDates @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + +
+Starts: + +<& /Elements/SelectDate, menu_prefix => 'Starts', current => 0 &> + (<% $TicketObj->StartsObj->AsString %>) +
+Started: + +<& /Elements/SelectDate, menu_prefix => 'Started', current => 0 &> (<%$TicketObj->StartedObj->AsString %>) + + + +
+Last Contact: + +<& /Elements/SelectDate, menu_prefix => 'Told', current => 0 &> (<% $TicketObj->ToldObj->AsString %>) + +
+Due: + + +<& /Elements/SelectDate, menu_prefix => 'Due', current => 0 &> (<% $TicketObj->DueObj->AsString %>) +
+<%ARGS> +$TicketObj => undef + + diff --git a/rt/webrt/Ticket/Elements/EditKeywordSelects b/rt/webrt/Ticket/Elements/EditKeywordSelects new file mode 100644 index 000000000..34ade9f25 --- /dev/null +++ b/rt/webrt/Ticket/Elements/EditKeywordSelects @@ -0,0 +1,45 @@ + + + +% while ( my $KeywordSelect = $KeywordSelects->Next ) { +% my $CurrentKeywords = $TicketObj->KeywordsObj($KeywordSelect->id); +% my $Descendents = $KeywordSelect->KeywordObj->Descendents; + +% } + + +
+ <% $KeywordSelect->Name %> +
+ + +
+ + +<%INIT> +my $KeywordSelects = $TicketObj->QueueObj->KeywordSelects; + + +<%ARGS> +$TicketObj => undef + + diff --git a/rt/webrt/Ticket/Elements/EditLinks b/rt/webrt/Ticket/Elements/EditLinks new file mode 100755 index 000000000..b0296fce1 --- /dev/null +++ b/rt/webrt/Ticket/Elements/EditLinks @@ -0,0 +1,109 @@ +%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Ticket/Elements/Attic/EditLinks,v 1.1 2002-08-12 06:17:09 ivan Exp $ +%# Copyright 1996-2000 Jesse Vincent + + + + + + + +
+

New Relationships

+Enter tickets or URIs to link tickets to. Seperate multiple entries with spaces.
+ + + + + + + + +
Merge into: (only one ticket)
Depends on:
Depended on by:
Parents:
Children:
Refers to:
Referred to by:
+
+

Current Relationships

+(Check boxes to delete)
+ +Depends on:
+
    +% while (my $link = $Ticket->DependsOn->Next) { +% my $member = $link->TargetObj; +
  • + +<%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> +[<%$member->Status%>] + +% } +
+ +Depended on by:
+
    +% while (my $link = $Ticket->DependedOnBy->Next) { +% my $member = $link->BaseObj; +
  • + +<%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> +[<%$member->Status%>] +% } +
+ +Parents:
+
    +% while (my $link = $Ticket->MemberOf->Next) { +% my $member = $link->TargetObj; +
  • + +<%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> +[<%$member->Status%>] + +% } +
+ +Children:
+
    +% while (my $link = $Ticket->Members->Next) { +
  • + +% my $member = $link->BaseObj; +<%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> +[<%$member->Status%>] +% } +
+ + +Refers to:
+
    +% while (my $link = $Ticket->RefersTo->Next) { +
  • + +% if ($link->TargetIsLocal) { +% my $member = $link->TargetObj; + +<%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<%$member->Status%>]
    +% } else { +<%$link->Target%> +% } +%} +
+ +Referred to by:
+
    +% while (my $link = $Ticket->ReferredToBy->Next) { +
  • + +% if ($link->BaseIsLocal) { +% my $member = $link->BaseObj; +<%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<%$member->Status%>]
    +% } else { +<%$link->Base%> +%} +% } +
+ + +
+ + + +<%ARGS> +$Ticket => undef + diff --git a/rt/webrt/Ticket/Elements/EditPeople b/rt/webrt/Ticket/Elements/EditPeople new file mode 100755 index 000000000..4f69af970 --- /dev/null +++ b/rt/webrt/Ticket/Elements/EditPeople @@ -0,0 +1,37 @@ + + + + + +
+ +

New watchers

+Find people whose
+<& /Elements/SelectUsers &> + + +<& AddWatchers, Ticket => $Ticket, UserString => $UserString, + UserOp => $UserOp, UserField => $UserField &> +
+

Owner

+Owner: <& /Elements/SelectOwner, Name => 'Owner', QueueObj => $Ticket->QueueObj, TicketObj => $Ticket, Default => $Ticket->OwnerObj->Id &> +

Current watchers

+(Check box to delete)
+ +Requestors: +<& EditWatchers, TicketObj => $Ticket, Type => 'requestors' &> + +Cc: +<& EditWatchers, TicketObj => $Ticket, Type => 'cc' &> + +Administrative Cc: +<& EditWatchers, TicketObj => $Ticket, Type => 'admincc' &> + +
+ +<%ARGS> +$UserField => undef +$UserOp => undef +$UserString => undef +$Ticket => undef + diff --git a/rt/webrt/Ticket/Elements/EditWatchers b/rt/webrt/Ticket/Elements/EditWatchers new file mode 100755 index 000000000..00185e8f9 --- /dev/null +++ b/rt/webrt/Ticket/Elements/EditWatchers @@ -0,0 +1,46 @@ +%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Ticket/Elements/Attic/EditWatchers,v 1.1 2002-08-12 06:17:09 ivan Exp $ +%# Copyright 1996-2000 Jesse Vincent + +
    + +%# Print out a placeholder if there are none. +%if ($watchers->Count == 0 ) { +
  • none +% } + + +%while (my $watcher=$watchers->Next) { +
  • + +%#If there's a principal backing this user, lets give a link to their +%# account +%if ($watcher->IsUser) { + +<%$watcher->OwnerObj->RealName%>: +%} else { +Email address: +%} +<%$watcher->Email%> +%} +
+<%INIT> +my ($watchers, $watcher, $set); +if ($Type =~ /^request/i) { + $watchers = $TicketObj->Requestors; + } +elsif ($Type =~ /^admin/i) { + $watchers = $TicketObj->AdminCc; + } +elsif ($Type =~ /^cc/i) { + $watchers = $TicketObj->Cc; + } +else { $watchers = $TicketObj->Watchers; + } + +<%ARGS> +$TicketObj => undef +$Type => undef + + + + diff --git a/rt/webrt/Ticket/Elements/ShowBasics b/rt/webrt/Ticket/Elements/ShowBasics new file mode 100755 index 000000000..97c84c9d0 --- /dev/null +++ b/rt/webrt/Ticket/Elements/ShowBasics @@ -0,0 +1,29 @@ + + + + + + + + + + +
+ <& /Elements/ShadedBox, title => 'Id' , content => $Ticket->Id &> + <& /Elements/ShadedBox, title => 'Status' , content => $Ticket->Status &> + + <& /Elements/ShadedBox, title => 'Worked' , content => $TimeWorked ." min" &> + + <& /Elements/ShadedBox, title => 'Priority', content=> $Ticket->Priority."/".$Ticket->FinalPriority &> + + <& /Elements/ShadedBox, title => 'Queue', content=> $Ticket->QueueObj->Name &> +
+<%INIT> +my $TimeWorked = $Ticket->TimeWorked; +if ($Ticket->TimeLeft > 0 ) { + $TimeWorked = $Ticket->TimeWorked."/".$Ticket->TimeLeft; +} + +<%ARGS> +$Ticket => undef + diff --git a/rt/webrt/Ticket/Elements/ShowDates b/rt/webrt/Ticket/Elements/ShowDates new file mode 100755 index 000000000..e17e31355 --- /dev/null +++ b/rt/webrt/Ticket/Elements/ShowDates @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Created: + +<% $Ticket->CreatedObj->AsString %> +
+Starts: + +<% $Ticket->StartsObj->AsString %>
+
+Started: + +<% $Ticket->StartedObj->AsString %> +
+Last Contact: + +<% $Ticket->ToldObj->AsString %> +
+Due: +<% $Ticket->DueObj->AsString %> +
+Updated: + + +<% $Ticket->LastUpdated ? ($Ticket->LastUpdatedAsString ." by ".$Ticket->LastUpdatedByObj->Name) : "Never" | h %> +
+<%ARGS> +$Ticket => undef + diff --git a/rt/webrt/Ticket/Elements/ShowDependencies b/rt/webrt/Ticket/Elements/ShowDependencies new file mode 100755 index 000000000..488652f83 --- /dev/null +++ b/rt/webrt/Ticket/Elements/ShowDependencies @@ -0,0 +1,18 @@ +Depends on:
+% while (my $Link = $Ticket->DependsOn->Next) { +% my $member = $Link->TargetObj; +<%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> +[<%$member->Status%>] +
+% } +Depended on by:
+% while (my $Link = $Ticket->DependedOnBy->Next) { +% my $member = $Link->TargetObj; +<%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> +[<%$member->Status%>] +
+% } + +<%ARGS> +$Ticket => undef + diff --git a/rt/webrt/Ticket/Elements/ShowHistory b/rt/webrt/Ticket/Elements/ShowHistory new file mode 100755 index 000000000..155eaaabd --- /dev/null +++ b/rt/webrt/Ticket/Elements/ShowHistory @@ -0,0 +1,43 @@ + + + + + +
+% if ($ShowTitle) { +History +% } + Display mode: +% if ($ShowHeaders == $Ticket->Id) { +[Brief headers] +[Full headers] +% } else { +[Brief headers] +[Full headers] +% } + +
+ + +% while (my $Transaction = $Transactions->Next) { +% $i++; +% if ($Transactions->IsLast) { + +% } + <& ShowTransaction, Ticket => $Ticket, Transaction => $Transaction, ShowHeaders => $ShowHeaders, Collapsed => $Collapsed, RowNum => $i &> +% } +
+<%INIT> + +my $Transactions = $Ticket->Transactions; +my $i; + + + +<%ARGS> +$URIFile => 'Display.html' +$Ticket => undef +$ShowHeaders => undef +$Collapsed => undef +$ShowTitle => 1 + diff --git a/rt/webrt/Ticket/Elements/ShowKeywordSelects b/rt/webrt/Ticket/Elements/ShowKeywordSelects new file mode 100644 index 000000000..4f8a1786b --- /dev/null +++ b/rt/webrt/Ticket/Elements/ShowKeywordSelects @@ -0,0 +1,26 @@ + +% while ( my $KeywordSelect = $KeywordSelects->Next ) { + + + + +% } +
+ <% $KeywordSelect->Name %>
+
+
    +% my $Keywords = $Ticket->KeywordsObj($KeywordSelect->Id); +% while (my $Keyword = $Keywords->Next) { +
  • <% $Keyword->KeywordObj->RelativePath($KeywordSelect->KeywordObj) |n %>
  • + +% } +
+
+ +<%INIT> +my $KeywordSelects = $Ticket->QueueObj->KeywordSelects; + + +<%ARGS> +$Ticket => undef + diff --git a/rt/webrt/Ticket/Elements/ShowLinks b/rt/webrt/Ticket/Elements/ShowLinks new file mode 100755 index 000000000..49795959e --- /dev/null +++ b/rt/webrt/Ticket/Elements/ShowLinks @@ -0,0 +1,61 @@ +Depends on:
+
    +% while (my $Link = $Ticket->DependsOn->Next) { +% my $member = $Link->TargetObj; +
  • <%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> +[<%$member->Status%>] + +% } +
+ +Depended on by:
+
    +% while (my $Link = $Ticket->DependedOnBy->Next) { +% my $member = $Link->BaseObj; +
  • <%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> +[<%$member->Status%>] +% } +
+Parents:
+
    +% while (my $Link = $Ticket->MemberOf->Next) { +% my $member = $Link->TargetObj; +
  • <%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> +[<%$member->Status%>] + +% } +
+ +Children:
+<& /Ticket/Elements/ShowMembers, Ticket => $Ticket &> +
+Refers to:
+
    +% while (my $Link = $Ticket->RefersTo->Next) { +
  • +% if ($Link->TargetIsLocal) { +% my $member = $Link->TargetObj; + +<%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<%$member->Status%>]
    +% } else { +<%$Link->Target%> +% } +%} +
+ +Referred to by:
+
    +% while (my $Link = $Ticket->ReferredToBy->Next) { +
  • +% if ($Link->BaseIsLocal) { +% my $member = $Link->BaseObj; +<%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<%$member->Status%>]
    +% } else { +<%$Link->Base%> +%} +% } +
+ +<%ARGS> +$Ticket => undef + diff --git a/rt/webrt/Ticket/Elements/ShowMemberOf b/rt/webrt/Ticket/Elements/ShowMemberOf new file mode 100755 index 000000000..df5dc92b0 --- /dev/null +++ b/rt/webrt/Ticket/Elements/ShowMemberOf @@ -0,0 +1,12 @@ +
    +% my $memberof = $Ticket->MemberOf; +% while (my $member_of = $memberof->Next) { +
  • <%$member_of->Id%>: <%$member_of->Subject%> [<%$member_of->Status%>] +% } +
+ +<%INIT> + +<%ARGS> +$Ticket => undef + diff --git a/rt/webrt/Ticket/Elements/ShowMembers b/rt/webrt/Ticket/Elements/ShowMembers new file mode 100755 index 000000000..0a6f12377 --- /dev/null +++ b/rt/webrt/Ticket/Elements/ShowMembers @@ -0,0 +1,22 @@ +% if ($members->Count) { +
    +% while (my $link = $members->Next) { +% my $member= $link->BaseObj; +
  • <%$member->Id%>: <%$member->Subject%> [<%$member->Status%>]
    +% if ($depth < 8) { +<&/Ticket/Elements/ShowMembers, Ticket => $member, depth => ($depth+1) &> +% } +% } +
+% } + +<%INIT> + +my $members = $Ticket->Members; + + + +<%ARGS> +$Ticket => undef +$depth => 1 + diff --git a/rt/webrt/Ticket/Elements/ShowPeople b/rt/webrt/Ticket/Elements/ShowPeople new file mode 100755 index 000000000..ff35f484d --- /dev/null +++ b/rt/webrt/Ticket/Elements/ShowPeople @@ -0,0 +1,12 @@ +Owner
<%$Ticket->OwnerObj->Name%>
+Requestors
<%$Ticket->RequestorsAsString%>
+Cc
<%$Ticket->CcAsString%>
+AdminCc
<%$Ticket->AdminCcAsString%> +<%ARGS> +$Ticket => undef + + diff --git a/rt/webrt/Ticket/Elements/ShowReferences b/rt/webrt/Ticket/Elements/ShowReferences new file mode 100755 index 000000000..37e2fdece --- /dev/null +++ b/rt/webrt/Ticket/Elements/ShowReferences @@ -0,0 +1,27 @@ +
    +% while (my $Link = $Ticket->RefersTo->Next) { +
  • +% if ($Link->TargetIsLocal) { +% my $member = $Link->TargetObj; + +<%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<%$member->Status%>]
    +% } else { +<%$Link->Target%> +% } +%} + + + +% while (my $Link = $Ticket->ReferredToBy->Next) { +
  • +% if ($Link->BaseIsLocal) { +% my $member = $Link->BaseObj; +<%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<%$member->Status%>]
    +% } else { +<%$Link->Base%> +%} +% } +
+<%ARGS> +$Ticket => undef + diff --git a/rt/webrt/Ticket/Elements/ShowRequestor b/rt/webrt/Ticket/Elements/ShowRequestor new file mode 100644 index 000000000..fcbe71df1 --- /dev/null +++ b/rt/webrt/Ticket/Elements/ShowRequestor @@ -0,0 +1,35 @@ +<%PERL> +my $people = $Ticket->Requestors; +while (my $requestor=$people->Next) { +if (($requestor->Owner ) && (my $user=$requestor->OwnerObj)) { +my $name=$user->RealName || $user->EmailAddress; +my $tickets = new RT::Tickets($session{'CurrentUser'}); +$tickets->LimitRequestor(VALUE => $user->EmailAddress); +$tickets->LimitStatus( VALUE => 'open'); +$tickets->LimitStatus( VALUE => 'new'); +$tickets->RowsPerPage(25); +$tickets->OrderBy(FIELD => 'Priority', + ORDER => 'DESC'); + + +% unless ($user->Privileged) { +<& /Elements/TitleBoxStart, + title => "id."\">More about $name" &> + +Comments about this user:
+<% ($user->Comments || "No comment entered about this user") %>
+ +This user's 25 highest priority tickets:
+
    +%while (my $w=$tickets->Next) { +
  • <%$w->Id%>: <%$w->Subject%> (<%$w->Status%>) +%} +
+<& /Elements/TitleBoxEnd &> + +% } +% } +%} +<%ARGS> +$Ticket=>undef + diff --git a/rt/webrt/Ticket/Elements/ShowSummary b/rt/webrt/Ticket/Elements/ShowSummary new file mode 100755 index 000000000..b80ceb4fd --- /dev/null +++ b/rt/webrt/Ticket/Elements/ShowSummary @@ -0,0 +1,61 @@ + + + +
+ + +
+ <& /Elements/TitleBoxStart, title => 'The Basics', + title_href =>"$RT::WebPath/Ticket/Modify.html?id=".$Ticket->Id, + title_class=> 'inverse', + color => "#993333" &> + <& /Ticket/Elements/ShowBasics, Ticket => $Ticket &> + <& /Elements/TitleBoxEnd &> + +
+ + <& /Elements/TitleBoxStart, + title_href =>"$RT::WebPath/Ticket/Modify.html?id=".$Ticket->Id, + title_class=> 'inverse', + title => "Keyword Selections", color => "#993300" + &> + <& /Ticket/Elements/ShowKeywordSelects, Ticket => $Ticket &> + <& /Elements/TitleBoxEnd &> + + + +
+ <& /Elements/TitleBoxStart, title => 'Relationships', + title_href => "$RT::WebPath/Ticket/ModifyLinks.html?id=".$Ticket->Id, + title_class=> 'inverse', + titleright => '', color=> "#336633" &> + <& /Ticket/Elements/ShowLinks, Ticket => $Ticket &> + <& /Elements/TitleBoxEnd &> +
+ + <& /Elements/TitleBoxStart, title => "Dates", + title_href =>"$RT::WebPath/Ticket/ModifyDates.html?id=".$Ticket->Id, + title_class=> 'inverse', + color => "#663366" &> + <& /Ticket/Elements/ShowDates, Ticket => $Ticket &> + <& /Elements/TitleBoxEnd &> +
+ <& /Elements/TitleBoxStart, title => 'People', + title_href =>"$RT::WebPath/Ticket/ModifyPeople.html?id=".$Ticket->Id, + title_class=> 'inverse', + color => "#333399" &> + <& /Ticket/Elements/ShowPeople, Ticket => $Ticket &> + <& /Elements/TitleBoxEnd &> +
+ + <& /Ticket/Elements/ShowRequestor, Ticket => $Ticket &> + + +
+<%ARGS> +$Ticket => undef + + + + + diff --git a/rt/webrt/Ticket/Elements/ShowTransaction b/rt/webrt/Ticket/Elements/ShowTransaction new file mode 100755 index 000000000..a0da008b3 --- /dev/null +++ b/rt/webrt/Ticket/Elements/ShowTransaction @@ -0,0 +1,162 @@ + +   +   +<% $transdate|n %>  +<%$Transaction->CreatorObj->Name%> - <%$TicketString%> <%$Transaction->BriefDescription%> + + +<%$TimeTaken%>  +<%$titlebar_commands|n%> + +<%PERL> + +unless ($Collapsed) { + $attachments->GotoFirstItem; + while (my $message=$attachments->Next) { + #we don't want to show any empty transactions, unless they have kids + next unless (length $message->Content || $message->Children->Count); + my ($headers, $content); + + + + +<%PERL> + if ($message->Parent == 0) { + if ($ShowHeaders == $Ticket->Id) { + $headers = $message->Headers; + } else { + $headers = $message->NiceHeaders; + } + chomp $headers; + $headers .= "\n\n" if ($headers); + } + # 13456 is a random # of about the biggest size we want to see inline text + my $MAX_INLINE_BODY = 13456; + if ($message->ContentType =~ m{^(text/plain|message|text$)}i && + length($message->Content)< $MAX_INLINE_BODY ) { + + $content = $message->Content; + + my $wrapper = new Text::Wrapper (columns=>85); + $content = $wrapper->wrap($content); + $content =~ s/&/&/g; + $content =~ s//>/g; + $content =~ s!((?:http|https|ftp|mailto):\S*?)([\s"']|>|\.[\n])!$1$2!g; + + + } + else { + $content = " "; + } + + + +    +    + +
+<%$headers%><%$content|n%>
+
+ + + +% if ($message->Parent == 0 ) { +
+% } +<%PERL> +my $size = length($message->Content()); + +if ($size) { + if ($size > 1024) { + $size = int($size/102.4)/10 . "k"; + } + else { + $size = $size ."b"; + } + +Download <%$message->Filename|| '(untitled)'%> <% $size %> +% } + + +% } +% } + + + +<%ARGS> +$Ticket => undef +$Transaction => undef +$ShowHeaders => undef +$Collapsed => undef +$ShowTitleBarCommands => 1 +$RowNum => 1 + + +<%INIT> + + +my ($TimeTaken, $TicketString, $bgcolor, $rowbgcolor); + +my $transdate = $Transaction->CreatedAsString(); +$transdate =~ s/\s/ /g; + +if ($RowNum % 2) { + $rowbgcolor="#cccccc"; +} else { + $rowbgcolor="#ffffff"; +} + +if ($Transaction->Type =~ /^(Create|Correspond|Comment$)/) { + if ($Transaction->IsInbound) { + $bgcolor="#336699"; + } + else { + $bgcolor="#339999"; + } +} elsif (($Transaction->Field =~ /^Owner$/) or + ($Transaction->Type =~ /^(AddWatcher|DelWatcher)$/)) { + $bgcolor="#333399"; + +} elsif ($Transaction->Type =~ /^(AddLink|DeleteLink)$/) { + $bgcolor="#336633"; +} elsif ($Transaction->Type =~ /^(Status|Set|Keyword|Told)$/) { + if ($Transaction->Field =~ /^(Told|Starts|Started|Due)$/) { + $bgcolor="#663366"; + } + else { + $bgcolor="#993333"; + } +} +else { + $bgcolor="#cccccc"; +} + +if ($Ticket->Id != $Transaction->Ticket) { + $TicketString = "Ticket ".$Transaction->Ticket .": "; +} + +if ($Transaction->TimeTaken > 0) { + $TimeTaken = $Transaction->TimeTaken." min" +} +my $attachments = $Transaction->Attachments; + +my $titlebar_commands=' '; + +# If the transaction has anything attached to it at all +if ($Transaction->Message->First && $ShowTitleBarCommands) { + if ($Transaction->TicketObj->CurrentUserHasRight('ReplyToTicket')) { + $titlebar_commands .= + "[Ticket . "&QuoteTransaction=".$Transaction->Id. + "&Action=Respond\">Reply] "; + } + if ($Transaction->TicketObj->CurrentUserHasRight('CommentOnTicket')) { + $titlebar_commands .= + "[Ticket. + "&QuoteTransaction=".$Transaction->Id. + "&Action=Comment\">Comment]"; + } +} + + diff --git a/rt/webrt/Ticket/Elements/Tabs b/rt/webrt/Ticket/Elements/Tabs new file mode 100755 index 000000000..8cce197de --- /dev/null +++ b/rt/webrt/Ticket/Elements/Tabs @@ -0,0 +1,126 @@ +<& /Elements/Tabs, tabs => $tabs, actions => $actions, current_tab => $current_tab, tabs_scalar => $tabs_scalar &> +<%INIT> + + my $id = $Ticket->id(); + my $tabs_scalar = ''; + my $tabs = { + A => { title => 'Display', + path => "Ticket/Display.html?id=".$id, + }, + + Ab => { title => 'History', + path => "Ticket/History.html?id=".$id, + }, + B => { title => 'Basics', + path => "Ticket/Modify.html?id=".$id, + }, + + C => { title => 'Dates', + path => "Ticket/ModifyDates.html?id=".$id, + }, + + D => { title => 'People', + path => "Ticket/ModifyPeople.html?id=".$id, + }, + E => { title => 'Links', + path => "Ticket/ModifyLinks.html?id=".$id, + }, + F => { title => 'Jumbo', + path => "Ticket/ModifyAll.html?id=".$id, + }, + + }; + +my $actions; +if ($Ticket->CurrentUserHasRight('ModifyTicket') or + $Ticket->CurrentUserHasRight('CommentOnTicket')) { + $actions->{'Comment'} = + { + title => 'Comment', + path => "Ticket/Update.html?Action=Comment&id=".$id, + } + }; + +if ($Ticket->CurrentUserHasRight('ModifyTicket') or + $Ticket->CurrentUserHasRight('ReplyToTicket')) { + $actions->{'Reply'} = + { + title => 'Reply', + path => "Ticket/Update.html?Action=Respond&id=".$id, + } + }; + +if ($Ticket->CurrentUserHasRight('OwnTicket')) { + if ($Ticket->OwnerObj->id == $RT::Nobody->id) { + $actions->{'Take'} = + { + path => "Ticket/Display.html?Action=Take&id=".$id, + title => 'Take' + }; + } + elsif ( $Ticket->OwnerObj->id != $session{CurrentUser}->id) { + $actions->{'Steal'} = + { + path => "Ticket/Display.html?Action=Steal&id=".$id, + title => 'Steal' + }; + } +} + +if ($Ticket->CurrentUserHasRight('ModifyTicket')) { + if ($Ticket->Status ne 'resolved') { + $actions->{'Resolve'} = + { + + path => "Ticket/Update.html?Action=Comment&DefaultStatus=resolved&id=".$id, + title => 'Resolve' + }; + } + if ($Ticket->Status ne 'open') { + $actions->{'Open'} = + { + path => "Ticket/Display.html?Status=open&id=". $id, + title => 'Open' + }; + } +} + + + + +if (defined $session{'tickets'}) { + my $items = $session{'tickets'}->ItemsArrayRef(); + my @indexs = grep(($items->[$_]->id == $Ticket->Id), 0 .. $#{$items}); + + if ($items->[0]) { + + if ($items->[$indexs[0]]->id == $Ticket->Id) { + # Don't display prev links if we're on the first ticket + if ( $items->[0]->id != $Ticket->id ) { + $tabs_scalar .= '[<< First] '; + $tabs_scalar .= '[< Prev] '; + } + # Don't display next links if we're on the last ticket + if ( $Ticket->id != $items->[-1]->id ) { + $tabs_scalar .= '[Next >] '; + $tabs_scalar .= '[Last >>]'; + } + $tabs_scalar .= "

"; + } + } +} + + + +<%ARGS> +$Ticket => undef +$current_tab => undef + diff --git a/rt/webrt/Ticket/Elements/ToolBar b/rt/webrt/Ticket/Elements/ToolBar new file mode 100755 index 000000000..108e2f784 --- /dev/null +++ b/rt/webrt/Ticket/Elements/ToolBar @@ -0,0 +1,3 @@ +<%ARGS> +$Ticket => undef + diff --git a/rt/webrt/Ticket/History.html b/rt/webrt/Ticket/History.html new file mode 100755 index 000000000..e0a5fe15a --- /dev/null +++ b/rt/webrt/Ticket/History.html @@ -0,0 +1,30 @@ +%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Ticket/Attic/History.html,v 1.1 2002-08-12 06:17:09 ivan Exp $ +%# Copyright 1996-2000 Jesse Vincent + +<& /Elements/Header, Title => "Ticket History #".$Ticket->Id ." ".$Ticket->Subject &> +<& /Ticket/Elements/Tabs, Ticket => $Ticket, current_tab => 'Ticket/History.html?id='.$Ticket->id &> + +
+ +<& /Ticket/Elements/ShowHistory , Ticket => $Ticket, ShowHeaders => $ARGS{'ShowHeaders'}, URIFile => 'History.html' &> + + +<%ARGS> +$id => undef + + +<%INIT> + + + +my $Ticket = LoadTicket ($id); + +unless ($Ticket->CurrentUserHasRight('ShowTicket')) { + Abort("No permission to view ticket"); +} + + + + + + diff --git a/rt/webrt/Ticket/Modify.html b/rt/webrt/Ticket/Modify.html new file mode 100755 index 000000000..7a8a79216 --- /dev/null +++ b/rt/webrt/Ticket/Modify.html @@ -0,0 +1,39 @@ +<& /Elements/Header, Title => 'Modify ticket #'.$TicketObj->Id &> +<& /Ticket/Elements/Tabs, Ticket => $TicketObj, current_tab => "Ticket/Modify.html?id=".$TicketObj->Id &> + +<& /Elements/ListActions, actions => \@results &> +
+ + +<& /Elements/TitleBoxStart, title => 'Modify ticket #'.$TicketObj->Id, + color=> "#993333", width => "100%" &> +<& Elements/EditBasics, TicketObj => $TicketObj &> +<& /Elements/TitleBoxEnd &> + +<& /Elements/TitleBoxStart, title => 'Keywords', color =>"#993333"&> +<& Elements/EditKeywordSelects, TicketObj=>$TicketObj &> +<& /Elements/TitleBoxEnd &> + +<& /Elements/Submit, Label => 'Save Changes', Caption => "If you've updated anything above, be sure to", color => "#993333" &> +
+<%INIT> + +my $TicketObj = LoadTicket($id); + +my @results = ProcessTicketBasics(TicketObj => $TicketObj, ARGSRef => \%ARGS); +my @okresults = ProcessTicketObjectKeywords(TicketObj => $TicketObj, ARGSRef => \%ARGS); + +push (@results, @okresults); + +# TODO: display the results, even if we can't display the ticket + +unless ($TicketObj->CurrentUserHasRight('ShowTicket')) { + Abort("No permission to view ticket"); +} + + + + +<%ARGS> +$id => undef + diff --git a/rt/webrt/Ticket/ModifyAll.html b/rt/webrt/Ticket/ModifyAll.html new file mode 100755 index 000000000..ad913739d --- /dev/null +++ b/rt/webrt/Ticket/ModifyAll.html @@ -0,0 +1,124 @@ +<& /Elements/Header, Title => "Ticket #".$Ticket->Id ." Jumbo update: ".$Ticket->Subject &> +<& /Ticket/Elements/Tabs, Ticket => $Ticket , current_tab => "Ticket/ModifyAll.html?id=".$Ticket->Id &> + +<& /Elements/ListActions, actions => \@results &> + +
+ + + +<& /Elements/TitleBoxStart, title => 'Modify ticket #'.$Ticket->Id, color=> "#993333", width => "100%" &> +<& Elements/EditBasics, TicketObj => $Ticket &> +<& /Elements/TitleBoxEnd &> + +
+ +<& /Elements/TitleBoxStart, title => 'Dates', width => "100%", color => "#663366" &> +<& Elements/EditDates, TicketObj => $Ticket &> +<& /Elements/TitleBoxEnd &> + +
+ +<& /Elements/TitleBoxStart, title => 'Keywords', color =>"#993333"&> +<& Elements/EditKeywordSelects, TicketObj=>$Ticket &> +<& /Elements/TitleBoxEnd &> + +
+ +<& /Elements/TitleBoxStart, title => 'People',width => "100%", color=> "#333399" &> +<& Elements/EditPeople, Ticket => $Ticket, UserField => $UserField, UserString => $UserString, UserOp => $UserOp &> +<& /Elements/TitleBoxEnd &> + +
+ +<& /Elements/TitleBoxStart, title => 'Relationships', color => "#336633"&> +<& Elements/EditLinks, Ticket => $Ticket &> +<& /Elements/TitleBoxEnd &> + +
+ +<& /Elements/TitleBoxStart, title => 'Update ticket' &> +
+Update Type: +
+ +Subject:
+Attach:
+<& /Elements/MessageBox, Name=>"UpdateContent", QuoteTransaction=>$ARGS{QuoteTransaction} &> +<& /Elements/TitleBoxEnd &> + + +<& /Elements/Submit, Label => 'Save Changes', Caption => "If you've updated anything above, be sure to", color => "#333399" &> +
+ +<%INIT> + + + +my $Ticket = LoadTicket($id); + +my $CanRespond = 0; +my $CanComment = 0; + + +$CanRespond = 1 if ( $Ticket->CurrentUserHasRight('ReplyToTicket') or + $Ticket->CurrentUserHasRight('ModifyTicket') ); + +$CanComment = 1 if ( $Ticket->CurrentUserHasRight('CommentOnTicket') or + $Ticket->CurrentUserHasRight('ModifyTicket') ); + + +my (@wresults, @results, @okresults, @dresults, @lresults); + +unless ($OnlySearchForPeople) { + @wresults = ProcessTicketWatchers( TicketObj => $Ticket, ARGSRef => \%ARGS); + @results = ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS); + @okresults = ProcessTicketObjectKeywords(TicketObj => $Ticket, ARGSRef => \%ARGS); + + @dresults = ProcessTicketDates( TicketObj => $Ticket, ARGSRef => \%ARGS); + @lresults = ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS); + + $ARGS{'UpdateContent'} =~ s/\r\n/\n/g; + + if ($ARGS{'UpdateContent'} && + $ARGS{'UpdateContent'} ne '' && + $ARGS{'UpdateContent'} ne "-- \n" . + $session{'CurrentUser'}->UserObj->Signature + ) { + ProcessUpdateMessage(TicketObj => $Ticket, + ARGSRef=>\%ARGS, + Actions=>\@results); + } +} +push @results, @wresults; +push @results, @dresults; +push @results, @lresults; +push @results, @okresults; + +# If they've gone and moved the ticket to somewhere they can't see, etc... +# TODO: display the results, even if we can't display the ticket. + +unless ($Ticket->CurrentUserHasRight('ShowTicket')) { + Abort("No permission to view ticket"); +} + + + + + + +<%ARGS> +$OnlySearchForPeople => undef +$UserField => undef +$UserOp => undef +$UserString => undef +$id => undef + + diff --git a/rt/webrt/Ticket/ModifyDates.html b/rt/webrt/Ticket/ModifyDates.html new file mode 100755 index 000000000..b2ecb68fb --- /dev/null +++ b/rt/webrt/Ticket/ModifyDates.html @@ -0,0 +1,26 @@ +<& /Elements/Header, Title => 'Modify dates for #'. $TicketObj->Id &> +<& /Ticket/Elements/Tabs, Ticket => $TicketObj, current_tab => "Ticket/ModifyDates.html?id=".$TicketObj->Id &> + +<& /Elements/ListActions, actions => \@results &> + +
+ +<& /Elements/TitleBoxStart, title => 'Modify dates for ticket #'.$TicketObj->Id, width => "100%", color => "#663366" &> + +<& Elements/EditDates, TicketObj => $TicketObj &> +<& /Elements/TitleBoxEnd &> +<& /Elements/Submit, color => "#663366" &> +
+ + +<%INIT> + +my $TicketObj = LoadTicket($id); +my @results = ProcessTicketDates( TicketObj => $TicketObj, ARGSRef => \%ARGS); + + + + +<%ARGS> +$id => undef + diff --git a/rt/webrt/Ticket/ModifyLinks.html b/rt/webrt/Ticket/ModifyLinks.html new file mode 100755 index 000000000..14c939d43 --- /dev/null +++ b/rt/webrt/Ticket/ModifyLinks.html @@ -0,0 +1,31 @@ +%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Ticket/Attic/ModifyLinks.html,v 1.1 2002-08-12 06:17:09 ivan Exp $ +%# Copyright 1996-2000 Jesse Vincent + +<& /Elements/Header, Title => "Link ticket ".$Ticket->Id &> +<& /Ticket/Elements/Tabs, Ticket => $Ticket, current_tab => "Ticket/ModifyLinks.html?id=".$Ticket->Id &> + +<& /Elements/ListActions, actions => \@results &> + +
+ + +<& /Elements/TitleBoxStart, title => 'Edit Relationships', color => "#336633"&> +<& Elements/EditLinks, Ticket => $Ticket &> +<& /Elements/TitleBoxEnd &> +<& /Elements/Submit, color => "#336633", Caption=> 'Save changes' &> +
+ + + + +<%INIT> + +my $Ticket = LoadTicket($id); +my @results = ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS); + + + + +<%ARGS> +$id => undef + diff --git a/rt/webrt/Ticket/ModifyPeople.html b/rt/webrt/Ticket/ModifyPeople.html new file mode 100755 index 000000000..fecf09192 --- /dev/null +++ b/rt/webrt/Ticket/ModifyPeople.html @@ -0,0 +1,38 @@ +<& /Elements/Header, Title => 'Modify people related to ticket # ' . $Ticket->id &> +<& /Ticket/Elements/Tabs, Ticket => $Ticket , current_tab => "Ticket/ModifyPeople.html?id=".$Ticket->Id &> + +<& /Elements/ListActions, actions => \@results &> + +
+ +<& /Elements/TitleBoxStart, title => 'Modify people related to ticket #'.$Ticket->Id, width => "100%", color=> "#333399" &> +<& Elements/EditPeople, Ticket => $Ticket, UserField => $UserField, UserString => $UserString, UserOp => $UserOp &> +<& /Elements/TitleBoxEnd &> +<& /Elements/Submit, Label => 'Save Changes', Caption => "If you've updated anything above, be sure to", color => "#333399" &> +
+ +<%INIT> + +my (@results, @wresults); + +my $Ticket = LoadTicket($id); + +# if we're trying to search for watchers and nothing else +unless ($OnlySearchForPeople) { + @results = ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS); + @wresults = ProcessTicketWatchers( TicketObj => $Ticket, ARGSRef => \%ARGS); +} + +push @results, @wresults; + + + + +<%ARGS> +$OnlySearchForPeople => undef +$UserField => undef +$UserOp => undef +$UserString => undef +$id => undef + + diff --git a/rt/webrt/Ticket/Update.html b/rt/webrt/Ticket/Update.html new file mode 100755 index 000000000..be2266663 --- /dev/null +++ b/rt/webrt/Ticket/Update.html @@ -0,0 +1,110 @@ +<& /Elements/Header, Title=> $title &> +<& /Ticket/Elements/Tabs, Ticket => $Ticket &> +<& /Elements/TitleBoxStart, title => "Update ticket" &> + +
+ + + + + + +
+Ticket watchers +Requestor: + +<% $Ticket->RequestorsAsString %> +
  +Cc: + +<% $Ticket->CcAsString %> +
  +AdminCc: + +<% $Ticket->AdminCcAsString %> +
+
+ + + + + + + + + + + +
Status: +<& /Elements/SelectStatus, Name=>"Status", Default => $DefaultStatus &> +Owner: +<& /Elements/SelectOwner, Name=>"Owner", Default => $Ticket->OwnerObj->Id(), QueueObj => $Ticket->QueueObj, TicketObj => $Ticket &> +Worked: minutes
Update Type: +
Subject:
Cc:
+(Sends a carbon-copy of this update to a comma-delimited list +of email addresses. Does not change who will receive future updates.) +
Bcc:
+(Sends a blind carbon-copy of this update to a comma-delimited list +of email addresses. Does not change who will receive future updates.) +
Attach:
+<& /Elements/MessageBox, Name=>"UpdateContent", QuoteTransaction=>$ARGS{QuoteTransaction} &> +
+ + + + +<& /Elements/TitleBoxEnd &> +<& /Elements/Submit &> +
+ + + +<%INIT> + +my $CanRespond = 0; +my $CanComment = 0; +my $title; + +my $Ticket = LoadTicket($id); + + +if ($DefaultStatus eq 'resolved') { + $title = "Resolve"; +} else { + $title = "Update"; +} + +$title .= " ticket #" . $Ticket->id . " (" .$Ticket->Subject.")"; + +# 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" : ""; + +$DefaultStatus = $Ticket->Status() unless ($DefaultStatus); + +$CanRespond = 1 if ( $Ticket->CurrentUserHasRight('ReplyToTicket') or + $Ticket->CurrentUserHasRight('ModifyTicket') ); + +$CanComment = 1 if ( $Ticket->CurrentUserHasRight('CommentOnTicket') or + $Ticket->CurrentUserHasRight('ModifyTicket') ); + + + + + + + +<%ARGS> +$id => undef +$Action => undef +$DefaultStatus => undef + -- cgit v1.2.1