diff options
Diffstat (limited to 'rt/webrt/Admin/Elements')
32 files changed, 985 insertions, 0 deletions
diff --git a/rt/webrt/Admin/Elements/CreateQueueCalled b/rt/webrt/Admin/Elements/CreateQueueCalled new file mode 100755 index 000000000..aeed6e786 --- /dev/null +++ b/rt/webrt/Admin/Elements/CreateQueueCalled @@ -0,0 +1,3 @@ +<FORM METHOD=get ACTION="<% $RT::WebPath %>/Admin/Queues/Create.html"> +Create a queue called <INPUT NAME="Name" size=10><input type=submit> +</form> diff --git a/rt/webrt/Admin/Elements/CreateUserCalled b/rt/webrt/Admin/Elements/CreateUserCalled new file mode 100755 index 000000000..7e4bb7554 --- /dev/null +++ b/rt/webrt/Admin/Elements/CreateUserCalled @@ -0,0 +1,3 @@ +<FORM METHOD=get ACTION="<%$RT::WebPath%>/Admin/Users/Create.html"> +New user called <INPUT NAME="Name" size=10><input type=submit value="Create"> +</form> diff --git a/rt/webrt/Admin/Elements/EditUserComments b/rt/webrt/Admin/Elements/EditUserComments new file mode 100755 index 000000000..1ac7e187f --- /dev/null +++ b/rt/webrt/Admin/Elements/EditUserComments @@ -0,0 +1,9 @@ +<& /Elements/Header, Title => "Comments about $name" &> +These comments aren't generally visible to the user:<br> +<input type="hidden" name="id" value="<%$id%>"> +<TEXTAREA COLS=60 ROWS=15 WRAP=SOFT NAME="Comments"><% $UserObj->Comments %></TEXTAREA> +</FORM> + +<%ARGS> +$UserObj => undef +</%ARGS> diff --git a/rt/webrt/Admin/Elements/GrantQueueRightsTo b/rt/webrt/Admin/Elements/GrantQueueRightsTo new file mode 100755 index 000000000..3850a18f2 --- /dev/null +++ b/rt/webrt/Admin/Elements/GrantQueueRightsTo @@ -0,0 +1,30 @@ +<BR> + +% if ($msg) { +<%$msg%> +% } elsif ($Users) { +<ul> +% while (my $u = $Users->Next ) { +<li> <%$u->Name%> (<%$u->RealName%>) <& SelectQueueRights, Name => "GrantTo".$u->id &> +% } +</ul> +% } + +<%INIT> +my ($msg, $Users); +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 +</%ARGS> diff --git a/rt/webrt/Admin/Elements/GroupTabs b/rt/webrt/Admin/Elements/GroupTabs new file mode 100755 index 000000000..261bef1e2 --- /dev/null +++ b/rt/webrt/Admin/Elements/GroupTabs @@ -0,0 +1,18 @@ +<& /Admin/Elements/Tabs, subtabs => $subtabs, current_tab => 'Admin/Groups/' &> +<hr> +<%INIT> +my $subtabs = { + Basics => { title => 'Basics', + path => "Admin/Groups/Modify.html?id=". $GroupObj->id + } + }; + +unless ($GroupObj->Pseudo) { +$subtabs->{'Members'} = { title => 'Members', + path => "Admin/Groups/Members.html?id=".$GroupObj->id }; +} +</%INIT> + +<%ARGS> +$GroupObj => undef +</%ARGS> diff --git a/rt/webrt/Admin/Elements/Header b/rt/webrt/Admin/Elements/Header new file mode 100755 index 000000000..95acdac7e --- /dev/null +++ b/rt/webrt/Admin/Elements/Header @@ -0,0 +1,5 @@ +<& /Elements/Header, Title => $Title &> + +<%ARGS> +$Title => undef +</%ARGS> diff --git a/rt/webrt/Admin/Elements/ListGlobalKeywordSelects b/rt/webrt/Admin/Elements/ListGlobalKeywordSelects new file mode 100644 index 000000000..b24d68989 --- /dev/null +++ b/rt/webrt/Admin/Elements/ListGlobalKeywordSelects @@ -0,0 +1,15 @@ +% while (my $KeywordSelect = $KeywordSelects->Next()) { + +<%$KeywordSelect->Name %>: +<% $KeywordSelect->Single ? 'Single' : 'Multiple' %> +children of +<% $KeywordSelect->KeywordObj->Path %> +% if ($KeywordSelect->Depth) { + up to <%$KeywordSelect->Depth%> levels deep +% } +<BR> +%} +<%INIT> +my $KeywordSelects = RT::KeywordSelects->new($session{'CurrentUser'}); +$KeywordSelects->LimitToGlobals(); +</%INIT> diff --git a/rt/webrt/Admin/Elements/ListGlobalScrips b/rt/webrt/Admin/Elements/ListGlobalScrips new file mode 100755 index 000000000..2f044bf52 --- /dev/null +++ b/rt/webrt/Admin/Elements/ListGlobalScrips @@ -0,0 +1,10 @@ +% while (my $scrip = $Scrips->Next ) { +<% $scrip->ConditionObj->Name %> +<% $scrip->ActionObj->Name %> +with template <% $scrip->TemplateObj->Name %> +<BR> +% } +<%init> +my $Scrips = new RT::Scrips ($session{'CurrentUser'}); +$Scrips->LimitToGlobal(); +</%INIT> diff --git a/rt/webrt/Admin/Elements/ModifyKeyword b/rt/webrt/Admin/Elements/ModifyKeyword new file mode 100644 index 000000000..4b01c3692 --- /dev/null +++ b/rt/webrt/Admin/Elements/ModifyKeyword @@ -0,0 +1,95 @@ +<FORM METHOD="get" ACTION="<%$RT::WebPath%>/Admin/Keywords/Modify.html"> +[<%$title |n %>]<BR> + +<INPUT TYPE="hidden" NAME="id" VALUE="<% $id %>"> +Keyword <INPUT NAME="Name" VALUE="<% $Keyword->Name %>"><BR> + +Parent <SELECT NAME="Parent"> + <OPTION VALUE=""<% defined($Keyword->Parent) ? '' : ' SELECTED' %>>-</OPTION> +%while ( $parent = $parents->Next ) { + <OPTION VALUE="<% $parent->id %>"<% defined($Keyword->Parent) && $parent->id == $Keyword->Parent ? ' SELECTED' : '' %>><% $parent->Name %></OPTION> +%} +</SELECT> + + +Kids <FONT SIZE="-2">(separate by +<INPUT TYPE="radio" NAME="delim" VALUE="n"<% $delim eq 'n' ? ' CHECKED' : '' %>> +line or +<INPUT TYPE="radio" NAME="delim" VALUE="s"<% $delim eq 's' ? ' CHECKED' : '' %>> +whitespace)</FONT><BR> + +<TEXTAREA NAME="Kids" ROWS=4><% $kidstring %></TEXTAREA> +<BR> + +<& /Elements/Submit, Label => $submit &> +</FORM> + +<%INIT> + +my $Keyword = new RT::Keyword($session{CurrentUser}); +my ($title, $submit, %kids, $kid); + +if ( $Create ) { + $title = "Create a new Keyword"; + $submit = "Create"; + $id = "new"; + %kids = (); + $Parent = ''; #silence +} elsif ( $id eq 'new' ) { + $id = $Keyword->Create( Name => $Name, Parent => $Parent ) + or Abort("can't create keyword Name=>$Name, Parent=>$Parent"); +} else { + $Keyword->Load($id) || Abort("Can't load keyword id $id"); + #foreach my $field ( grep eval "defined(\$$_)", qw( Name Parent )) { + # eval "\$Keyword->Set(\$field=>\$$field); #sigh + #} + $Keyword->SetName($Name) if defined($Name); + $Keyword->SetParent($Parent) if defined($Parent); +} + +$title = "Modify the Keyword <B>". $Keyword->Name. "</B>"; +$submit = "Modify"; + +my $kids = new RT::Keywords($session{CurrentUser}); +$kids->Limit( FIELD => 'Parent', VALUE => $id, OPERATOR => '=' ); +$kids{$kid->Name} = $kid while $kid = $kids->Next; + +if ( defined($Kids) ) { + my %newkids; + if ( $delim eq 'n' ) { + %newkids = map { $_=>1 } split(/\n/, $Kids); + } elsif ( $delim eq 's' ) { + %newkids = map { $_=>1 } split(' ', $Kids); + } else { + Abort("'$delim' isn't a valid keyword delimiter."); + } + foreach ( grep { ! defined($newkids{$_}) } keys %kids ) { + $kids{$_}->Delete; + delete $kids{$_}; + } + foreach ( grep { ! defined($kids{$_}) } keys %newkids ) { + $kids{$_} = new RT::Keyword($session{CurrentUser}); + $kids{$_}->Create( Name => $_, Parent => $id ) + or Abort("can't create keyword Name=>$_, Parent=>$id"); + } + +} + + +my $parent; +my $parents = new RT::Keywords($session{CurrentUser}); +$parents->UnLimit; + +$delim = ( grep /\s/, keys %kids ) ? 'n' : 's'; +my $kidstring = join("\n", keys %kids); + +</%INIT> + +<%ARGS> +$id => undef +$Create => undef +$Name => undef +$Parent => undef +$Kids => undef +$delim => undef +</%ARGS> diff --git a/rt/webrt/Admin/Elements/ModifyKeywordSelect b/rt/webrt/Admin/Elements/ModifyKeywordSelect new file mode 100644 index 000000000..470e62929 --- /dev/null +++ b/rt/webrt/Admin/Elements/ModifyKeywordSelect @@ -0,0 +1,120 @@ + <FORM NAME="ModifyKeywordSelect" METHOD=POST ACTION="<%$RT::WebPath%>/Admin/KeywordSelects/Modify.html"> + + [<%$title |n %>] + <BR> + + <INPUT TYPE="hidden" NAME="id" VALUE="<% $id %>"> + Keyword + <SELECT NAME="Parent"> + +%while ( $parent = $parents->Next ) { + + <OPTION VALUE="<% $parent->id %>" <% defined($KeywordSelect->Parent) && $parent->id == $KeywordSelect->Parent ? ' SELECTED' : '' %>><% $parent->Name %></OPTION> + +% } + + </SELECT> + <BR> + Object + <SELECT NAME="ObjectType"> + <OPTION SELECTED>Ticket</OPTION> + </SELECT> + <BR> + +<SCRIPT> +function addOption(text, value, defaultselected, selected) { + var option = new Option(text, value, defaultselected, selected ) + var length = document.ModifyKeywordSelect.ObjectValue.length; + document.ModifyKeywordSelect.ObjectValue.options[length] = option +} +function ChangeObjectValue(what) { + Value = what.options[what.selectedIndex].value + if ( Value == "(none)" ) { + document.ModifyKeywordSelect.ObjectValue.options.length = 0 + addOption("(n/a)", "", false, false) + } + if ( Value == "Queue" ) { + document.ModifyKeywordSelect.ObjectValue.options.length = 0 +%foreach $queue ( keys %queues ) { + addOption("<% $queues{$queue} %>", "<% $queue %>", false, <% $queue == $KeywordSelect->ObjectValue ? 'true' : 'false' %> ) +%} + } +} +</SCRIPT> + + Limit to <SELECT NAME="ObjectField" onChange="ChangeObjectValue(this)"> + <OPTION VALUE="" <% $KeywordSelect->ObjectField ? '' : ' SELECTED' %>>(none)</OPTION> + <OPTION VALUE="Queue" <% $KeywordSelect->ObjectField eq 'Queue' ? ' SELECTED' : '' %>>Queue</OPTION> + </SELECT> + <SELECT NAME="ObjectValue"> + <OPTION VALUE="<% $KeywordSelect->ObjectValue %>"> + <% $KeywordSelect->ObjectField ? $queues{$KeywordSelect->ObjectValue} : "(n/a)" %></OPTION> + </SELECT><BR> + <INPUT TYPE="hidden" NAME="SingleMagic" VALUE="1"> + <INPUT TYPE="checkbox" NAME="Single" VALUE="1" <% $KeywordSelect->Single ? ' CHECKED' : '' %>>Allow single selection only<BR> + Limit to <INPUT TYPE="text" NAME="Generations" SIZE="2" VALUE="<% $KeywordSelect->Generations %>"> generations (0 = no limit)<BR> + <& /Elements/Submit, Label => $submit &> + +</FORM> + +<%INIT> + + +my $KeywordSelect = new RT::KeywordSelect($session{CurrentUser}); + +my($title, $submit); + +if ( $Create ) { + $title = "Create a new KeywordSelect"; + $submit = "Create"; + $id = "new"; +} else { + if ( $id eq 'new' ) { + $id = $KeywordSelect->Create ( + Parent => $Parent, + ObjectType => $ObjectType, + ObjectField => $ObjectField, + ObjectValue => $ObjectValue, + Single => $Single, + Generations => $Generations, + ) or Abort "can't create KeywordSelect"; + } else { + $KeywordSelect->Load($id) || Abort("Can't load keyword id $id"); + #false laziness + $KeywordSelect->SetParent($Parent) if defined($Parent); + $KeywordSelect->SetObjectType($ObjectType) if defined($ObjectType); + $KeywordSelect->SetObjectField($ObjectField) if defined($ObjectField); + $KeywordSelect->SetObjectValue($ObjectValue) if defined($ObjectValue); + $KeywordSelect->SetSingle($Single) if defined($SingleMagic); + $KeywordSelect->SetGenerations($Generations) if defined($Generations); + } + $title = "Modify the KeywordSelect <B>". $KeywordSelect->KeywordObj->Name. "</B>"; + $submit = "Modify"; + +} + + my $parents = new RT::Keywords($session{CurrentUser}); + $parents->UnLimit; + my $parent; + +my $queues = new RT::Queues($session{CurrentUser}); +$queues->UnLimit; + +my %queues; +my $queue; +$queues{$queue->id} = $queue->Name while $queue = $queues->Next; + +</%INIT> + +<%ARGS> +$id => undef +$Create => undef +$Parent => undef +$ObjectType => undef +$ObjectField => undef +$ObjectValue => undef +$Single => undef +$SingleMagic => undef +$Generations => undef +</%ARGS> + diff --git a/rt/webrt/Admin/Elements/ModifyQueue b/rt/webrt/Admin/Elements/ModifyQueue new file mode 100755 index 000000000..a641c81af --- /dev/null +++ b/rt/webrt/Admin/Elements/ModifyQueue @@ -0,0 +1,56 @@ + +<& /Elements/TitleBoxStart, title => 'Editing Configuration for queue '.$QueueObj->Id &> + +<FORM ACTION="<%$RT::WebPath%>/Admin/Queues/Modify.html" METHOD=POST> +<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%>"> +</TD> +<TD ALIGN=RIGHT> + +Comment Address: </TD><TD> +<INPUT NAME="CommentAddress" value="<%$QueueObj->CommentAddress%>"> +</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> +</TABLE> +<& /Elements/Submit &> +</form> +<& /Elements/TitleBoxEnd &> + +<%INIT> + +</%INIT> + +<%ARGS> + + +$QueueObj => undef +</%ARGS> diff --git a/rt/webrt/Admin/Elements/ModifyTemplate b/rt/webrt/Admin/Elements/ModifyTemplate new file mode 100755 index 000000000..6e4f8a379 --- /dev/null +++ b/rt/webrt/Admin/Elements/ModifyTemplate @@ -0,0 +1,78 @@ + +<& /Elements/TitleBoxStart, title => 'Editing Configuration for user '.$UserObj->Name &> + +<FORM ACTION="<%$RT::WebPath%>/Admin/ModifyUser.html" METHOD=POST> +<INPUT TYPE=HIDDEN NAME=id VALUE="<%$UserObj->Id%>"> + +Name: <input name="Name" value="<%$UserObj->Name%>"> +<BR> +New Password: <input type=password name="Pass1"><BR> +Retype Password: <input type=password name="Pass2"><BR> + +Comments: <TEXTAREA name="Comments" COLS=20 ROWS=5> +<%$UserObj->Comments%></TEXTAREA> + +<BR> +Signature: <TEXTAREA COLS=80 ROWS=5 name="Signature"> +<%$UserObj->Signature%>"></TEXTAREA> +<BR> +EmailAddress: <input name="EmailAddress" value="<%$UserObj->EmailAddress%>"> +<BR> +FreeformContactInfo: <input name="FreeformContactInfo" value="<%$UserObj->FreeformContactInfo%>"> +<BR> +Organization: <input name="Organization" value="<%$UserObj->Organization%>"> +<BR> +RealName: <input name="RealName" value="<%$UserObj->RealName%>"> +<BR> +NickName: <input name="NickName" value="<%$UserObj->NickName%>"> +<BR> +Lang: <input name="Lang" value="<%$UserObj->Lang%>"> +<BR> +EmailEncoding: <input name="EmailEncoding" value="<%$UserObj->EmailEncoding%>"> +<BR> +WebEncoding: <input name="WebEncoding" value="<%$UserObj->WebEncoding%>"> +<BR> +ExternalContactInfoId: <input name="ExternalContactInfoId" value="<%$UserObj->ExternalContactInfoId%>"> +<BR> +ContactInfoSystem: <input name="ContactInfoSystem" value="<%$UserObj->ContactInfoSystem%>"> +<BR> +Gecos: <input name="Gecos" value="<%$UserObj->Gecos%>"> +<BR> +ExternalAuthId: <input name="ExternalAuthId" value="<%$UserObj->ExternalAuthId%>"> +<BR> +AuthSystem: <input name="AuthSystem" value="<%$UserObj->AuthSystem%>"> +<BR> +HomePhone: <input name="HomePhone" value="<%$UserObj->HomePhone%>"> +<BR> +WorkPhone: <input name="WorkPhone" value="<%$UserObj->WorkPhone%>"> +<BR> +MobilePhone: <input name="MobilePhone" value="<%$UserObj->MobilePhone%>"> +<BR> +PagerPhone: <input name="PagerPhone" value="<%$UserObj->PagerPhone%>"> +<BR> +Address1: <input name="Address1" value="<%$UserObj->Address1%>"> +<BR> +Address2: <input name="Address2" value="<%$UserObj->Address2%>"> +<BR> +City: <input name="City" value="<%$UserObj->City%>"> +<BR> +State: <input name="State" value="<%$UserObj->State%>"> +<BR> +Zip: <input name="Zip" value="<%$UserObj->Zip%>"> +<BR> +Country: <input name="Country" value="<%$UserObj->Country%>"> +<BR> + +<input type=submit> +</form> +<& /Elements/TitleBoxEnd &> + +<%INIT> + +</%INIT> + +<%ARGS> + + +$UserObj => undef +</%ARGS> diff --git a/rt/webrt/Admin/Elements/ModifyUser b/rt/webrt/Admin/Elements/ModifyUser new file mode 100755 index 000000000..53aa027c0 --- /dev/null +++ b/rt/webrt/Admin/Elements/ModifyUser @@ -0,0 +1,77 @@ + +<& /Elements/TitleBoxStart, title => 'Editing Configuration for user '.$UserObj->Name &> + +<FORM ACTION="<%$RT::WebPath%>/Admin/Users/Modify.html" METHOD=POST> +<INPUT TYPE=HIDDEN NAME=id VALUE="<%$UserObj->Id%>"> + +Name: <input name="Name" value="<%$UserObj->Name%>"> +<BR> +New Password: <input type=password name="Pass1"><BR> +Retype Password: <input type=password name="Pass2"><BR> + +Comments: <TEXTAREA name="Comments" COLS=80 ROWS=5 WRAP=VIRTUAL> +<%$UserObj->Comments%></TEXTAREA> + +<BR> +Signature: <TEXTAREA COLS=80 ROWS=5 name="Signature" WRAP=HARD> +<%$UserObj->Signature%></TEXTAREA> +<BR> +EmailAddress: <input name="EmailAddress" value="<%$UserObj->EmailAddress%>"> +<BR> +FreeformContactInfo: <input name="FreeformContactInfo" value="<%$UserObj->FreeformContactInfo%>"> +<BR> +Organization: <input name="Organization" value="<%$UserObj->Organization%>"> +<BR> +RealName: <input name="RealName" value="<%$UserObj->RealName%>"> +<BR> +NickName: <input name="NickName" value="<%$UserObj->NickName%>"> +<BR> +Lang: <input name="Lang" value="<%$UserObj->Lang%>"> +<BR> +EmailEncoding: <input name="EmailEncoding" value="<%$UserObj->EmailEncoding%>"> +<BR> +WebEncoding: <input name="WebEncoding" value="<%$UserObj->WebEncoding%>"> +<BR> +ExternalContactInfoId: <input name="ExternalContactInfoId" value="<%$UserObj->ExternalContactInfoId%>"> +<BR> +ContactInfoSystem: <input name="ContactInfoSystem" value="<%$UserObj->ContactInfoSystem%>"> +<BR> +Gecos: <input name="Gecos" value="<%$UserObj->Gecos%>"> +<BR> +ExternalAuthId: <input name="ExternalAuthId" value="<%$UserObj->ExternalAuthId%>"> +<BR> +AuthSystem: <input name="AuthSystem" value="<%$UserObj->AuthSystem%>"> +<BR> +HomePhone: <input name="HomePhone" value="<%$UserObj->HomePhone%>"> +<BR> +WorkPhone: <input name="WorkPhone" value="<%$UserObj->WorkPhone%>"> +<BR> +MobilePhone: <input name="MobilePhone" value="<%$UserObj->MobilePhone%>"> +<BR> +PagerPhone: <input name="PagerPhone" value="<%$UserObj->PagerPhone%>"> +<BR> +Address1: <input name="Address1" value="<%$UserObj->Address1%>"> +<BR> +Address2: <input name="Address2" value="<%$UserObj->Address2%>"> +<BR> +City: <input name="City" value="<%$UserObj->City%>"> +<BR> +State: <input name="State" value="<%$UserObj->State%>"> +<BR> +Zip: <input name="Zip" value="<%$UserObj->Zip%>"> +<BR> +Country: <input name="Country" value="<%$UserObj->Country%>"> +<BR> +<& /Elements/Submit &> +</form> +<& /Elements/TitleBoxEnd &> + +<%INIT> + +</%INIT> + +<%ARGS> + + +$UserObj => undef +</%ARGS> diff --git a/rt/webrt/Admin/Elements/QueueRightsForUser b/rt/webrt/Admin/Elements/QueueRightsForUser new file mode 100644 index 000000000..e62a124ce --- /dev/null +++ b/rt/webrt/Admin/Elements/QueueRightsForUser @@ -0,0 +1,17 @@ +<UL> +%while(my $ACE = $ACL->Next) { + +<LI><checkbox name="delete_ace_<%$ACE->id%>"> <%$ACE->RightName%> (<%$ACE->UserObj->RealName%>) + +%} +</UL> + +<%INIT> +my $ACL = new RT::ACL($session{'CurrentUser'}); +$ACL->LimitToQueue($QueueObj->id); +$ACL->LimitPrincipalToUser($PrincipalId); +</%INIT> +<%ARGS> +$PrincipalId => undef +$QueueObj => undef +</%ARGS> diff --git a/rt/webrt/Admin/Elements/QueueTabs b/rt/webrt/Admin/Elements/QueueTabs new file mode 100755 index 000000000..b7da7e007 --- /dev/null +++ b/rt/webrt/Admin/Elements/QueueTabs @@ -0,0 +1,36 @@ +<& /Admin/Elements/Tabs, subtabs => $subtabs, current_tab => 'Admin/Queues/' &> +<hr> +<%INIT> + my $subtabs = { + A => { title => 'Basics', + path => "Admin/Queues/Modify.html?id=".$id, + }, + B => { title => 'Watchers', + path => "Admin/Queues/People.html?id=".$id, + }, + + C => { title => 'Scrips', + path => "Admin/Queues/Scrips.html?id=".$id, + }, + D => { title => 'Templates', + path => "Admin/Queues/Templates.html?id=".$id, + }, + E => { title => 'Keyword Selections', + path => "Admin/Queues/Keywords.html?id=".$id, + }, + F => { title => 'Group Rights', + path => "Admin/Queues/GroupRights.html?id=".$id, + }, + G => { title => 'User Rights', + path => "Admin/Queues/UserRights.html?id=".$id, + }, + + + +}; +</%INIT> + + +<%ARGS> +$id => undef +</%ARGS> diff --git a/rt/webrt/Admin/Elements/SelectKeywordSelect b/rt/webrt/Admin/Elements/SelectKeywordSelect new file mode 100644 index 000000000..f5a8d77cd --- /dev/null +++ b/rt/webrt/Admin/Elements/SelectKeywordSelect @@ -0,0 +1,22 @@ +<input size=10 name="<%$NamePrefix%>-Name" value="<% $KeywordSelect->Name %>">: +<& /Admin/Elements/SelectSingleOrMultiple, + Name => $NamePrefix.'-Single', + Default => $KeywordSelect->Single &> + +children of +<& /Elements/SelectKeyword, Root => '0', + Name => $NamePrefix.'-Keyword', + Default => $KeywordSelect->KeywordObj->Id &> + up to <input name="<%$NamePrefix%>-Depth" size=2 value="<%$KeywordSelect->Depth%>"> levels deep. +<%INIT> +unless ($NamePrefix) { + $NamePrefix = $KeywordSelect->Id; +} +$NamePrefix = "KeywordSelect-$NamePrefix"; + +</%INIT> + +<%ARGS> +$KeywordSelect => undef +$NamePrefix => undef +</%ARGS>
\ No newline at end of file diff --git a/rt/webrt/Admin/Elements/SelectModifyGroup b/rt/webrt/Admin/Elements/SelectModifyGroup new file mode 100644 index 000000000..45d437f41 --- /dev/null +++ b/rt/webrt/Admin/Elements/SelectModifyGroup @@ -0,0 +1,10 @@ +%while ( $Group = $Groups->Next) { +<A HREF="Modify.html?id=<%$Group->id%>"><%$Group->id%>: <%$Group->Name%></a><BR> +%} +<%INIT> +my ($Group); +my $Groups = new RT::Groups($session{'CurrentUser'}); +$Groups->UnLimit; +</%INIT> +<%ARGS> +</%ARGS> diff --git a/rt/webrt/Admin/Elements/SelectModifyKeyword b/rt/webrt/Admin/Elements/SelectModifyKeyword new file mode 100644 index 000000000..6af223229 --- /dev/null +++ b/rt/webrt/Admin/Elements/SelectModifyKeyword @@ -0,0 +1,13 @@ +%while ( $keyword = $keywords->Next ) { +<A HREF="/Admin/Keywords/Modify.html?id=<%$keyword->id%>"><%$keyword->id%>: <%$keyword->Name%></a><BR> +%} + +<%INIT> + +use RT::Keywords; + +my $keyword; +my $keywords = new RT::Keywords $session{CurrentUser}; +$keywords->UnLimit; +</%INIT> + diff --git a/rt/webrt/Admin/Elements/SelectModifyKeywordSelect b/rt/webrt/Admin/Elements/SelectModifyKeywordSelect new file mode 100644 index 000000000..c91eb6cfe --- /dev/null +++ b/rt/webrt/Admin/Elements/SelectModifyKeywordSelect @@ -0,0 +1,13 @@ +%while ( $keywordselect = $keywordselects->Next ) { +<A HREF="/Admin/KeywordSelects/Modify.html?id=<%$keywordselect->id%>"><%$keywordselect->id%>: ( <%$keywordselect->Parent%>: <%$keywordselect->KeywordObj->Name%> )</a><BR> +%} + +<%INIT> + +use RT::KeywordSelects; + +my $keywordselect; +my $keywordselects = new RT::KeywordSelects $session{CurrentUser}; +$keywordselects->UnLimit; +</%INIT> + diff --git a/rt/webrt/Admin/Elements/SelectModifyQueue b/rt/webrt/Admin/Elements/SelectModifyQueue new file mode 100755 index 000000000..1c6cd7d5e --- /dev/null +++ b/rt/webrt/Admin/Elements/SelectModifyQueue @@ -0,0 +1,10 @@ +%while ( $queue = $queues->Next) { +<A HREF="Modify.html?id=<%$queue->id%>"><%$queue->id%>: <%$queue->Name%></a><BR> +%} +<%INIT> +my ($queue); +my $queues = new RT::Queues($session{'CurrentUser'}); +$queues->UnLimit; +</%INIT> +<%ARGS> +</%ARGS> diff --git a/rt/webrt/Admin/Elements/SelectModifyUser b/rt/webrt/Admin/Elements/SelectModifyUser new file mode 100755 index 000000000..da49212e4 --- /dev/null +++ b/rt/webrt/Admin/Elements/SelectModifyUser @@ -0,0 +1,26 @@ +%while ( $user = $users->Next) { +<A HREF="Modify.html?id=<%$user->id%>"><%$user->id%>: <%$user->Name%></a><BR> +%} +<%INIT> +my ($user); +my $users = new RT::Users($session{'CurrentUser'}); +$users->Limit(FIELD => 'id', + VALUE => $RT::SystemUser->id, + OPERATOR => '!=' ); + +if (defined $IdLike) { +$users->Limit(FIELD => 'Name', + VALUE => $IdLike, + OPERATOR => 'LIKE' ); +} +if (defined $EmailLike) { +$users->Limit(FIELD => 'EmailAddress', + VALUE => $EmailLike, + OPERATOR => 'LIKE'); + +} +</%INIT> +<%ARGS> +$IdLike => undef +$EmailLike => undef +</%ARGS> diff --git a/rt/webrt/Admin/Elements/SelectQueueRights b/rt/webrt/Admin/Elements/SelectQueueRights new file mode 100755 index 000000000..6861d40c6 --- /dev/null +++ b/rt/webrt/Admin/Elements/SelectQueueRights @@ -0,0 +1,29 @@ +%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Admin/Elements/Attic/SelectQueueRights,v 1.1 2002-08-12 06:17:08 ivan Exp $ + +<SELECT NAME ="<%$Name%>"> +<OPTION VALUE="">-</OPTION> +%foreach $right (@rights) { +<OPTION VALUE="<%$right%>" <%($Default eq $right) && 'SELECTED'%>><%$right%></OPTION> +% } +</SELECT> +<%ONCE> + +use RT::ACE; +my $ACE = new RT::ACE($session{'CurrentUser'}); +my %QueueRights = $ACE->QueueRights; +my %TicketRights = $ACE->TicketRights; + +my ($key, $right, @rights); + +foreach $key (sort keys %QueueRights) { +push (@rights, $QueueRights{$key} . " ($key)"); +} +foreach $key (sort keys %TicketRights) { +push (@rights, $TicketRights{$key} . " ($key)"); +} +</%ONCE> +<%ARGS> +$Name => undef +$Default => undef + +</%ARGS> diff --git a/rt/webrt/Admin/Elements/SelectRights b/rt/webrt/Admin/Elements/SelectRights new file mode 100644 index 000000000..0ac774985 --- /dev/null +++ b/rt/webrt/Admin/Elements/SelectRights @@ -0,0 +1,58 @@ +<INPUT TYPE=HIDDEN NAME="CheckACL" VALUE="<%$ACLDesc%>"> + <TABLE BORDER=0> +<TR> +<TD valign=top> +<h3>New rights</h3> +<SELECT SIZE=5 MULTIPLE NAME="GrantACE-<%$ACLDesc%>"> +% foreach $right (sort keys %Rights) { + <OPTION VALUE="<%$right%>" + ><%$right%></OPTION> +% } +<OPTION VALUE="" SELECTED>(no value)</OPTION> +</SELECT> +</TD> +<TD valign=top> +<h3>Current rights</h3> +<i>(Check box to revoke right)</i> <BR> +% while (my $right = $ACLObj->Next()) { +% if ($right->RightName) { +<input type=checkbox value="<%$right->Id%>" name="RevokeACE"> <%$right->RightName%><br> +% } +% } +</TD> +</TR> +</TABLE> +<%INIT> + my ($right, $ACLDesc, $AppliesTo, %Rights); + + + my $ACLObj = new RT::ACL($session{'CurrentUser'}); + my $ACE = new RT::ACE($session{'CurrentUser'}); + + if ($Scope eq 'Queue') { + $AppliesTo = $QueueObj->Id; + $ACLObj->LimitToQueue($AppliesTo); + %Rights = $ACE->QueueRights(); + } + elsif ($Scope eq 'System') { + $AppliesTo = 0; + $ACLObj->LimitToSystem(); + %Rights = ( $ACE->SystemRights , $ACE->QueueRights()); + } + + if ($PrincipalType eq 'Group') { + $ACLObj->LimitPrincipalToGroup($PrincipalObj->Id); + } + elsif ($PrincipalType eq 'User') { + $ACLObj->LimitPrincipalToUser($PrincipalObj->Id); + } + + $ACLDesc = "$PrincipalType-".$PrincipalObj->Id."-$Scope-$AppliesTo"; +</%INIT> + +<%ARGS> +$PrincipalType => undef +$PrincipalObj => undef +$Scope => undef +$QueueObj => undef +</%ARGS> diff --git a/rt/webrt/Admin/Elements/SelectScrip b/rt/webrt/Admin/Elements/SelectScrip new file mode 100755 index 000000000..4ae15d8c3 --- /dev/null +++ b/rt/webrt/Admin/Elements/SelectScrip @@ -0,0 +1,25 @@ +<SELECT NAME=<%$Name%>> +<OPTION VALUE="" +<% $Default eq undef && 'SELECTED' %> +>-</OPTION> +%while (my $Scrip = $Scrips->Next) { +<OPTION VALUE=<%$Scrip->Id%> +<% $Scrip->Id == $Default && 'SELECTED' %> +><%$Scrip->Name%> +</OPTION> +%} +</SELECT> + +<%INIT> +my $Scrips = RT::Scrips->new($session{'CurrentUser'}); +$Scrips->UnLimit; + + + +</%INIT> +<%ARGS> + +$Default => undef +$Name => 'Scrip' + +</%ARGS> diff --git a/rt/webrt/Admin/Elements/SelectScripAction b/rt/webrt/Admin/Elements/SelectScripAction new file mode 100644 index 000000000..08a173493 --- /dev/null +++ b/rt/webrt/Admin/Elements/SelectScripAction @@ -0,0 +1,25 @@ +<SELECT NAME=<%$Name%>> +<OPTION VALUE="" +<% $Default eq undef && 'SELECTED' %> +>-</OPTION> +%while (my $ScripAction = $ScripActions->Next) { +<OPTION VALUE=<%$ScripAction->Id%> +<% $ScripAction->Id == $Default && 'SELECTED' %> +><%$ScripAction->Name%> +</OPTION> +%} +</SELECT> + +<%INIT> +my $ScripActions = RT::ScripActions->new($session{'CurrentUser'}); +$ScripActions->UnLimit; + + + +</%INIT> +<%ARGS> + +$Default => undef +$Name => 'ScripAction' + +</%ARGS> diff --git a/rt/webrt/Admin/Elements/SelectScripCondition b/rt/webrt/Admin/Elements/SelectScripCondition new file mode 100644 index 000000000..434f0c4ae --- /dev/null +++ b/rt/webrt/Admin/Elements/SelectScripCondition @@ -0,0 +1,25 @@ +<SELECT NAME=<%$Name%>> +<OPTION VALUE="" +<% $Default eq undef && 'SELECTED' %> +>-</OPTION> +%while (my $ScripCondition = $ScripConditions->Next) { +<OPTION VALUE=<%$ScripCondition->Id%> +<% $ScripCondition->Id == $Default && 'SELECTED' %> +><%$ScripCondition->Name%> +</OPTION> +%} +</SELECT> + +<%INIT> +my $ScripConditions = RT::ScripConditions->new($session{'CurrentUser'}); +$ScripConditions->UnLimit; + + + +</%INIT> +<%ARGS> + +$Default => undef +$Name => 'ScripCondition' + +</%ARGS> diff --git a/rt/webrt/Admin/Elements/SelectSingleOrMultiple b/rt/webrt/Admin/Elements/SelectSingleOrMultiple new file mode 100644 index 000000000..307b0211c --- /dev/null +++ b/rt/webrt/Admin/Elements/SelectSingleOrMultiple @@ -0,0 +1,20 @@ + <select name="<%$Name%>"> + <option value="1" <%$SingleDefault%>>Single</option> + <option value="0" <%$MultipleDefault%>>Multiple</option> + </select> + + +<%INIT> +my ($SingleDefault, $MultipleDefault); +if ($Default == 1) { + $SingleDefault = "SELECTED"; +} +elsif ($Default == 0 ) { + $MultipleDefault = "SELECTED"; +} + +</%INIT> +<%ARGS> +$Name => 'Single' +$Default => 1 +</%ARGS> diff --git a/rt/webrt/Admin/Elements/SelectTemplate b/rt/webrt/Admin/Elements/SelectTemplate new file mode 100755 index 000000000..76550dc4e --- /dev/null +++ b/rt/webrt/Admin/Elements/SelectTemplate @@ -0,0 +1,37 @@ +<SELECT NAME=<%$Name%>> +<OPTION VALUE="" +<% $Default eq 'none' && 'SELECTED' %> +>-</OPTION> +%while (my $Template = $PrimaryTemplates->Next) { +<OPTION VALUE=<%$Template->Id%> +<% ($Template->Id == $Default) && 'SELECTED' %> +><%$Template->Name%> +</OPTION> +%} +%while (my $Template = $OtherTemplates->Next) { +<OPTION VALUE=<%$Template->Id%> +<% ($Template->Id == $Default) && 'SELECTED'%> +>Global template: <%$Template->Name%> +</OPTION> +%} +</SELECT> + +<%INIT> + + +my $PrimaryTemplates = RT::Templates->new($session{'CurrentUser'}); +if ($DefaultQueue != 0) { +$PrimaryTemplates->LimitToQueue($DefaultQueue); +} + +my $OtherTemplates = RT::Templates->new($session{'CurrentUser'}); +$OtherTemplates->LimitToGlobal($DefaultQueue); + +</%INIT> +<%ARGS> + +$Default => 'none' +$DefaultQueue => undef +$Name => 'Template' + +</%ARGS> diff --git a/rt/webrt/Admin/Elements/SelectUsers b/rt/webrt/Admin/Elements/SelectUsers new file mode 100644 index 000000000..af51c60f9 --- /dev/null +++ b/rt/webrt/Admin/Elements/SelectUsers @@ -0,0 +1,17 @@ +<SELECT MULTIPLE NAME="<%$Name%>" SIZE=10> +%while (my $user = $users->Next) { +<OPTION VALUE="<%$user->id%>"><%$user->Name%> +%} +</SELECT> + +<%INIT> +my $users = new RT::Users($session{'CurrentUser'}); + +$users->Limit(FIELD => 'id', VALUE => $RT::SystemUser->id, OPERATOR => '!=' ); +$users->Limit(FIELD => 'id', VALUE => $RT::Nobody->id, OPERATOR => '!=' ); +$users->LimitToPrivileged(); + +</%INIT> +<%ARGS> +$Name => 'Users' +</%ARGS> diff --git a/rt/webrt/Admin/Elements/SystemTabs b/rt/webrt/Admin/Elements/SystemTabs new file mode 100755 index 000000000..f8b23128b --- /dev/null +++ b/rt/webrt/Admin/Elements/SystemTabs @@ -0,0 +1,31 @@ +<& /Admin/Elements/Tabs, subtabs => $subtabs, current_tab => 'Admin/Global/', current_subtab => $current_subtab &> +<hr> +<%INIT> + my $subtabs = { + + A => { title => 'Scrips', + path => 'Admin/Global/Scrips.html', + }, + Ba => { title => 'Keyword Selections', + path => 'Admin/Global/Keywords.html', + }, + + B => { title => 'Templates', + path => 'Admin/Global/Templates.html', + }, + C => { title => 'Group Rights', + path => 'Admin/Global/GroupRights.html', + }, + D => { title => 'User Rights', + path => 'Admin/Global/UserRights.html', + } + + +}; +</%INIT> + + +<%ARGS> +$id => undef +$current_subtab => undef +</%ARGS> diff --git a/rt/webrt/Admin/Elements/Tabs b/rt/webrt/Admin/Elements/Tabs new file mode 100755 index 000000000..ee6d82b58 --- /dev/null +++ b/rt/webrt/Admin/Elements/Tabs @@ -0,0 +1,31 @@ +<& /Elements/Tabs, tabs => $tabs, subtabs => $subtabs, current_toptab => 'Admin/', current_tab => $current_tab, current_subtab => $current_subtab&> + +<hr> + +<%INIT> + my $tabs = { Users => { title => 'Users', + path => 'Admin/Users/', + }, + Groups => { title => 'Groups', + path => 'Admin/Groups/', + }, + Queues => { title => 'Queues', + path => 'Admin/Queues/', + }, + System => { 'title' => 'Global', + path => 'Admin/Global/', + }, + Keywords => { title => 'Keywords', + path => 'Admin/Keywords/', + }, + + + }; +</%INIT> + + +<%ARGS> +$subtabs => undef +$current_tab => undef +$current_subtab => undef +</%ARGS> diff --git a/rt/webrt/Admin/Elements/UserTabs b/rt/webrt/Admin/Elements/UserTabs new file mode 100755 index 000000000..bbf17314d --- /dev/null +++ b/rt/webrt/Admin/Elements/UserTabs @@ -0,0 +1,21 @@ +<& /Admin/Elements/Tabs, subtabs => $subtabs, + current_tab => 'Admin/Users/', + current_subtab => $current_subtab &> +<hr> +<%INIT> +my $subtabs = { + Queues => { title => 'Basics', + path => "Admin/Users/Modify.html?id=".$id + }, +# Scrips => { title => 'Rights', +# path => "Admin/Users/Rights.html?id=".$id +# } + + }; +</%INIT> + + +<%ARGS> +$id => undef +$current_subtab => undef +</%ARGS> |