X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Fwebrt%2FAdmin%2FKeywords%2Findex.html;fp=rt%2Fwebrt%2FAdmin%2FKeywords%2Findex.html;h=12814ec0306ecc3586eedbb0528ca7de5180cf90;hp=0000000000000000000000000000000000000000;hb=3ef62a0570055da710328937e7f65dbb2c027c62;hpb=030438c9cb1c12ccb79130979ef0922097b4311a
diff --git a/rt/webrt/Admin/Keywords/index.html b/rt/webrt/Admin/Keywords/index.html
new file mode 100644
index 000000000..12814ec03
--- /dev/null
+++ b/rt/webrt/Admin/Keywords/index.html
@@ -0,0 +1,110 @@
+<& /Elements/Header, Title => 'Admin/Keywords' &>
+<& /Admin/Elements/Tabs, current_tab => 'Admin/Keywords/' &>
+
+<& /Elements/ListActions, actions => \@Actions &>
+
+<& /Elements/TitleBoxStart, title => 'Keywords' &>
+<%$Root->Path%>
+
+
+<& /Elements/TitleBoxEnd &>
+<%INIT>
+my (@Actions);
+
+if ($ARGS{'KeyName-New'}) {
+ my $NewKey = new RT::Keyword($session{'CurrentUser'});
+ my ($val, $msg) = $NewKey->Create( Parent => $RootId, Name => $ARGS{'KeyName-New'});
+ push (@Actions, $msg);
+}
+
+my $arg;
+foreach $arg (keys %ARGS) {
+ if ($arg =~ /^Disable-(\d*)$/) {
+ my $id = $1;
+ my $keyword = new RT::Keyword($session{'CurrentUser'});
+ $keyword->Load($id);
+ my ($val, $msg) = $keyword->SetDisabled(1);
+ push (@Actions, $msg);
+
+
+ }
+ elsif ($arg =~ /^Enable-(\d*)$/) {
+ my $id = $1;
+ my $keyword = new RT::Keyword($session{'CurrentUser'});
+ $keyword->Load($id);
+ my ($val, $msg) = $keyword->SetDisabled(0);
+ push (@Actions, $msg);
+ }
+ elsif ($arg =~ /^KeyName-(\d*)$/) {
+ my $id = $1;
+ my $keyword = new RT::Keyword ($session{'CurrentUser'});
+ $keyword->Load($id);
+ if ($keyword->Name() ne $ARGS{"$arg"}) {
+ my ($val, $msg) = $keyword->SetName($ARGS{"$arg"});
+ push (@Actions, $msg);
+ }
+ if (($ARGS{"KeyParent-$id"}) &&
+ ($keyword->Parent ne $ARGS{"KeyParent-$id"})) {
+ my ($val, $msg) = $keyword->SetParent($ARGS{"KeyParent-$id"});
+ push (@Actions, $msg);
+ }
+ }
+}
+
+
+my $Root = new RT::Keyword($session{'CurrentUser'});
+my $Keywords;
+#If we have a root load it.
+if ($RootId != 0) {
+ $Root->Load($RootId);
+ $Keywords = $Root->Children();
+
+}
+else {
+ $Keywords = new RT::Keywords($session{'CurrentUser'});
+ $Keywords->LimitToParent(0);
+}
+
+if ($ShowDisabled) {
+ $Keywords->{'find_disabled_rows'} = 1;
+}
+
+
+
+
+%INIT>
+<%ARGS>
+$RootId => 0
+$Edit => undef
+$ShowDisabled => 0
+%ARGS>