diff options
Diffstat (limited to 'rt/html/Ticket/Create.html')
-rw-r--r-- | rt/html/Ticket/Create.html | 137 |
1 files changed, 90 insertions, 47 deletions
diff --git a/rt/html/Ticket/Create.html b/rt/html/Ticket/Create.html index 5b8c908a1..b547242f2 100644 --- a/rt/html/Ticket/Create.html +++ b/rt/html/Ticket/Create.html @@ -1,8 +1,14 @@ -%# BEGIN LICENSE BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# -%# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com> +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> %# -%# (Except where explictly superceded by other copyright notices) +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: %# %# This work is made available to you under the terms of Version 2 of %# the GNU General Public License. A copy of that license should have @@ -14,18 +20,34 @@ %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# -%# Unless otherwise specified, all modifications, corrections or -%# extensions to this work which alter its source code become the -%# property of Best Practical Solutions, LLC when submitted for -%# inclusion in the work. +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# %# +%# CONTRIBUTION SUBMISSION POLICY: %# -%# END LICENSE BLOCK +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => loc("Create a new ticket") &> <& /Elements/Tabs, current_toptab => "Ticket/Create.html", Title => loc("Create a new ticket") &> -<FORM ACTION="<%$RT::WebPath%>/Ticket/Create.html" METHOD="POST" ENCTYPE="multipart/form-data"> +<FORM ACTION="<%$RT::WebPath%>/Ticket/Create.html" METHOD="POST" ENCTYPE="multipart/form-data" NAME="TicketCreate"> <INPUT TYPE=HIDDEN Name="id" VALUE="new"> <A NAME="top"> @@ -34,55 +56,55 @@ <BR> <& /Elements/TitleBoxStart, contentbg => "#cccccc", title => loc("Create a new ticket") &> <TABLE border=0 cellpadding=0 cellspacing=0> -<TR><TD><&|/l&>Queue</&></TD> -<TD><% $QueueObj->Name %> +<TR><TD class=label><&|/l&>Queue</&>:</TD> +<TD class=value><% $QueueObj->Name %> <INPUT TYPE=HIDDEN NAME=Queue Value="<%$QueueObj->Name%>"> </TD> -<TD><&|/l&>Status</&>: +<TD class=label><&|/l&>Status</&>: </TD> -<TD> -<& /Elements/SelectStatus, Name => "Status", Default => $ARGS{Status}||'new' &> +<TD class=value> +<& /Elements/SelectStatus, Name => "Status", Default => $ARGS{Status}||'new', DefaultValue => 0 &> </TD> -<TD> +<TD class=label> <&|/l&>Owner</&>: </TD> -<TD> -<& /Elements/SelectOwner, Name => "Owner", QueueObj => $QueueObj, Default => $ARGS{Owner}||undef &> +<TD class=value> +<& /Elements/SelectOwner, Name => "Owner", QueueObj => $QueueObj, Default => $ARGS{Owner}||$RT::Nobody->Id, DefaultValue => 0 &> </TD> </TR> <TR> -<TD> +<TD class=label> <&|/l&>Requestors</&>: </TD> -<TD COLSPAN=5> +<TD class=value COLSPAN=5> <INPUT Name="Requestors" Value="<% ($ARGS{Requestors}) || $session{CurrentUser}->EmailAddress %>" SIZE=40> </TD> </TR> <TR> -<TD> +<TD class=labeltop> <&|/l&>Cc</&>: </TD> -<TD COLSPAN=5> -<INPUT NAME="Cc" SIZE=40<% $ARGS{Cc} && " VALUE=\"$ARGS{Cc}\""%>><BR> +<TD class=value COLSPAN=5> +<INPUT NAME="Cc" SIZE=40 VALUE="<% $ARGS{Cc} %>"><BR> <i><font size=-2> <&|/l&>(Sends a carbon-copy of this update to a comma-delimited list of email addresses. These people <b>will</b> receive future updates.)</&></font></i> </TD> </TR> <TR> -<TD> +<TD class=labeltop> <&|/l&>Admin Cc</&>: </TD> -<TD COLSPAN=5> -<INPUT NAME="AdminCc" SIZE=40<% $ARGS{AdminCc} && " VALUE=\"$ARGS{AdminCc}\""%>><BR> +<TD class=value COLSPAN=5> +<INPUT NAME="AdminCc" SIZE=40 VALUE="<% $ARGS{AdminCc} %>"><BR> <i><font size=-2> <&|/l&>(Sends a carbon-copy of this update to a comma-delimited list of administrative email addresses. These people <b>will</b> receive future updates.)</&></font></i> </TD> </TR> <TR> -<TD> +<TD class=label> <&|/l&>Subject</&>: </TD> -<TD COLSPAN=5> +<TD class=value COLSPAN=5> <INPUT Name="Subject" SIZE=60 MAXSIZE=100 value="<%$ARGS{Subject} || ''%>"> </TD> </TR> @@ -91,15 +113,24 @@ <& /Ticket/Elements/EditCustomFields, QueueObj => $QueueObj &> </TD> </TR> +% if ($TxnCFs->Count) { +% while (my $CF = $TxnCFs->Next()) { +<TR> +<TD ALIGN=RIGHT><% $CF->Name %>:</TD> +<TD><& /Elements/EditCustomField, CustomField => $CF, NamePrefix => + "Object-RT::Transaction--CustomField-" &><em><% $CF->FriendlyType %></em></TD> +</TD></TR> +% } +% } <TR> % if (exists $session{'Attachments'}) { -<TD> +<TD class=label> <&|/l&>Attached file</&>: </TD> <TD COLSPAN=5> <&|/l&>Check box to delete</&><BR> % foreach my $attach_name (keys %{$session{'Attachments'}}) { -<input type="checkbox" name="DeleteAttach-<%$attach_name%>"><%$attach_name%><BR> +<input type="checkbox" name="DeleteAttach-<%$attach_name%>" value="1"><%$attach_name%><BR> % } # end of foreach </TD> </TR> @@ -108,7 +139,7 @@ <TD> <&|/l&>Attach file</&>: </TD> -<TD COLSPAN=5> +<TD class=value COLSPAN=5> <INPUT TYPE=FILE NAME="Attach"> <INPUT TYPE=SUBMIT NAME="AddMoreAttach" VALUE="<&|/l&>Add More Files</&>"> </TD> @@ -117,7 +148,7 @@ <TD COLSPAN=6> <&|/l&>Describe the issue below</&>:<br> % if (exists $ARGS{Content}) { -<& /Elements/MessageBox, Default => $ARGS{Content} &> +<& /Elements/MessageBox, Default => $ARGS{Content}, IncludeSignature => 0 &> % } else { <& /Elements/MessageBox, QuoteTransaction => $QuoteTransaction &> %} @@ -152,8 +183,8 @@ <TABLE BORDER=0> <TR><TD ALIGN=RIGHT><&|/l&>Priority</&>:</TD><TD><input size=3 name="InitialPriority" value="<% $ARGS{InitialPriority} ? $ARGS{InitialPriority} : $QueueObj->InitialPriority %>"></TD></TR> <TR><TD ALIGN=RIGHT><&|/l&>Final Priority</&>:</TD><TD><input size=3 name="FinalPriority" value="<% $ARGS{FinalPriority} ? $ARGS{FinalPriority} : $QueueObj->FinalPriority %>"></TD></TR> -<TR><TD ALIGN=RIGHT><&|/l&>Time Worked</&>:</TD><TD><input size=3 name="TimeWorked"<% $ARGS{TimeWorked} && " VALUE=\"$ARGS{TimeWorked}\"" %>></TD></TR> -<TR><TD ALIGN=RIGHT><&|/l&>Time Left</&>:</TD><TD><input size=3 name="TimeLeft"<% $ARGS{TimeLeft} && " VALUE=\"$ARGS{TimeLeft}\"" %>></TD></TR> +<TR><TD ALIGN=RIGHT><&|/l&>Time Worked</&>:</TD><TD><&|/l,'<input size=3 name="TimeWorked" value="'.$ARGS{TimeWorked}.'">'&>[_1] min</&></TD></TR> +<TR><TD ALIGN=RIGHT><&|/l&>Time Left</&>:</TD><TD><&|/l,'<input size=3 name="TimeLeft" value="'.$ARGS{TimeLeft}.'">'&>[_1] min</&></TD></TR> </TABLE> <& /Elements/TitleBoxEnd &> <br> @@ -162,26 +193,27 @@ color => "#663366" &> <TABLE BORDER=0> -<TR><TD ALIGN=RIGHT><&|/l&>Starts</&>:</TD><TD><input size=10 name="Starts"<% $ARGS{Starts} && " VALUE=\"$ARGS{Starts}\"" %>></TD></TR> -<TR><TD ALIGN=RIGHT><&|/l&>Due</&>:</TD><TD><input size=10 name="Due"<% $ARGS{Due} && " VALUE=\"$ARGS{Due}\"" %>></TD></TR> +<TR><TD ALIGN=RIGHT><&|/l&>Starts</&>:</TD><TD><input size=10 name="Starts" value="<% $ARGS{Starts} %>"></TD></TR> +<TR><TD ALIGN=RIGHT><&|/l&>Due</&>:</TD><TD><input size=10 name="Due" value="<% +$ARGS{Due}%>"></TD></TR> </TABLE> <& /Elements/TitleBoxEnd &> <BR> </TD> <TD VALIGN="TOP"> -<& /Elements/TitleBoxStart, title => loc('Relationships'), +<& /Elements/TitleBoxStart, title => loc('Links'), title_class=> 'inverse', titleright => '', color=> "#336633" &> -<i><&|/l&>(Enter ticket ids or URLs, seperated with spaces)</&></i> +<i><&|/l&>(Enter ticket ids or URLs, separated with spaces)</&></i> <TABLE BORDER=0> -<TR><TD ALIGN=RIGHT><&|/l&>Depends on</&></TD><TD><input size=10 name="new-DependsOn"<% $ARGS{'new-DependsOn'} && " VALUE=\"$ARGS{'new-DependsOn'}\""%>></TD></TR> -<TR><TD ALIGN=RIGHT><&|/l&>Depended on by</&></TD><TD><input size=10 name="DependsOn-new"<% $ARGS{'DependsOn-new'} && " VALUE=\"$ARGS{'DependsOn-new'}\"" %>></TD></TR> -<TR><TD ALIGN=RIGHT><&|/l&>Parents</&></TD><TD><input size=10 name="new-MemberOf"<% $ARGS{'new-MemberOf'} && " VALUE=\"$ARGS{'new-MemberOf'}\"" %>></TD></TR> -<TR><TD ALIGN=RIGHT><&|/l&>Children</&></TD><TD><input size=10 name="MemberOf-new" <% $ARGS{'MemberOf-new'} && " VALUE=\"$ARGS{'MemberOf-new'}\"" %>></TD></TR> -<TR><TD ALIGN=RIGHT><&|/l&>Refers to</&></TD><TD><input size=10 name="new-RefersTo"<% $ARGS{'new-RefersTo'} && " VALUE=\"$ARGS{'new-MemberOf'}\"" %>></TD></TR> -<TR><TD ALIGN=RIGHT><&|/l&>Referred to by</&></TD><TD><input size=10 name="RefersTo-new"<% $ARGS{'RefersTo-new'} && " VALUE=\"$ARGS{'RefersTo-new'}\"" %>></TD></TR> +<TR><TD ALIGN=RIGHT><&|/l&>Depends on</&></TD><TD><input size=10 name="new-DependsOn" value="<% $ARGS{'new-DependsOn'} %>"></TD></TR> +<TR><TD ALIGN=RIGHT><&|/l&>Depended on by</&></TD><TD><input size=10 name="DependsOn-new" value="<% $ARGS{'DependsOn-new'} %>"></TD></TR> +<TR><TD ALIGN=RIGHT><&|/l&>Parents</&></TD><TD><input size=10 name="new-MemberOf" value="<% $ARGS{'new-MemberOf'} %>"></TD></TR> +<TR><TD ALIGN=RIGHT><&|/l&>Children</&></TD><TD><input size=10 name="MemberOf-new" value="<% $ARGS{'MemberOf-new'} %>"></TD></TR> +<TR><TD ALIGN=RIGHT><&|/l&>Refers to</&></TD><TD><input size=10 name="new-RefersTo" value="<% $ARGS{'new-RefersTo'} %>"></TD></TR> +<TR><TD ALIGN=RIGHT><&|/l&>Referred to by</&></TD><TD><input size=10 name="RefersTo-new" value="<% $ARGS{'RefersTo-new'} %>"></TD></TR> </TABLE> @@ -200,9 +232,22 @@ <BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR> <%INIT> + + + my $QueueObj = new RT::Queue($session{'CurrentUser'}); $QueueObj->Load($Queue) || Abort(loc("Queue could not be loaded.")); -my $CFs = $QueueObj->CustomFields(); +my $CFs = $QueueObj->TicketCustomFields(); +my $TxnCFs = $QueueObj->TicketTransactionCustomFields(); + +# if no due date has been set explicitly, then use the +# queue's default if it exists +if ($QueueObj->DefaultDueIn && !$ARGS{'Due'}) { + my $default_due = RT::Date->new($session{'CurrentUser'}); + $default_due->SetToNow(); + $default_due->AddDays($QueueObj->DefaultDueIn); + $ARGS{'Due'} = $default_due->ISO(); +} # {{{ deal with deleting uploaded attachments foreach my $key (keys %ARGS) { @@ -218,8 +263,6 @@ if ($ARGS{'Attach'}) { # attachment? my $subject = "$ARGS{'Attach'}"; - # since CGI.pm deutf8izes the magic field, we need to add it back. - Encode::_utf8_on($subject); # strip leading directories $subject =~ s#^.*[\\/]##; @@ -244,7 +287,7 @@ unless (keys %{$session{'Attachments'}} and $ARGS{'id'} eq 'new') { if ((!exists $ARGS{'AddMoreAttach'}) && ($ARGS{'id'} eq 'new')) { # new ticket? $m->comp('Display.html', %ARGS); - $m->abort(); + return(); } </%INIT> |