diff options
Diffstat (limited to 'rt/webrt/Admin/Queues')
-rwxr-xr-x | rt/webrt/Admin/Queues/Create.html | 13 | ||||
-rwxr-xr-x | rt/webrt/Admin/Queues/GroupRights.html | 103 | ||||
-rw-r--r-- | rt/webrt/Admin/Queues/Keywords.html | 114 | ||||
-rwxr-xr-x | rt/webrt/Admin/Queues/Modify.html | 137 | ||||
-rwxr-xr-x | rt/webrt/Admin/Queues/People.html | 161 | ||||
-rwxr-xr-x | rt/webrt/Admin/Queues/Scrips.html | 111 | ||||
-rwxr-xr-x | rt/webrt/Admin/Queues/Template.html | 68 | ||||
-rwxr-xr-x | rt/webrt/Admin/Queues/Templates.html | 24 | ||||
-rwxr-xr-x | rt/webrt/Admin/Queues/UserRights.html | 72 | ||||
-rwxr-xr-x | rt/webrt/Admin/Queues/index.html | 52 |
10 files changed, 855 insertions, 0 deletions
diff --git a/rt/webrt/Admin/Queues/Create.html b/rt/webrt/Admin/Queues/Create.html new file mode 100755 index 000000000..b39d6590c --- /dev/null +++ b/rt/webrt/Admin/Queues/Create.html @@ -0,0 +1,13 @@ +<& /Admin/Elements/Header, Title => 'Create a queue' &> + <h1>Create a queue</h1> + +<& /Admin/Elements/ModifyQueue, QueueObj => $QueueObj &> + +<%INIT> +my $QueueObj = new RT::Queue($session{'CurrentUser'}); +$QueueObj->Create(Name => "$Name"); +</%INIT> + +<%ARGS> +$Name => undef +</%ARGS> diff --git a/rt/webrt/Admin/Queues/GroupRights.html b/rt/webrt/Admin/Queues/GroupRights.html new file mode 100755 index 000000000..a2c669083 --- /dev/null +++ b/rt/webrt/Admin/Queues/GroupRights.html @@ -0,0 +1,103 @@ +<& /Admin/Elements/Header, Title => 'Modify group rights for queue '. $QueueObj->Name &> +<& /Admin/Elements/QueueTabs, id => $id &> +<& /Elements/ListActions, actions => \@results &> + + <FORM METHOD=POST ACTION="GroupRights.html"> + <INPUT TYPE=HIDDEN NAME=id VALUE="<% $QueueObj->id %>"> + + + +<& /Elements/TitleBoxStart, title => 'Modify group rights for queue '.$QueueObj->Name &> + +<TABLE> +<TR><TD>Pseudogroups</TD></TR> +% while (my $GroupObj = $PseudoGroups->Next()) { + + <TR ALIGN=RIGHT> + <TD VALIGN=TOP> + <% $GroupObj->Name %> + </TD> + <TD> + <& /Admin/Elements/SelectRights, PrincipalObj => $GroupObj, + PrincipalType => 'Group', + QueueObj => $QueueObj, + Scope => 'Queue' &> + + </TD> + </TR> + +% } + +<TR><TD>Groups</TD></TR> + +% while (my $GroupObj = $Groups->Next()) { + + <TR ALIGN=RIGHT> + <TD VALIGN=TOP> + <% $GroupObj->Name %> + </TD> + <TD> + <& /Admin/Elements/SelectRights, PrincipalObj => $GroupObj, + PrincipalType => 'Group', + QueueObj => $QueueObj, + Scope => 'Queue' &> + + </TD> + </TR> + +% } + + </TABLE> + + <& /Elements/TitleBoxEnd &> + <& /Elements/Submit, Caption => "Be sure to save your changes", Reset => 1 &> + </FORM> + +<%INIT> + +#Update the acls. +my @results = ProcessACLChanges(\@CheckACL, \%ARGS); + +# {{{ Deal with setting up the display of current rights. + +# {{{ do basic initialization. + +#Define vars used in html above +my ($GroupObj); + +my ($right); + + +if (!defined $id) { + Abort("No Queue defined"); +} + +my $QueueObj = new RT::Queue($session{'CurrentUser'}); +$QueueObj->Load($id) || + Abort("Couldn't load queue $id"); + + # Find out which groups we want to display ACL selects for. + my $Groups = new RT::Groups($session{'CurrentUser'}); + #TODO: limit this to non-pseudogroups + $Groups->LimitToReal(); + + + my $PseudoGroups = new RT::Groups($session{'CurrentUser'}); + #TODO: limit this to non-pseudogroups + $PseudoGroups->LimitToPseudo; + + +# }}} + + + # }}} + +</%INIT> + +<%ARGS> +$id => undef +$UserString => undef +$UserOp => undef +$UserField => undef +@CheckACL => undef +</%ARGS> diff --git a/rt/webrt/Admin/Queues/Keywords.html b/rt/webrt/Admin/Queues/Keywords.html new file mode 100644 index 000000000..7809805c5 --- /dev/null +++ b/rt/webrt/Admin/Queues/Keywords.html @@ -0,0 +1,114 @@ +<& /Admin/Elements/Header, Title => 'Edit keywords' &> +<& /Admin/Elements/QueueTabs, id => $QueueObj->Id &> + +<& /Elements/ListActions, actions => \@actions &> + +<& /Elements/TitleBoxStart, title => $description &> + +<h2>Global Keyword Selections</h2> +<& /Admin/Elements/ListGlobalKeywordSelects &> +<BR> + + <FORM METHOD=POST ACTION="Keywords.html"> + <INPUT TYPE=HIDDEN NAME=id VALUE="<%$id%>"> + +% if ($KeywordSelects->Count > 0 ) { + + +<h2>Queue Keyword Selections</h2> +<TABLE> +<TR><TD>Delete</TD></TR> +% while (my $keywordselect = $KeywordSelects->Next ) { +<TR> + <TD><INPUT TYPE="CHECKBOX" NAME="KeywordSelect-<%$keywordselect->Id%>-Delete"></TD> + <TD><& /Admin/Elements/SelectKeywordSelect, KeywordSelect => $keywordselect &></TD> +</TR> +% } +</TABLE> +% } + +Add a keyword selection to this queue: +%my $ks = new RT::KeywordSelect($session{'CurrentUser'}); +<ul> +<li><& /Admin/Elements/SelectKeywordSelect, KeywordSelect => $ks, NamePrefix => 'new' &></li> +</ul> + +<& /Elements/TitleBoxEnd &> +<& /Elements/Submit &> + +</FORM> +<%init> +my (@actions); + + + +my $KeywordSelects = new RT::KeywordSelects ($session{'CurrentUser'}); +unless ($id =~ /^\d+$/) { + Abort("$id isn't a valid Queue id."); +} + +unless ($KeywordSelects->LimitToQueue($id)) { + Abort("Couldn't load KeywordSelects."); +} + +my $QueueObj = new RT::Queue($session{'CurrentUser'}); +$QueueObj->Load($id); + +my $description = "Modify Keyword selections for queue '". $QueueObj->Name ."'"; + + + +# {{{ if we're trying to create a new keyword select + +if ($ARGS{'KeywordSelect-new-Name'}) { + my $NewKeywordSelect = new RT::KeywordSelect($session{'CurrentUser'}); + + my ($retval, $msg) = $NewKeywordSelect->Create ( Keyword => $ARGS{'KeywordSelect-new-Keyword'}, + ObjectField => 'Queue', + ObjectType => 'Ticket', + ObjectValue => $QueueObj->Id, + Name => $ARGS{'KeywordSelect-new-Name'}, + Single => $ARGS{'KeywordSelect-new-Single'}, + Depth => $ARGS{'KeywordSelect-new-Depth'} + ); + push (@actions, $msg); +} +# }}} +# {{{ if we're trying to delete the keywordselect +foreach my $key (keys %ARGS) { + if ($key =~ /^KeywordSelect-(\d+)-Delete$/) { + my $id = $1; + my $keywordselect = new RT::KeywordSelect($session{'CurrentUser'}); + $keywordselect->Load($id) || push @actions, "Couldn't load keywordSelect"; + my ($val, $msg) = $keywordselect->SetDisabled(1); + if ($val) { + push @actions, 'KeywordSelect disabled.'; + } + else { + push @actions, $msg; + } + } +} +# }}} +# {{{ if we're modifying keyword selects +my @fields = qw(Name Keyword Single Depth); + +while (my $ks = $KeywordSelects->Next) { + foreach my $field (@fields) { + if (defined ($ARGS{"KeywordSelect-".$ks->Id."-".$field}) && + ($ARGS{"KeywordSelect-".$ks->Id."-".$field} ne $ks->$field())) { + + my $method = "Set$field"; + my ($val, $msg) = $ks->$method($ARGS{"KeywordSelect-".$ks->Id."-".$field}); + push @actions, "Keyword Select ". $ks->Name."/$field:".$msg; + } + } +} +# }}} + +</%init> + +<%ARGS> +$id => undef #some identifier that a Queue could + +</%ARGS> diff --git a/rt/webrt/Admin/Queues/Modify.html b/rt/webrt/Admin/Queues/Modify.html new file mode 100755 index 000000000..7a200df92 --- /dev/null +++ b/rt/webrt/Admin/Queues/Modify.html @@ -0,0 +1,137 @@ +<& /Admin/Elements/Header, Title => 'Admin/Queue/Basics' &> +<& /Admin/Elements/QueueTabs, id => $QueueObj->id &> +<& /Elements/ListActions, actions => \@results &> + + + +<& /Elements/TitleBoxStart, title => $title &> + + +<FORM ACTION="<%$RT::WebPath%>/Admin/Queues/Modify.html" METHOD=POST> +%if ($Create ) { +<INPUT TYPE=HIDDEN NAME=id VALUE="new"> +% } else { +<INPUT TYPE=HIDDEN NAME=id VALUE="<%$QueueObj->Id%>"> +% } + +<TABLE> +<TR><TD ALIGN=RIGHT> +Queue Name: +</TD> +<TD><INPUT name="Name" value="<%$QueueObj->Name%>"></TD> +</TR><TR> +<TD ALIGN=RIGHT> +Description:</TD><TD COLSPAN=3><INPUT name="Description" value="<%$QueueObj->Description%>" size=60></TD></TR> +<TR> +<TD ALIGN=RIGHT> +Correspondence Address: +</TD><TD> +<INPUT name="CorrespondAddress" value="<%$QueueObj->CorrespondAddress%>"> +<BR><font size="-1"><i>(If left blank, will default to <%$RT::CorrespondAddress%></i></font> +</TD> +<TD ALIGN=RIGHT> + +Comment Address: </TD><TD> +<INPUT NAME="CommentAddress" value="<%$QueueObj->CommentAddress%>"> +<BR><font size="-1"><i>(If left blank, will default to <%$RT::CommentAddress%></i></font> +</TD> +</TR><TR> + +<TD ALIGN=RIGHT> +Priority starts at: +</TD><TD><INPUT NAME="InitialPriority" value="<%$QueueObj->InitialPriority %>"> +</TD> +<TD ALIGN=RIGHT> +Over time, priority moves toward: +</TD><TD><INPUT NAME="FinalPriority" value="<%$QueueObj->FinalPriority %>"> +</TD> +</TR> +<TR> +<TD ALIGN=RIGHT> +Requests should be due in: +</TD><TD> +<INPUT NAME="DefaultDueIn" VALUE="<%$QueueObj->DefaultDueIn%>"> days. +</TD> +</TR> +<TR> +<TD> +</TD> +<TD COLSPAN=4><INPUT TYPE=HIDDEN NAME="SetEnabled" VALUE="1"> +<INPUT TYPE=CHECKBOX NAME="Enabled" VALUE="1" <%$EnabledChecked%>> Enabled (Unchecking this box disables this queue)<BR> +</TD> +</TR> + +</TABLE> +<& /Elements/TitleBoxEnd &> +<& /Elements/Submit &> +</form> + + + +<%INIT> + +my $QueueObj = new RT::Queue($session{'CurrentUser'}); +my ($title, @results, $Disabled, $EnabledChecked); + +if ($Create) { + $title = "Create a queue"; +} + +else { + if ($id eq 'new') { + my ($val, $msg) = $QueueObj->Create(Name => $Name); + if ($val == 0 ) { + Abort("Could not create queue: $msg"); + } + else { + push @results, $msg; + } + } + else { + $QueueObj->Load($id) || $QueueObj->Load($Name) || Abort("Couldn't load queue '$Name'"); + } + $title = 'Editing Configuration for queue '.$QueueObj->Name; + +} +if ($QueueObj->Id()) { +my @attribs= qw(Description CorrespondAddress CommentAddress Name + InitialPriority FinalPriority DefaultDueIn); + + @results = UpdateRecordObject( AttributesRef => \@attribs, + Object => $QueueObj, + ARGSRef => \%ARGS); + +} + +#we're asking about enabled on the web page but really care about disabled. +if ($Enabled == 1) { + $Disabled = 0; +} +else { + $Disabled = 1; +} +if ( ($SetEnabled) and ( $Disabled != $QueueObj->Disabled) ) { + my ($code, $msg) = $QueueObj->SetDisabled($Disabled); + push @results, 'Enabled status '. $msg; +} + +unless ($QueueObj->Disabled()) { + $EnabledChecked ="CHECKED"; +} +</%INIT> + + +<%ARGS> +$id => undef +$result => undef +$Name => undef +$Create => undef +$Description => undef +$CorrespondAddress => undef +$CommentAddress => undef +$InitialPriority => undef +$FinalPriority => undef +$DefaultDueIn => undef +$SetEnabled => undef +$Enabled => undef +</%ARGS> diff --git a/rt/webrt/Admin/Queues/People.html b/rt/webrt/Admin/Queues/People.html new file mode 100755 index 000000000..b495400ed --- /dev/null +++ b/rt/webrt/Admin/Queues/People.html @@ -0,0 +1,161 @@ +<& /Elements/Header, Title => 'Modify people related to queue ' . $QueueObj->Name &> +<& /Admin/Elements/QueueTabs, id => $id &> + +<& /Elements/ListActions, actions => \@results &> + + +<FORM METHOD=POST ACTION="People.html"> +<INPUT TYPE=HIDDEN NAME=id VALUE="<%$QueueObj->Id%>"> +<& /Elements/TitleBoxStart, title => 'Modify watchers for queue \''.$QueueObj->Name ."'", width => "100%" &> + +<TABLE WIDTH=100%> +<TR> +<TD VALIGN=TOP > + +<h3>Current watchers</h3> +<i>(Check box to delete)</i><br><BR> + + +Cc: + +<ul> + +%# Print out a placeholder if there are none. +%if ($cc->Count == 0 ) { +<li><i>none</i> +% } + +%while (my $watcher=$cc->Next) { +<li> +<INPUT TYPE=CHECKBOX NAME="DelWatcher<%$watcher->id%>" UNCHECKED> +%# account +%if ($watcher->IsUser) { +<a href="<%$RT::WebPath%>/Admin/Users/Modify.html?id=<%$watcher->OwnerObj->id%>"> +<%$watcher->OwnerObj->RealName%></a>: +%} else { +Email address: +%} +<i><%$watcher->Email%></i> +%} +</ul> + + +Administrative Cc: +<UL> +%# Print out a placeholder if there are none. +%if ($admincc->Count == 0 ) { +<li><i>none</i> +% } + +%while (my $watcher=$admincc->Next) { +<li><INPUT TYPE=CHECKBOX NAME="DelWatcher<%$watcher->id%>" UNCHECKED> +%# account +%if ($watcher->IsUser) { +<a href="<%$RT::WebPath%>/Admin/Users/Modify.html?id=<%$watcher->OwnerObj->id%>"> +<%$watcher->OwnerObj->RealName%></a>: +%} else { +Email address: +%} +<i><%$watcher->Email%></i> +%} +</UL> +</TD> + +<TD VALIGN=TOP> +<h3>New watchers</h3> +Find people whose<BR> +<& /Elements/SelectUsers &> + +<BR> +Add new watchers:<br> + +% if ($msg) { +<i><%$msg%></i> +% } elsif ($Users) { +<ul> +% while (my $u = $Users->Next ) { +<li><&/Elements/SelectWatcherType, Scope=>'queue', Name => "WatcherTypeUser".$u->Id &> <%$u->Name%> +(<%$u->RealName%>) +% } +</ul> +% } + +</TD> +</TR> +</TABLE> + + + + + +<& /Elements/TitleBoxEnd &> +<& /Elements/Submit, Label => 'Save Changes', Caption => "If you've updated anything above, be sure to" &> +</form> + +<%INIT> + +my ($field, @results, $User, $Users, $watcher, $key, $msg); +# {{{ Load the queue +#If we get handed two ids, mason will make them an array. bleck. +# We want teh first one. Just because there's no other sensible way +# to deal + + + +my $QueueObj = new RT::Queue($session{'CurrentUser'}); +$QueueObj->Load($id) || Abort("Couldn't load queue '$id'"); +# }}} + +# {{{ Delete deletable watchers + +foreach $key (keys %ARGS) { + if (($key =~ /^DelWatcher(\d*)$/) and + ($ARGS{$key})) { + $RT::Logger->debug("Deleting watcher $1\n"); + my ($code, $msg) = $QueueObj->DeleteWatcher($1); + + push @results, $msg; + } +} +# }}} + +# {{{ Add new watchers +foreach $key (keys %ARGS) { + #They're in this order because otherwise $1 gets clobbered :/ + if ( ($ARGS{$key} =~ /^(AdminCc|Cc)$/) and + ($key =~ /^WatcherTypeUser(\d*)$/) ) { + $RT::Logger->debug("Adding a watcher $1 to ".$ARGS{$key}."\n"); + my ($code, $msg) = + $QueueObj->AddWatcher(Type => $ARGS{$key}, + Owner => $1); + push @results, $msg; + } +} + +# }}} + + + +my $admincc = $QueueObj->AdminCc; +my $cc = $QueueObj->Cc; + + +if (!$ARGS{'UserString'}) { +$msg = "No users selected."; + } +else { + $Users = new RT::Users($session{'CurrentUser'}); + $Users->Limit(FIELD => $ARGS{'UserField'}, + VALUE => $ARGS{'UserString'}, + OPERATOR => $ARGS{'UserOp'}); + } +</%INIT> + +<%ARGS> +$UserField => 'Name' +$UserOp => '=' +$UserString => undef +$Type => undef +$id => undef +</%ARGS> + diff --git a/rt/webrt/Admin/Queues/Scrips.html b/rt/webrt/Admin/Queues/Scrips.html new file mode 100755 index 000000000..95b8c4378 --- /dev/null +++ b/rt/webrt/Admin/Queues/Scrips.html @@ -0,0 +1,111 @@ +<& /Admin/Elements/Header, Title => 'Edit scrips' &> +<& /Admin/Elements/QueueTabs, id => $QueueObj->Id &> + +<& /Elements/ListActions, actions => \@actions &> + +<& /Elements/TitleBoxStart, title => $description &> + +<h2>Global Scrips</h2> +<& /Admin/Elements/ListGlobalScrips &> +<BR> + <FORM METHOD=POST ACTION="Scrips.html"> + <INPUT TYPE=HIDDEN NAME=id VALUE=<%$id%>> +<h2>Queue Scrips</h2> +% if ($Scrips->Count > 0 ) { +<TABLE> +<TR> +<TD>Delete +</TD> +<TD> +</TR> +% while (my $scrip = $Scrips->Next ) { +<TR> +<TD> +<INPUT TYPE="CHECKBOX" NAME="DeleteScrip-<%$scrip->Id%>"> +</TD> +<TD> +<% $scrip->ConditionObj->Name %> +<% $scrip->ActionObj->Name %> with template +<% $scrip->TemplateObj->Name %> +</TD> +</TR> +% } +</TABLE> +% } +<BR> +<h2>Add a scrip to this queue</h2> +Condition: <& /Admin/Elements/SelectScripCondition, Name => 'NewScripCondition' &> + Action: <& /Admin/Elements/SelectScripAction, Name => 'NewScripAction' &> + Template: <& /Admin/Elements/SelectTemplate, Name => 'NewScripTemplate', DefaultQueue => $id &> + +<& /Elements/TitleBoxEnd &> +<& /Elements/Submit &> +</FORM> +<%init> +my (@actions, $description); + +my $Scrips = new RT::Scrips ($session{'CurrentUser'}); +unless ($id =~ /^\d+$/) { + Abort("$id isn't a valid Queue id."); +} + +unless ($Scrips->LimitToQueue($id)) { + Abort("Couldn't load Scrips."); + } + +my $QueueObj = new RT::Queue($session{'CurrentUser'}); +$QueueObj->Load($id); + +if ($QueueObj->id) { + $description = "Modify scrips for queue '". $QueueObj->Name ."'"; +} +else { + $description = "Modify global scrips"; +} + + +if ($NewScripAction and $NewScripCondition) { + my $NewScrip = new RT::Scrip($session{'CurrentUser'}); + + my ($retval, $msg) = $NewScrip->Create ( ScripAction => $NewScripAction, + ScripCondition => $NewScripCondition, + Stage => 'TransactionCreate', + Queue => $id, + Template => $NewScripTemplate); + if (defined $retval) { + push @actions, $msg; + } + else { + push @actions, $msg; + } +} + +# {{{ deal with modifying and deleting existing scrips +my ($key ); +foreach $key (keys %ARGS) { + # {{{ if we're trying to delete the scrip + if ($key =~ /^DeleteScrip-(\d+)/) { + my $id = $1; + my $scrip = new RT::Scrip($session{'CurrentUser'}); + $scrip->Load($id); + my ($retval, $msg) = $scrip->Delete; + if ($retval) { + push @actions, 'Scrip deleted'; + } + else { + push @actions, $msg; + } + } + # }}} + + +} +# }}} +</%init> + +<%ARGS> +$NewScripCondition => undef +$NewScripAction => undef +$NewScripTemplate => undef +$id => undef #some identifier that a Queue could +</%ARGS> diff --git a/rt/webrt/Admin/Queues/Template.html b/rt/webrt/Admin/Queues/Template.html new file mode 100755 index 000000000..61ee418a6 --- /dev/null +++ b/rt/webrt/Admin/Queues/Template.html @@ -0,0 +1,68 @@ +<& /Admin/Elements/Header, title => "Modify template ".$TemplateObj->id&> +<& /Admin/Elements/QueueTabs, id => $Queue &> +<& /Elements/ListActions, actions => \@results &> + +<& /Elements/TitleBoxStart, title => $title &> + +<FORM METHOD=POST ACTION="Template.html"> +%if ($create ) { +<INPUT TYPE=HIDDEN NAME=template VALUE="new"> +% } else { +<INPUT TYPE=HIDDEN NAME=template VALUE="<%$TemplateObj->Id%>"> +% } + +%# hang onto the queue id +<INPUT TYPE=HIDDEN name="Queue" value="<%$Queue%>"> + + +Name: <input name="Name" VALUE="<%$TemplateObj->Name%>" SIZE=20><BR> +Description: <input name="Description" VALUE="<%$TemplateObj->Description%>" SIZE=80><BR> + +<TEXTAREA NAME=Content ROWS=25 COLS=80 WRAP=SOFT> +<%$TemplateObj->Content%></TEXTAREA> + +<& /Elements/TitleBoxEnd&> +<&/Elements/Submit&> +</FORM> + + + +<%INIT> + +my $TemplateObj = new RT::Template($session{'CurrentUser'}); +my ($title, @results); + +if ($create) { + $title = "Create a template"; +} + +else { + if ($template eq 'new') { + my ($val, $msg) = $TemplateObj->Create(Queue => $Queue, Name => $Name); + Abort("Could not create template: $msg") unless ($val); + push @results, $msg; + $title = 'Created template ' . $TemplateObj->Name(); + } + else { + $TemplateObj->Load($template) || Abort('No Template'); + $title = 'Editing template ' . $TemplateObj->Name(); + } + + +} +if ($TemplateObj->Id()) { + $Queue = $TemplateObj->Queue; + + my @attribs = qw( Description Content Queue Name); + my @aresults = UpdateRecordObject( AttributesRef => \@attribs, + Object => $TemplateObj, + ARGSRef => \%ARGS); + push @results, @aresults; +} +</%INIT> +<%ARGS> +$Queue => undef +$template => undef +$create => undef +$Name => undef +</%ARGS> diff --git a/rt/webrt/Admin/Queues/Templates.html b/rt/webrt/Admin/Queues/Templates.html new file mode 100755 index 000000000..218d41dc9 --- /dev/null +++ b/rt/webrt/Admin/Queues/Templates.html @@ -0,0 +1,24 @@ +<& /Admin/Elements/Header, Title => 'Edit templates for '.$Queue->Name &> +<& /Admin/Elements/QueueTabs, id => $Queue->id &> + +<& /Elements/TitleBoxStart, title => 'Edit templates for '.$Queue->Name &> +<UL> +<LI><A href="Template.html?create=1&Queue=<%$Queue->id%>">Create a new template</A><BR><BR> + +%while (my $TemplateObj = $Templates->Next) { + +<LI><A HREF="Template.html?Queue=<%$id%>&template=<%$TemplateObj->id()%>"><%$TemplateObj->id()%>/<%$TemplateObj->Name%>: <%$TemplateObj->Description%></a><BR> + +%} + +<& /Elements/TitleBoxEnd &> +<%INIT> + +my $Queue = new RT::Queue($session{'CurrentUser'}); +$Queue->Load($id); +my $Templates = $Queue->Templates; + +</%INIT> +<%ARGS> +$id => undef +</%ARGS> diff --git a/rt/webrt/Admin/Queues/UserRights.html b/rt/webrt/Admin/Queues/UserRights.html new file mode 100755 index 000000000..75d9cb282 --- /dev/null +++ b/rt/webrt/Admin/Queues/UserRights.html @@ -0,0 +1,72 @@ +<& /Admin/Elements/Header, Title => 'Modify user rights for queue '. $QueueObj->Name &> +<& /Admin/Elements/QueueTabs, id => $id &> +<& /Elements/ListActions, actions => \@results &> + + <FORM METHOD=POST ACTION="UserRights.html"> + <INPUT TYPE=HIDDEN NAME=id VALUE="<% $QueueObj->id %>"> + +<& /Elements/TitleBoxStart, title => 'Modify user rights for queue '.$QueueObj->Name &> + +<TABLE> + +% while (my $UserObj = $Users->Next()) { + <TR ALIGN=RIGHT> + <TD VALIGN=TOP> + <% $UserObj->Name %> + </TD> + <TD> + <& /Admin/Elements/SelectRights, PrincipalObj => $UserObj, + PrincipalType => 'User', + Scope => 'Queue', + QueueObj => $QueueObj &> + </TD> + </TR> +% } + </TABLE> + + <& /Elements/TitleBoxEnd &> + <& /Elements/Submit, Caption => "Be sure to save your changes", Reset => 1 &> + + </FORM> + +<%INIT> + + #Update the acls. + my @results = ProcessACLChanges(\@CheckACL, \%ARGS); + +# {{{ Deal with setting up the display of current rights. + +# {{{ do basic initialization. + +#Define vars used in html above +my ($GroupObj); + +my ($right); + + +if (!defined $id) { + Abort("No Queue defined"); +} + +my $QueueObj = new RT::Queue($session{'CurrentUser'}); +$QueueObj->Load($id) || + Abort("Couldn't load queue $id"); + +# Find out which users we want to display ACL selects for +my $Users = new RT::Users($session{'CurrentUser'}); +$Users->LimitToPrivileged(); + +# }}} + + +# }}} + +</%INIT> + +<%ARGS> +$id => undef +$UserString => undef +$UserOp => undef +$UserField => undef +@CheckACL => undef +</%ARGS> diff --git a/rt/webrt/Admin/Queues/index.html b/rt/webrt/Admin/Queues/index.html new file mode 100755 index 000000000..52dfb73c8 --- /dev/null +++ b/rt/webrt/Admin/Queues/index.html @@ -0,0 +1,52 @@ +<& /Admin/Elements/Header, Title => 'Admin queues' &> +<& /Admin/Elements/Tabs, current_tab => 'Admin/Queues/' &> + + +<& /Elements/TitleBoxStart, title => 'Select a queue' &> + +<TABLE> +<TR> +<TD VALIGN=TOP> + +<FORM METHOD=POST ACTION="<% $RT::WebPath %>/Admin/Queues/"> + +<input type="checkbox" name="FindDisabledQueues"> Include disabled queues in listing. +<BR> +<div align=right><input type=submit value="Go!"></div> +</FORM> +</TD> +<TD VALIGN=TOP> +<UL> +% if ($session{'CurrentUser'}->HasSystemRight('AdminQueue')) { +<LI><A HREF="<%$RT::WebPath%>/Admin/Queues/Modify.html?Create=1">Create a new queue</A><BR><BR></LI> +</UL> +% } + +<%$caption%><BR> +<UL> +%if ($queues->Count == 0) { +<LI> <i>No queues matching search criteria found.</i> +% } +%while ( $queue = $queues->Next) { +<LI><A HREF="Modify.html?id=<%$queue->id%>"><%$queue->Name%></a></LI> +%} + +</UL> +</TD> +</TR> +</TABLE> +<& /Elements/TitleBoxEnd &> + +<%INIT> +my ($queue, $caption); +my $queues = new RT::Queues($session{'CurrentUser'}); +$queues->UnLimit(); + +if ($FindDisabledQueues) { + $queues->{'find_disabled_rows'} = 1; +} + +</%INIT> +<%ARGS> +$FindDisabledQueues => 0 +</%ARGS> |