[Rt-commit] r2470 - in rtfm/branches/2.1-TESTING: . docs
html/Admin/RTFM html/Admin/RTFM/Classes
html/Admin/RTFM/Elements html/Admin/RTFM/Global
html/Callbacks/RTFM/Admin/Elements/Tabs
html/Callbacks/RTFM/Admin/index.html
html/Callbacks/RTFM/Ticket/Update.html html/RTFM/Admin
html/RTFM/Elements
jesse at bestpractical.com
jesse at bestpractical.com
Tue Mar 15 01:25:13 EST 2005
Author: jesse
Date: Tue Mar 15 01:25:12 2005
New Revision: 2470
Added:
rtfm/branches/2.1-TESTING/html/Admin/RTFM/
rtfm/branches/2.1-TESTING/html/Admin/RTFM/Classes/
rtfm/branches/2.1-TESTING/html/Admin/RTFM/Classes/Access.html
rtfm/branches/2.1-TESTING/html/Admin/RTFM/Classes/CustomFields.html
rtfm/branches/2.1-TESTING/html/Admin/RTFM/Classes/GroupRights.html
rtfm/branches/2.1-TESTING/html/Admin/RTFM/Classes/Modify.html
rtfm/branches/2.1-TESTING/html/Admin/RTFM/Classes/Topics.html
rtfm/branches/2.1-TESTING/html/Admin/RTFM/Classes/UserRights.html
rtfm/branches/2.1-TESTING/html/Admin/RTFM/Classes/index.html
rtfm/branches/2.1-TESTING/html/Admin/RTFM/Elements/
rtfm/branches/2.1-TESTING/html/Admin/RTFM/Elements/ClassTabs
rtfm/branches/2.1-TESTING/html/Admin/RTFM/Elements/GlobalTabs
rtfm/branches/2.1-TESTING/html/Admin/RTFM/Elements/Header
rtfm/branches/2.1-TESTING/html/Admin/RTFM/Elements/Tabs
rtfm/branches/2.1-TESTING/html/Admin/RTFM/Global/
rtfm/branches/2.1-TESTING/html/Admin/RTFM/Global/GroupRights.html
rtfm/branches/2.1-TESTING/html/Admin/RTFM/Global/UserRights.html
rtfm/branches/2.1-TESTING/html/Admin/RTFM/Global/index.html
rtfm/branches/2.1-TESTING/html/Admin/RTFM/index.html
rtfm/branches/2.1-TESTING/html/Callbacks/RTFM/Admin/Elements/Tabs/
rtfm/branches/2.1-TESTING/html/Callbacks/RTFM/Admin/Elements/Tabs/Default
rtfm/branches/2.1-TESTING/html/Callbacks/RTFM/Admin/index.html/
rtfm/branches/2.1-TESTING/html/Callbacks/RTFM/Admin/index.html/Default
Removed:
rtfm/branches/2.1-TESTING/html/RTFM/Admin/
Modified:
rtfm/branches/2.1-TESTING/ (props changed)
rtfm/branches/2.1-TESTING/docs/todo
rtfm/branches/2.1-TESTING/html/Callbacks/RTFM/Ticket/Update.html/BeforeMessageBox
rtfm/branches/2.1-TESTING/html/RTFM/Elements/Header
rtfm/branches/2.1-TESTING/html/RTFM/Elements/Tabs
Log:
r8747 at hualien: jesse | 2005-03-15 01:24:51 -0500
Moving the admin UI under /Admin
Modified: rtfm/branches/2.1-TESTING/docs/todo
==============================================================================
--- rtfm/branches/2.1-TESTING/docs/todo (original)
+++ rtfm/branches/2.1-TESTING/docs/todo Tue Mar 15 01:25:12 2005
@@ -1,5 +1,22 @@
TODO
+
+Upgrades
+
+ Document RTFM 2.0 -> new upgrade procedure
+
+
+
+Admin
+
+ Move administrative menus underneath the core RT admin menus
+
+ Add menus to associate custom fields with a given class
+
+
+Testing
+
+
Links:
@@ -9,9 +26,7 @@
Custom fields:
- File upload custom fields
-
-
+ Add back wikitext fields
Hierarchy:
Added: rtfm/branches/2.1-TESTING/html/Admin/RTFM/Classes/Access.html
==============================================================================
--- (empty file)
+++ rtfm/branches/2.1-TESTING/html/Admin/RTFM/Classes/Access.html Tue Mar 15 01:25:12 2005
@@ -0,0 +1,18 @@
+%# BEGIN LICENSE BLOCK
+%#
+%# Copyright (c) 2002-2003 Jesse Vincent <jesse at bestpractical.com>
+%#
+%# This program is free software; you can redistribute it and/or modify
+%# it under the terms of version 2 of the GNU General Public License
+%# as published by the Free Software Foundation.
+%#
+%# A copy of that license should have arrived with this
+%# software, but in any event can be snarfed from www.gnu.org.
+%#
+%# This program is distributed in the hope that it will be useful,
+%# but WITHOUT ANY WARRANTY; without even the implied warranty of
+%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+%# GNU General Public License for more details.
+%#
+%# END LICENSE BLOCK
+
Added: rtfm/branches/2.1-TESTING/html/Admin/RTFM/Classes/CustomFields.html
==============================================================================
--- (empty file)
+++ rtfm/branches/2.1-TESTING/html/Admin/RTFM/Classes/CustomFields.html Tue Mar 15 01:25:12 2005
@@ -0,0 +1,2 @@
+<& /Admin/Elements/ObjectCustomFields, %ARGS, ObjectType => 'RT::FM::Class' &>
+
Added: rtfm/branches/2.1-TESTING/html/Admin/RTFM/Classes/GroupRights.html
==============================================================================
--- (empty file)
+++ rtfm/branches/2.1-TESTING/html/Admin/RTFM/Classes/GroupRights.html Tue Mar 15 01:25:12 2005
@@ -0,0 +1,85 @@
+%# BEGIN LICENSE BLOCK
+%#
+%# Copyright (c) 2002-2003 Jesse Vincent <jesse at bestpractical.com>
+%#
+%# This program is free software; you can redistribute it and/or modify
+%# it under the terms of version 2 of the GNU General Public License
+%# as published by the Free Software Foundation.
+%#
+%# A copy of that license should have arrived with this
+%# software, but in any event can be snarfed from www.gnu.org.
+%#
+%# This program is distributed in the hope that it will be useful,
+%# but WITHOUT ANY WARRANTY; without even the implied warranty of
+%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+%# GNU General Public License for more details.
+%#
+%# END LICENSE BLOCK
+
+<& /Admin/RTFM/Elements/ClassTabs, id => $id, Title => loc('Modify group rights for Class [_1]', $ClassObj->Name) &>
+<& /Elements/ListActions, actions => \@results &>
+
+ <FORM METHOD=POST ACTION="GroupRights.html">
+ <INPUT TYPE=HIDDEN NAME=id VALUE="<% $ClassObj->id %>">
+
+<& /Elements/TitleBoxStart, title => loc('Modify group rights for Class [_1]', $ClassObj->Name) &>
+
+<h1><&|/l&>System groups</&></h1>
+<TABLE>
+% $Groups = RT::Groups->new($session{'CurrentUser'});
+% $Groups->LimitToSystemInternalGroups();
+% while (my $Group = $Groups->Next()) {
+ <TR ALIGN=RIGHT>
+ <TD VALIGN=TOP>
+ <% loc($Group->Type) %>
+ </TD>
+ <TD>
+ <& /Admin/Elements/SelectRights, PrincipalId => $Group->PrincipalId, Object => $ClassObj &>
+ </TD>
+ </TR>
+% }
+</TABLE>
+<h1><&|/l&>User defined groups</&></h1>
+<TABLE>
+% $Groups = RT::Groups->new($session{'CurrentUser'});
+% $Groups->LimitToUserDefinedGroups();
+% while (my $Group = $Groups->Next()) {
+ <TR ALIGN=RIGHT>
+ <TD VALIGN=TOP>
+ <% $Group->Name %>
+ </TD>
+ <TD>
+ <& /Admin/Elements/SelectRights, PrincipalId => $Group->PrincipalId, Object => $ClassObj &>
+ </TD>
+ </TR>
+% }
+</TABLE>
+
+ <& /Elements/TitleBoxEnd &>
+ <& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &>
+
+ </FORM>
+
+<%INIT>
+
+
+if (!defined $id) {
+ $m->comp("/RTFM/Elements/Error", Why => loc("No Class defined"));
+}
+
+my $ClassObj = RT::FM::Class->new($session{'CurrentUser'});
+$ClassObj->Load($id) || $m->comp("/RTFM/Elements/Error", Why => loc("Couldn't load Class [_1]",$id));
+
+my $Groups;
+ #Update the acls.
+
+ my ( $ACL);
+
+ my @results = ProcessACLChanges(\%ARGS);
+
+
+</%INIT>
+
+<%ARGS>
+$id => undef
+</%ARGS>
Added: rtfm/branches/2.1-TESTING/html/Admin/RTFM/Classes/Modify.html
==============================================================================
--- (empty file)
+++ rtfm/branches/2.1-TESTING/html/Admin/RTFM/Classes/Modify.html Tue Mar 15 01:25:12 2005
@@ -0,0 +1,127 @@
+%# BEGIN LICENSE BLOCK
+%#
+%# Copyright (c) 2002-2003 Jesse Vincent <jesse at bestpractical.com>
+%#
+%# This program is free software; you can redistribute it and/or modify
+%# it under the terms of version 2 of the GNU General Public License
+%# as published by the Free Software Foundation.
+%#
+%# A copy of that license should have arrived with this
+%# software, but in any event can be snarfed from www.gnu.org.
+%#
+%# This program is distributed in the hope that it will be useful,
+%# but WITHOUT ANY WARRANTY; without even the implied warranty of
+%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+%# GNU General Public License for more details.
+%#
+%# END LICENSE BLOCK
+
+<& /Admin/RTFM/Elements/ClassTabs, id => $ClassObj->id, current_tab =>
+$current_subtab, Title => $title &>
+<& /Elements/ListActions, actions => \@results &>
+
+
+
+
+
+<FORM ACTION="<%$RT::WebPath%>/Admin/RTFM/Classes/Modify.html" METHOD=POST>
+%if ($Create ) {
+<INPUT TYPE=HIDDEN NAME=id VALUE="new">
+% } else {
+<INPUT TYPE=HIDDEN NAME=id VALUE="<%$ClassObj->Id%>">
+% }
+
+<TABLE>
+<TR><TD ALIGN=RIGHT>
+<&|/l&>Class Name</&>:
+</TD>
+<TD><INPUT name="Name" value="<% $Create ? "" : $ClassObj->Name %>"></TD>
+</TR><TR>
+<TD ALIGN=RIGHT>
+<&|/l&>Description</&>:</TD><TD COLSPAN=3><INPUT name="Description" value="<% $Create ? "" : $ClassObj->Description %>" size=60></TD></TR>
+<TR>
+<TR>
+<TD>
+</TD>
+<TD COLSPAN=4><INPUT TYPE=HIDDEN NAME="SetEnabled" VALUE="1">
+<INPUT TYPE=CHECKBOX NAME="Enabled" VALUE="1" <%$EnabledChecked%>> <&|/l&>Enabled (Unchecking this box disables this Class)</&><BR>
+</TD>
+</TR>
+
+</TABLE>
+<& /Elements/Submit &>
+</form>
+
+
+
+<%INIT>
+
+my $ClassObj = new RT::FM::Class($session{'CurrentUser'});
+my ($title, @results, $Disabled, $EnabledChecked);
+
+if ($Create) {
+ $title = loc("Create a Class");
+}
+
+else {
+ if ($id eq 'new') {
+ my ($val, $msg) = $ClassObj->Create(Name => $Name);
+ if ($val == 0 ) {
+ $m->comp("/RTFM/Elements/Error", Why => "$msg");
+ }
+ else {
+ push @results, $msg;
+ }
+ }
+ else {
+ $ClassObj->Load($id) || $ClassObj->Load($Name) || $m->comp("/RTFM/Elements/Error", Why => "Couldn't load class '$Name'");
+ }
+ $title = loc('Editing Configuration for Class [_1]', $ClassObj->Name);
+
+}
+if ($ClassObj->Id()) {
+my @attribs= qw(Description Name);
+
+ @results = UpdateRecordObject( AttributesRef => \@attribs,
+ Object => $ClassObj,
+ 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 != $ClassObj->Disabled) ) {
+ my ($code, $msg) = $ClassObj->SetDisabled($Disabled);
+ push @results, loc('Enabled status [_1]', loc_fuzzy($msg));
+}
+
+unless ($Create ? $Disabled : $ClassObj->Disabled()) {
+ $EnabledChecked ="CHECKED";
+}
+
+my $current_subtab;
+if ($Create == 1) {
+ $current_subtab = "Admin/RTFM/Classes/Modify.html?Create=1";
+
+} else {
+ $current_subtab = "Admin/RTFM/Classes/Modify.html?id=$id";
+
+}
+
+</%INIT>
+
+
+<%ARGS>
+$id => undef
+$result => undef
+$Name => undef
+$Create => undef
+$Description => undef
+$SetEnabled => undef
+$Enabled => 1
+</%ARGS>
Added: rtfm/branches/2.1-TESTING/html/Admin/RTFM/Classes/Topics.html
==============================================================================
--- (empty file)
+++ rtfm/branches/2.1-TESTING/html/Admin/RTFM/Classes/Topics.html Tue Mar 15 01:25:12 2005
@@ -0,0 +1,190 @@
+%# BEGIN LICENSE BLOCK
+%#
+%# Copyright (c) 2002-2003 Jesse Vincent <jesse at bestpractical.com>
+%#
+%# This program is free software; you can redistribute it and/or modify
+%# it under the terms of version 2 of the GNU General Public License
+%# as published by the Free Software Foundation.
+%#
+%# A copy of that license should have arrived with this
+%# software, but in any event can be snarfed from www.gnu.org.
+%#
+%# This program is distributed in the hope that it will be useful,
+%# but WITHOUT ANY WARRANTY; without even the implied warranty of
+%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+%# GNU General Public License for more details.
+%#
+%# END LICENSE BLOCK
+
+<& /Admin/RTFM/Elements/ClassTabs, id => $ClassObj->id, Title => $title, current_tab => "Admin/RTFM/Classes/Topics.html?id=$id" &>
+<& /Elements/ListActions, actions => \@results &>
+
+<form action="<%$RT::WebPath%>/Admin/RTFM/Classes/Topics.html" method="POST">
+<input type="hidden" name="id" value="<%$ClassObj->Id%>">
+
+% if (!$Modify) {
+<table>
+<tr>
+<td><&|/l&>Topic Name</&></td>
+<td><input type="text" name="Name" size="30" /></td>
+</tr>
+<tr>
+<td><&|/l&>Description</&></td>
+<td><input type="text" name="Description" size="50" /></td>
+</tr>
+</table>
+% } else {
+<a href="Topics.html">New topic</a>
+% }
+
+<& .tree, Element => $tree, Action => $Modify ? "Move" : "Add", Prefix => $Modify ? "Topic-$Modify-Parent" : "Insert", ClassObj => $ClassObj, Modify => $Modify &>
+
+</form>
+
+<%def .edit>
+
+<table style="margin-top: -0.75em">
+<tr><td>
+<input type="text" name="Topic-<%$topic->Id%>-Name" size="20" value="<%$topic->Name%>" /><br />
+<input type="text" name="Topic-<%$topic->Id%>-Description" size="20" value="<%$topic->Description%>" />
+</td><td>
+<input type="submit" name="Update" value="Update"><br />
+<input type="submit" name="Delete-Topic-<%$topic->Id%>" value="Delete" />
+</td></tr>
+</table>
+<%args>
+$topic
+</%args>
+</%def>
+
+<%def .tree>
+% my $topic = $Element->getNodeValue;
+% unless ($Element->isRoot) {
+% if ($Modify and $topic->Id == $Modify) {
+% $Action = "";
+<& .edit, topic => $topic &>
+% } else {
+<a href="<%$RT::WebPath%>/Admin/RTFM/Classes/Topics.html?id=<%$ClassObj->Id%>&Modify=<%$topic->Id%>"
+ title="<%$topic->Description%>"><%$topic->Name || loc("(no name)") %></a>
+% }
+% }
+<ul>
+% for my $e (sort {$a->getNodeValue->Name cmp $b->getNodeValue->Name} $Element->getAllChildren) {
+<li><& .tree, Element => $e, Action => $Action, Prefix => $Prefix, ClassObj => $ClassObj, Modify => $Modify &></li>
+% }
+% if ($Action) {
+% unless ($Action eq "Move" and grep {$_->getNodeValue->Id == $Modify} $Element->getAllChildren) {
+<li><input type="submit" name="<%$Prefix%>-<%$topic eq "root" ? 0 : $topic->Id%>" value="<&|/l&><%$Action%> here</&>" /></li>
+% }
+% }
+</ul>
+<%args>
+$Element
+$Action
+$Prefix
+$ClassObj
+$Modify
+</%args>
+</%def>
+</%def>
+
+<%INIT>
+
+my $ClassObj = new RT::FM::Class($session{'CurrentUser'});
+$ClassObj->Load($ARGS{'id'}) || $m->comp("/RTFM/Elements/Error", Why => "Couldn't load class '$id'");
+
+my $title = $Modify
+ ? loc("Modify topic for [_1]", $ClassObj->Name)
+ : loc("Edit topic hierarchy for [_1]", $ClassObj->Name);
+
+my @results;
+
+for my $k (keys %ARGS) {
+ if ($k =~ /^Topic-(\d+)-(Name|Description)/) {
+ my $topic = RT::FM::Topic->new($session{'CurrentUser'});
+ $topic->Load($1);
+ if ($topic->Id) {
+ next if $ARGS{$k} eq $topic->$2;
+ my $proc = "Set$2";
+ my ($val, $msg) = $topic->$proc($ARGS{$k});
+ push @results, $msg;
+ } else {
+ $m->comp("/Elements/Error", Why => loc("Topic not found"));
+ }
+ } elsif ($k =~ /^Topic-(\d+)-Parent-(\d+)/) {
+ my $topic = RT::FM::Topic->new($session{'CurrentUser'});
+ $topic->Load($1);
+ if ($topic->Id) {
+ next if $2 eq $topic->Parent;
+ my $old = $topic->Parent;
+ my $new = "$2";
+ my ($val, $msg) = $topic->setParent($new);
+ push @results, $msg;
+ } else {
+ $m->comp("/Elements/Error", Why => loc("Topic not found"));
+ }
+ } elsif ($k =~ /^Insert-(\d+)/) {
+ my $topic = RT::FM::Topic->new($session{'CurrentUser'});
+ my ($id, $msg) = $topic->Create(
+ Parent => $1,
+ Name => $ARGS{'Name'},
+ Description => $ARGS{'Description'},
+ ObjectType => ref($ClassObj),
+ ObjectId => $ClassObj->Id,
+ );
+ push @results, $msg;
+ }
+}
+for my $k (keys %ARGS) {
+ next unless $k =~ /^Delete-Topic-(\d+)/;
+ my $topic = RT::FM::Topic->new($session{'CurrentUser'});
+ $topic->Load($1);
+ if ($topic->Id) {
+ my ($val, $msg) = $topic->DeleteAll();
+ push @results, $msg;
+ } else {
+ $m->comp("/Elements/Error", Why => loc("Topic not found"));
+ }
+}
+
+my $topics = new RT::FM::TopicCollection($session{'CurrentUser'});
+$topics->LimitToObject($ClassObj);
+$topics->OrderByCols({FIELD => 'Parent'}, {FIELD => 'id'});
+
+use Tree::Simple;
+my $tree = Tree::Simple->new(Tree::Simple->ROOT);
+my %lookup = (0 => $tree);
+
+my @todo;
+while (my $topic = $topics->Next) {
+ push @todo, $topic;
+}
+
+{
+ my $changed = 0;
+ my @work = @todo;
+ @todo = ();
+ for my $topic (@work) {
+ if (defined $lookup{$topic->Parent}) {
+ $lookup{$topic->Id} = Tree::Simple->new($topic, $lookup{$topic->Parent});
+ $changed = 1;
+ } else {
+ push @todo, $topic;
+ }
+ }
+ redo unless $changed == 0;
+}
+
+for my $topic (@todo) {
+ $topic->setParent(0);
+ $lookup{$topic->Id} = Tree::Simple->new($topic, $tree);
+ push @results, "Reparented orphan ".$topic->Id." to root";
+}
+
+</%INIT>
+
+
+<%ARGS>
+$id => undef
+$Modify => ""
+</%ARGS>
Added: rtfm/branches/2.1-TESTING/html/Admin/RTFM/Classes/UserRights.html
==============================================================================
--- (empty file)
+++ rtfm/branches/2.1-TESTING/html/Admin/RTFM/Classes/UserRights.html Tue Mar 15 01:25:12 2005
@@ -0,0 +1,84 @@
+%# BEGIN LICENSE BLOCK
+%#
+%# Copyright (c) 2002-2003 Jesse Vincent <jesse at bestpractical.com>
+%#
+%# This program is free software; you can redistribute it and/or modify
+%# it under the terms of version 2 of the GNU General Public License
+%# as published by the Free Software Foundation.
+%#
+%# A copy of that license should have arrived with this
+%# software, but in any event can be snarfed from www.gnu.org.
+%#
+%# This program is distributed in the hope that it will be useful,
+%# but WITHOUT ANY WARRANTY; without even the implied warranty of
+%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+%# GNU General Public License for more details.
+%#
+%# END LICENSE BLOCK
+
+<& /Admin/RTFM/Elements/ClassTabs, id => $id , Title => loc('Modify user rights for class [_1]', $ClassObj->Name) &>
+<& /Elements/ListActions, actions => \@results &>
+
+ <FORM METHOD=POST ACTION="UserRights.html">
+ <INPUT TYPE=HIDDEN NAME=id VALUE="<% $ClassObj->id %>">
+
+<& /Elements/TitleBoxStart, title => loc('Modify user rights for class [_1]', $ClassObj->Name) &>
+
+<TABLE>
+
+% while (my $Member = $Users->Next()) {
+% my $UserObj = $Member->MemberObj->Object();
+% my $group = RT::Group->new($session{'CurrentUser'});
+% $group->LoadACLEquivalenceGroup($Member->MemberObj);
+ <TR ALIGN=RIGHT>
+ <TD VALIGN=TOP>
+ <% $UserObj->Name %>
+ </TD>
+ <TD>
+ <& /Admin/Elements/SelectRights, PrincipalId=> $group->PrincipalId,
+ Object => $ClassObj &>
+ </TD>
+ </TR>
+% }
+ </TABLE>
+
+ <& /Elements/TitleBoxEnd &>
+ <& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &>
+
+ </FORM>
+
+<%INIT>
+
+ #Update the acls.
+
+ my @results = ProcessACLChanges(\%ARGS);
+
+
+# {{{ Deal with setting up the display of current rights.
+
+
+
+if (!defined $id) {
+ $m->comp("/RTFM/Elements/Error", Why => loc("No Class defined"));
+}
+
+my $ClassObj = RT::FM::Class->new($session{'CurrentUser'});
+$ClassObj->Load($id) || $m->comp("/RTFM/Elements/Error", Why => loc("Couldn't load Class [_1]",$id));
+
+# Find out which users we want to display ACL selects for
+my $Privileged = RT::Group->new($session{'CurrentUser'});
+$Privileged->LoadSystemInternalGroup('Privileged');
+my $Users = $Privileged->MembersObj();
+
+
+
+# }}}
+
+</%INIT>
+
+<%ARGS>
+$id => undef
+$UserString => undef
+$UserOp => undef
+$UserField => undef
+</%ARGS>
Added: rtfm/branches/2.1-TESTING/html/Admin/RTFM/Classes/index.html
==============================================================================
--- (empty file)
+++ rtfm/branches/2.1-TESTING/html/Admin/RTFM/Classes/index.html Tue Mar 15 01:25:12 2005
@@ -0,0 +1,69 @@
+%# BEGIN LICENSE BLOCK
+%#
+%# Copyright (c) 2002-2003 Jesse Vincent <jesse at bestpractical.com>
+%#
+%# This program is free software; you can redistribute it and/or modify
+%# it under the terms of version 2 of the GNU General Public License
+%# as published by the Free Software Foundation.
+%#
+%# A copy of that license should have arrived with this
+%# software, but in any event can be snarfed from www.gnu.org.
+%#
+%# This program is distributed in the hope that it will be useful,
+%# but WITHOUT ANY WARRANTY; without even the implied warranty of
+%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+%# GNU General Public License for more details.
+%#
+%# END LICENSE BLOCK
+
+<& /Admin/RTFM/Elements/ClassTabs, current_tab => 'Admin/RTFM/Classes/', current_subtab => 'Admin/RTFM/Classes/', Title => loc("Select a Class") &>
+
+
+<TABLE>
+<TR>
+<TD>
+<%$caption%>:<BR>
+<UL>
+%if ($Classes->Count == 0) {
+<LI> <i><&|/l&>No Classes matching search criteria found.</&></i>
+% }
+%while ( $Class = $Classes->Next) {
+<LI><A HREF="Modify.html?id=<%$Class->id%>"><%$Class->Name%></a></LI>
+%}
+
+</UL>
+</TD>
+</TR>
+<TR>
+<TD VALIGN=TOP>
+
+<FORM METHOD=POST ACTION="<% $RT::WebPath %>/Admin/RTFM/Classes/index.html">
+
+<input type="checkbox" name="FindDisabledClasses" value="1"> <&|/l&>Include disabled classes in listing.</&>
+<BR>
+<div align=right><input type=submit value="<&|/l&>Go!</&>"></div>
+</FORM>
+</TD>
+</TR>
+</TABLE>
+
+<%INIT>
+my ($Class, $caption);
+my $Classes = new RT::FM::ClassCollection($session{'CurrentUser'});
+
+
+
+if ($FindDisabledClasses) {
+ $caption = loc("All Classes");
+ $Classes->{'find_disabled_rows'} = 1;
+ $Classes->UnLimit();
+} else {
+ $caption = loc("Enabled Classes");
+ $Classes->LimitToEnabled();
+
+}
+
+</%INIT>
+<%ARGS>
+$FindDisabledClasses => 0
+</%ARGS>
Added: rtfm/branches/2.1-TESTING/html/Admin/RTFM/Elements/ClassTabs
==============================================================================
--- (empty file)
+++ rtfm/branches/2.1-TESTING/html/Admin/RTFM/Elements/ClassTabs Tue Mar 15 01:25:12 2005
@@ -0,0 +1,67 @@
+%# BEGIN LICENSE BLOCK
+%#
+%# Copyright (c) 2002-2003 Jesse Vincent <jesse at bestpractical.com>
+%#
+%# This program is free software; you can redistribute it and/or modify
+%# it under the terms of version 2 of the GNU General Public License
+%# as published by the Free Software Foundation.
+%#
+%# A copy of that license should have arrived with this
+%# software, but in any event can be snarfed from www.gnu.org.
+%#
+%# This program is distributed in the hope that it will be useful,
+%# but WITHOUT ANY WARRANTY; without even the implied warranty of
+%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+%# GNU General Public License for more details.
+%#
+%# END LICENSE BLOCK
+<& /Elements/Header, Title => $Title &>
+<& /Admin/RTFM/Elements/Tabs,
+ subtabs => $tabs,
+ current_tab => 'Admin/RTFM/Classes/index.html',
+ current_subtab => $current_tab,
+ Title => $Title &>
+<%INIT>
+my $tabs;
+if ($id) {
+
+ $tabs = {
+ D => { title => loc('Basics'),
+ path => "Admin/RTFM/Classes/Modify.html?id=".$id,
+ },
+
+ E => { title => loc('Topics'),
+ path => "Admin/RTFM/Classes/Topics.html?id=".$id,
+ },
+
+ F => { title => loc('Custom Fields'),
+ path => 'Admin/RTFM/Classes/CustomFields.html?id='.$id,
+ },
+
+ G => { title => loc('Group Rights'),
+ path => "Admin/RTFM/Classes/GroupRights.html?id=".$id,
+ },
+
+ H => { title => loc('User Rights'),
+ path => "Admin/RTFM/Classes/UserRights.html?id=".$id,
+ },
+ };
+}
+if ($session{'CurrentUser'}->HasRight( Object => $RT::FM::System, Right => 'AdminClass')) {
+ $tabs->{"A"} = { title => loc('Select class'),
+ path => "Admin/RTFM/Classes/index.html",
+ };
+ $tabs->{"B"} = { title => loc('New class'),
+ path => "Admin/RTFM/Classes/Modify.html?Create=1",
+ separator => 1,
+ };
+}
+
+</%INIT>
+<%ARGS>
+$id => undef
+$current_tab => undef
+$current_subtab => undef
+$subtabs => undef
+$Title => undef
+</%ARGS>
Added: rtfm/branches/2.1-TESTING/html/Admin/RTFM/Elements/GlobalTabs
==============================================================================
--- (empty file)
+++ rtfm/branches/2.1-TESTING/html/Admin/RTFM/Elements/GlobalTabs Tue Mar 15 01:25:12 2005
@@ -0,0 +1,45 @@
+%# BEGIN LICENSE BLOCK
+%#
+%# Copyright (c) 2002-2003 Jesse Vincent <jesse at bestpractical.com>
+%#
+%# This program is free software; you can redistribute it and/or modify
+%# it under the terms of version 2 of the GNU General Public License
+%# as published by the Free Software Foundation.
+%#
+%# A copy of that license should have arrived with this
+%# software, but in any event can be snarfed from www.gnu.org.
+%#
+%# This program is distributed in the hope that it will be useful,
+%# but WITHOUT ANY WARRANTY; without even the implied warranty of
+%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+%# GNU General Public License for more details.
+%#
+%# END LICENSE BLOCK
+<& /Elements/Header, Title => $Title &>
+<& /Admin/RTFM/Elements/Tabs,
+ subtabs => $tabs,
+ current_tab => 'Admin/RTFM/Global/index.html',
+ current_subtab => $current_tab,
+ Title => $Title &>
+<%INIT>
+my $tabs;
+
+ $tabs = {
+
+ F => { title => loc('Group Rights'),
+ path => "Admin/RTFM/Global/GroupRights.html",
+ },
+ G => { title => loc('User Rights'),
+ path => "Admin/RTFM/Global/UserRights.html",
+ },
+
+
+
+};
+</%INIT>
+<%ARGS>
+$current_tab => undef
+$current_subtab => undef
+$subtabs => undef
+$Title => undef
+</%ARGS>
Added: rtfm/branches/2.1-TESTING/html/Admin/RTFM/Elements/Header
==============================================================================
--- (empty file)
+++ rtfm/branches/2.1-TESTING/html/Admin/RTFM/Elements/Header Tue Mar 15 01:25:12 2005
@@ -0,0 +1,23 @@
+%# BEGIN LICENSE BLOCK
+%#
+%# Copyright (c) 2002-2003 Jesse Vincent <jesse at bestpractical.com>
+%#
+%# This program is free software; you can redistribute it and/or modify
+%# it under the terms of version 2 of the GNU General Public License
+%# as published by the Free Software Foundation.
+%#
+%# A copy of that license should have arrived with this
+%# software, but in any event can be snarfed from www.gnu.org.
+%#
+%# This program is distributed in the hope that it will be useful,
+%# but WITHOUT ANY WARRANTY; without even the implied warranty of
+%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+%# GNU General Public License for more details.
+%#
+%# END LICENSE BLOCK
+
+#<& /Elements/Header, Title => $Title &>
+
+<%ARGS>
+$Title => undef
+</%ARGS>
Added: rtfm/branches/2.1-TESTING/html/Admin/RTFM/Elements/Tabs
==============================================================================
--- (empty file)
+++ rtfm/branches/2.1-TESTING/html/Admin/RTFM/Elements/Tabs Tue Mar 15 01:25:12 2005
@@ -0,0 +1,46 @@
+%# BEGIN LICENSE BLOCK
+%#
+%# Copyright (c) 2002-2003 Jesse Vincent <jesse at bestpractical.com>
+%#
+%# This program is free software; you can redistribute it and/or modify
+%# it under the terms of version 2 of the GNU General Public License
+%# as published by the Free Software Foundation.
+%#
+%# A copy of that license should have arrived with this
+%# software, but in any event can be snarfed from www.gnu.org.
+%#
+%# This program is distributed in the hope that it will be useful,
+%# but WITHOUT ANY WARRANTY; without even the implied warranty of
+%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+%# GNU General Public License for more details.
+%#
+%# END LICENSE BLOCK
+<& /Admin/Elements/Tabs,
+ subtabs => $tabs,
+ current_tab => 'Admin/RTFM/index.html',
+ current_subtab => $current_tab,
+ Title => $Title &>
+<%INIT>
+ my $tabs = { Classes => { title => loc('Classes'),
+ path => 'Admin/RTFM/Classes/index.html',
+ },
+ Global => { title => loc('Global'),
+ path => 'Admin/RTFM/Global/index.html',
+ },
+ };
+ foreach my $tab (sort keys %{$tabs}) {
+ if ($tabs->{$tab}->{'path'} eq $current_tab) {
+ $tabs->{$tab}->{"subtabs"} = $subtabs;
+ $tabs->{$tab}->{"current_subtab"} = $current_subtab;
+ }
+ }
+
+</%INIT>
+
+
+<%ARGS>
+$subtabs => undef
+$current_tab => undef
+$current_subtab => undef
+$Title => undef
+</%ARGS>
Added: rtfm/branches/2.1-TESTING/html/Admin/RTFM/Global/GroupRights.html
==============================================================================
--- (empty file)
+++ rtfm/branches/2.1-TESTING/html/Admin/RTFM/Global/GroupRights.html Tue Mar 15 01:25:12 2005
@@ -0,0 +1,82 @@
+%# BEGIN LICENSE BLOCK
+%#
+%# Copyright (c) 1996-2003 Jesse Vincent <jesse at bestpractical.com>
+%#
+%# (Except where explictly superceded by other copyright notices)
+%#
+%# 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
+%# been provided with this software, but in any event can be snarfed
+%# from www.gnu.org.
+%#
+%# This work is distributed in the hope that it will be useful, but
+%# WITHOUT ANY WARRANTY; without even the implied warranty of
+%# 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.
+%#
+%#
+%# END LICENSE BLOCK
+<& /Admin/RTFM/Elements/GlobalTabs,
+ current_tab => 'Admin/RTFM/Global/GroupRights.html',
+ Title => loc('Modify global group rights') &>
+<& /Elements/ListActions, actions => \@results &>
+
+ <FORM METHOD=POST ACTION="GroupRights.html">
+
+<& /Elements/TitleBoxStart, title => loc('Modify global group rights.')&>
+
+<h1><&|/l&>System groups</&></h1>
+<TABLE>
+% $Groups = RT::Groups->new($session{'CurrentUser'});
+% $Groups->LimitToSystemInternalGroups();
+% while (my $Group = $Groups->Next()) {
+ <TR ALIGN=RIGHT>
+ <TD VALIGN=TOP>
+ <% loc($Group->Type) %>
+ </TD>
+ <TD>
+ <& /Admin/Elements/SelectRights, PrincipalId => $Group->PrincipalId,
+ Object =>$RT::FM::System &>
+ </TD>
+ </TR>
+% }
+</TABLE>
+<h1><&|/l&>User defined groups</&></h1>
+<TABLE>
+% $Groups = RT::Groups->new($session{'CurrentUser'});
+% $Groups->LimitToUserDefinedGroups();
+% while (my $Group = $Groups->Next()) {
+ <TR ALIGN=RIGHT>
+ <TD VALIGN=TOP>
+ <% $Group->Name %>
+ </TD>
+ <TD>
+ <& /Admin/Elements/SelectRights, PrincipalId => $Group->PrincipalId,
+ Object => $RT::FM::System &>
+ </TD>
+ </TR>
+% }
+</TABLE>
+
+ <& /Elements/TitleBoxEnd &>
+ <& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &>
+
+ </FORM>
+
+<%INIT>
+
+ #Update the acls.
+ my @results = ProcessACLChanges(\%ARGS);
+
+
+my $Groups;
+
+</%INIT>
+
+<%ARGS>
+</%ARGS>
Added: rtfm/branches/2.1-TESTING/html/Admin/RTFM/Global/UserRights.html
==============================================================================
--- (empty file)
+++ rtfm/branches/2.1-TESTING/html/Admin/RTFM/Global/UserRights.html Tue Mar 15 01:25:12 2005
@@ -0,0 +1,76 @@
+%# BEGIN LICENSE BLOCK
+%#
+%# Copyright (c) 1996-2003 Jesse Vincent <jesse at bestpractical.com>
+%#
+%# (Except where explictly superceded by other copyright notices)
+%#
+%# 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
+%# been provided with this software, but in any event can be snarfed
+%# from www.gnu.org.
+%#
+%# This work is distributed in the hope that it will be useful, but
+%# WITHOUT ANY WARRANTY; without even the implied warranty of
+%# 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.
+%#
+%#
+%# END LICENSE BLOCK
+<& /Admin/RTFM/Elements/GlobalTabs,
+ current_tab => 'Admin/Global/UserRights.html',
+ Title => loc('Modify global user rights') &>
+<& /Elements/ListActions, actions => \@results &>
+
+ <FORM METHOD=POST ACTION="UserRights.html">
+
+<& /Elements/TitleBoxStart, title => loc('Modify global user rights.') &>
+
+<TABLE>
+
+% while (my $Member = $Users->Next()) {
+% my $UserObj = $Member->MemberObj->Object();
+% my $group = RT::Group->new($session{'CurrentUser'});
+% $group->LoadACLEquivalenceGroup($Member->MemberObj);
+ <TR ALIGN=RIGHT>
+ <TD VALIGN=TOP>
+ <% $UserObj->Name %>
+ </TD>
+ <TD>
+ <& /Admin/Elements/SelectRights, PrincipalId => $group->PrincipalId,
+ Object => $RT::FM::System &>
+ </TD>
+ </TR>
+% }
+</TABLE>
+
+ <& /Elements/TitleBoxEnd &>
+ <& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &>
+
+ </FORM>
+
+<%INIT>
+
+ #Update the acls.
+ my @results = ProcessACLChanges(\%ARGS);
+
+# {{{ Deal with setting up the display of current rights.
+
+
+# Find out which users we want to display ACL selects for
+my $Privileged = RT::Group->new($session{'CurrentUser'});
+$Privileged->LoadSystemInternalGroup('Privileged');
+my $Users = $Privileged->MembersObj();
+
+
+
+# }}}
+
+</%INIT>
+
+<%ARGS>
+</%ARGS>
Added: rtfm/branches/2.1-TESTING/html/Admin/RTFM/Global/index.html
==============================================================================
--- (empty file)
+++ rtfm/branches/2.1-TESTING/html/Admin/RTFM/Global/index.html Tue Mar 15 01:25:12 2005
@@ -0,0 +1,27 @@
+%# BEGIN LICENSE BLOCK
+%#
+%# Copyright (c) 1996-2003 Jesse Vincent <jesse at bestpractical.com>
+%#
+%# (Except where explictly superceded by other copyright notices)
+%#
+%# 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
+%# been provided with this software, but in any event can be snarfed
+%# from www.gnu.org.
+%#
+%# This work is distributed in the hope that it will be useful, but
+%# WITHOUT ANY WARRANTY; without even the implied warranty of
+%# 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.
+%#
+%#
+%# END LICENSE BLOCK
+<& /Admin/RTFM/Elements/GlobalTabs,
+ current_tab => 'Admin/Global/UserRights.html',
+ Title => '' &>
+
Added: rtfm/branches/2.1-TESTING/html/Admin/RTFM/index.html
==============================================================================
--- (empty file)
+++ rtfm/branches/2.1-TESTING/html/Admin/RTFM/index.html Tue Mar 15 01:25:12 2005
@@ -0,0 +1,19 @@
+%# BEGIN LICENSE BLOCK
+%#
+%# Copyright (c) 2002-2003 Jesse Vincent <jesse at bestpractical.com>
+%#
+%# This program is free software; you can redistribute it and/or modify
+%# it under the terms of version 2 of the GNU General Public License
+%# as published by the Free Software Foundation.
+%#
+%# A copy of that license should have arrived with this
+%# software, but in any event can be snarfed from www.gnu.org.
+%#
+%# This program is distributed in the hope that it will be useful,
+%# but WITHOUT ANY WARRANTY; without even the implied warranty of
+%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+%# GNU General Public License for more details.
+%#
+%# END LICENSE BLOCK
+<& /Elements/Header, Title => loc('RTFM Administration') &>
+<& /Admin/RTFM/Elements/Tabs, Title => loc('RTFM Administration') &>
Added: rtfm/branches/2.1-TESTING/html/Callbacks/RTFM/Admin/Elements/Tabs/Default
==============================================================================
--- (empty file)
+++ rtfm/branches/2.1-TESTING/html/Callbacks/RTFM/Admin/Elements/Tabs/Default Tue Mar 15 01:25:12 2005
@@ -0,0 +1,11 @@
+<%args>
+$id => undef
+$tabs => undef
+</%args>
+<%init>
+ $tabs->{RTFM} = {
+ title => loc('RTFM'),
+ path => "Admin/RTFM/index.html"
+ };
+
+</%init>
Added: rtfm/branches/2.1-TESTING/html/Callbacks/RTFM/Admin/index.html/Default
==============================================================================
--- (empty file)
+++ rtfm/branches/2.1-TESTING/html/Callbacks/RTFM/Admin/index.html/Default Tue Mar 15 01:25:12 2005
@@ -0,0 +1,12 @@
+<%args>
+$id => undef
+$tabs => undef
+</%args>
+<%init>
+ $tabs->{RTFM} = {
+ title => loc('RTFM'),
+ path => "Admin/RTFM/index.html",
+ description => loc('Manage RTFM classes and permissions')
+ };
+
+</%init>
Modified: rtfm/branches/2.1-TESTING/html/Callbacks/RTFM/Ticket/Update.html/BeforeMessageBox
==============================================================================
--- rtfm/branches/2.1-TESTING/html/Callbacks/RTFM/Ticket/Update.html/BeforeMessageBox (original)
+++ rtfm/branches/2.1-TESTING/html/Callbacks/RTFM/Ticket/Update.html/BeforeMessageBox Tue Mar 15 01:25:12 2005
@@ -1,64 +0,0 @@
-%# BEGIN LICENSE BLOCK
-%#
-%# Copyright (c) 2002-2003 Jesse Vincent <jesse at bestpractical.com>
-%#
-%# This program is free software; you can redistribute it and/or modify
-%# it under the terms of version 2 of the GNU General Public License
-%# as published by the Free Software Foundation.
-%#
-%# A copy of that license should have arrived with this
-%# software, but in any event can be snarfed from www.gnu.org.
-%#
-%# This program is distributed in the hope that it will be useful,
-%# but WITHOUT ANY WARRANTY; without even the implied warranty of
-%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-%# GNU General Public License for more details.
-%#
-%# END LICENSE BLOCK
-
-% foreach my $arg (keys %ARGS) {
-% if ($arg =~ /^RTFM-Include-Article-(\d+)$/) {
-% my $art = RT::FM::Article->new($session{'CurrentUser'});
-% $art->Load($1);
-% if ($art->Id) {
-<input type="hidden" name="<%$ARGS{'id'}%>-RefersTo" value="<%$art->URI%>">
-% }
-
-% }
-%}
-<table>
-<tr><td><&|/l&>Search for RTFM articles matching</&></td>
-<td><input size=20 name="RTFM_Content"></td>
-</tr>
-<tr>
-<td><&|/l&>Include RTFM article:</&></td><td><input size=20 name="RTFM-Include-Article-Named"></td><td><input type=submit value="Go"></td>
-</tr>
-% while (my $article = $articles_content->Next) {
-<tr><td> </td><td><%$article->Name|| loc('(unnamed)')%>: <%$article->Summary%></td><td><input type=submit name="RTFM-Include-Article-<%$article->Id%>" value="Go"></td></tr>
-%}
-% while (my $article = $articles_basics->Next) {
-<tr><td> </td><td><%$article->Name || loc('(unnamed)')%>: <%$article->Summary%></td><td><input type=submit name="RTFM-Include-Article-<%$article->Id%>" value="Go"></td></tr>
-%}
-</table>
-<%init>
-use RT::FM::ArticleCollection;
-
-my $articles_content =
- RT::FM::ArticleCollection->new( $session{'CurrentUser'} );
-my $articles_basics = RT::FM::ArticleCollection->new( $session{'CurrentUser'} );
-if ( $ARGS{'RTFM_Content'} ) {
- $articles_content->LimitToCustomFieldValue( VALUE => $ARGS{'RTFM_Content'},
- OPERATOR => 'LIKE' );
-
- $articles_basics->Limit( SUBCLAUSE => 'all',
- FIELD => 'Name',
- OPERATOR => 'LIKE',
- VALUE => $ARGS{'RTFM_Content'},
- ENTRYAGGREGATOR => "OR" );
- $articles_basics->Limit( SUBCLAUSE => 'all',
- FIELD => 'Summary',
- OPERATOR => 'LIKE',
- VALUE => $ARGS{'RTFM_Content'},
- ENTRYAGGREGATOR => "OR" );
-}
-</%init>
Modified: rtfm/branches/2.1-TESTING/html/RTFM/Elements/Header
==============================================================================
--- rtfm/branches/2.1-TESTING/html/RTFM/Elements/Header (original)
+++ rtfm/branches/2.1-TESTING/html/RTFM/Elements/Header Tue Mar 15 01:25:12 2005
@@ -15,5 +15,4 @@
%# GNU General Public License for more details.
%#
%# END LICENSE BLOCK
-
<& /Elements/Header, %ARGS &>
Modified: rtfm/branches/2.1-TESTING/html/RTFM/Elements/Tabs
==============================================================================
--- rtfm/branches/2.1-TESTING/html/RTFM/Elements/Tabs (original)
+++ rtfm/branches/2.1-TESTING/html/RTFM/Elements/Tabs Tue Mar 15 01:25:12 2005
@@ -46,7 +46,7 @@
'atopics' => { title => loc('Topics'),
path => 'RTFM/Topics.html'},
'd' => { title => loc('Configuration'),
- path => 'RTFM/Admin/index.html' }
+ path => 'Admin/RTFM/index.html' }
};
my $topactions = {
More information about the Rt-commit
mailing list