[Bps-public-commit] rt-extension-formtools branch dynamic-forms-from-config updated. 0.53-11-ge91c1e5

BPS Git Server git at git.bestpractical.com
Fri Sep 15 21:03:25 UTC 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt-extension-formtools".

The branch, dynamic-forms-from-config has been updated
       via  e91c1e572550441668a50aa2d7b4a23cacbd71ee (commit)
      from  6e8a44fe07c82304f36b080197c6c7be67a1ddb9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit e91c1e572550441668a50aa2d7b4a23cacbd71ee
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Fri Sep 15 17:03:18 2023 -0400

    Create initial admin pages

diff --git a/html/Admin/FormTools/Modify.html b/html/Admin/FormTools/Modify.html
new file mode 100644
index 0000000..abec629
--- /dev/null
+++ b/html/Admin/FormTools/Modify.html
@@ -0,0 +1,31 @@
+<& /Admin/Elements/Header, Title => $title &>
+<& /Elements/Tabs &>
+<& /Elements/ListActions, actions => \@results &>
+
+<p><&|/l&>Loaded form <% $form_attribute->Description %></&></p>
+
+<pre>
+% use Data::Printer;
+% $m->out(np($form));
+</pre>
+
+<%INIT>
+
+Abort("No form id found") unless $id;
+
+my $form_attribute = RT::Attribute->new($session{'CurrentUser'});
+my ($ok, $msg) = $form_attribute->Load($id);
+
+unless ( $ok ) {
+    Abort("Unable to load form with id $id");
+}
+
+my $form = $form_attribute->Content;
+
+my ($title, @results);
+$title = loc("Modify form [_1]", $form_attribute->Description);
+
+</%INIT>
+<%ARGS>
+$id => undef
+</%ARGS>
diff --git a/html/Admin/FormTools/index.html b/html/Admin/FormTools/index.html
new file mode 100644
index 0000000..68f0913
--- /dev/null
+++ b/html/Admin/FormTools/index.html
@@ -0,0 +1,57 @@
+<& /Admin/Elements/Header, Title => loc("Admin FormTools") &>
+<& /Elements/Tabs &>
+<& /Elements/ListActions, actions => \@results &>
+
+  <table class="table collection collection-as-table" cellspacing="0">
+    <tbody>
+      <tr class="collection-as-table">
+        <th class="collection-as-table"><&|/l&>Name</&></th>
+        <th class="collection-as-table"><&|/l&>Creates Tickets in Queue</&></th>
+      </tr>
+% my $i = 0;
+% for my $form_ref ( @forms ) {
+
+      <tr class="<% $i % 2 ? 'oddline' : 'evenline' %>">
+        <td class="collection-as-table"><a href="<% RT->Config->Get('WebURL') %>Admin/FormTools/Modify.html?id=<% $form_ref->{'id'} %>"><% $form_ref->{'name'} %></a></td>
+        <td class="collection-as-table"><% $form_ref->{'queue_name'} %></td>
+      </tr>
+%    ++$i;
+% }
+    </tbody>
+  </table>
+
+<%init>
+my @results;
+
+my $forms = RT::Attributes->new( $session{'CurrentUser'} );
+$forms->Limit( FIELD => 'Name', VALUE => 'FormTools Form' );
+
+my @unsorted_forms;
+while ( my $form = $forms->Next ) {
+    my $form_ref = $form->Content;
+    $form_ref->{'name'} = $form->Description;
+    $form_ref->{'id'} = $form->Id;
+
+    my $queue = RT::Queue->new( $session{'CurrentUser'} );
+    my ($ok, $msg) = $queue->Load($form_ref->{'queue'});
+    if ( $ok ) {
+        $form_ref->{'queue_name'} = $queue->Name;
+    }
+    else {
+        RT->Logger->error("FormTools unable to load queue " . $form_ref->{'queue'} . " $msg");
+    }
+
+    push @unsorted_forms, $form_ref;
+}
+
+my @forms = sort { $a->{'name'} cmp $b->{'name'} } @unsorted_forms;
+
+$m->callback(
+    CallbackName     => 'Initial',
+    FormsRef         => \@forms,
+    ARGSRef          => \%ARGS
+);
+
+</%init>
+<%args>
+</%args>

-----------------------------------------------------------------------

Summary of changes:
 html/Admin/FormTools/Modify.html | 31 ++++++++++++++++++++++
 html/Admin/FormTools/index.html  | 57 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 88 insertions(+)
 create mode 100644 html/Admin/FormTools/Modify.html
 create mode 100644 html/Admin/FormTools/index.html


hooks/post-receive
-- 
rt-extension-formtools


More information about the Bps-public-commit mailing list