[Bps-public-commit] rt-extension-todolist branch, master, updated. 0b40cfbfb3dcdd9668c866f4373ad933fa640bd1

Craig Kaiser craig at bestpractical.com
Fri Apr 19 12:48:37 EDT 2019


The branch, master has been updated
       via  0b40cfbfb3dcdd9668c866f4373ad933fa640bd1 (commit)
       via  6117d055be9feb8e6764fc184fef97c0e75ad008 (commit)
       via  5ff86480a675bc41b8ce6d37d5315257a8740288 (commit)
       via  63a986fbcfc5b7d1cdf28c12d8359db74c37f0c1 (commit)
      from  d2df3641896b35348b3532c02a282058cfabe3b4 (commit)

Summary of changes:
 MANIFEST                                           | 30 ++++++++++++++
 README                                             | 40 +++++++++++-------
 .../Admin/CustomFields/Modify.html/EndOfTable      |  0
 .../Admin/CustomFields/Modify.html/Initial         |  1 -
 .../Elements/EditCustomFields/MassageCustomFields  |  0
 .../Elements/ShowCustomFields/BeforeCustomFields   |  0
 .../Ticket/Elements/ShowSummary/AfterPeople        |  0
 html/Elements/TodoList                             | 25 ++++++-----
 lib/RT/CustomFields_Vendor.pm                      |  2 +
 lib/RT/Extension/TodoList.pm                       | 48 +++++++++++++---------
 static/css/rt-extension-todolist.css               |  3 ++
 .../js/{TodoList.js => rt-extension-todolist.js}   |  0
 12 files changed, 103 insertions(+), 46 deletions(-)
 create mode 100644 MANIFEST
 rename html/Callbacks/{TodoList => RT-Extension-TodoList}/Admin/CustomFields/Modify.html/EndOfTable (100%)
 rename html/Callbacks/{TodoList => RT-Extension-TodoList}/Admin/CustomFields/Modify.html/Initial (96%)
 rename html/Callbacks/{TodoList => RT-Extension-TodoList}/Elements/EditCustomFields/MassageCustomFields (100%)
 rename html/Callbacks/{TodoList => RT-Extension-TodoList}/Elements/ShowCustomFields/BeforeCustomFields (100%)
 rename html/Callbacks/{TodoList => RT-Extension-TodoList}/Ticket/Elements/ShowSummary/AfterPeople (100%)
 create mode 100644 static/css/rt-extension-todolist.css
 rename static/js/{TodoList.js => rt-extension-todolist.js} (100%)

- Log -----------------------------------------------------------------
commit 63a986fbcfc5b7d1cdf28c12d8359db74c37f0c1
Author: Craig Kaiser <craig at bestpractical.com>
Date:   Wed Apr 10 11:40:35 2019 -0400

    Limit Todo List portlet to queues where todolist applied

diff --git a/lib/RT/CustomFields_Vendor.pm b/lib/RT/CustomFields_Vendor.pm
index 8a59599..8a75b14 100644
--- a/lib/RT/CustomFields_Vendor.pm
+++ b/lib/RT/CustomFields_Vendor.pm
@@ -45,6 +45,7 @@ sub LimitToNotTodo {
     while ( my $attribute = $attributes->Next ) {
         push @custom_field_ids, $attribute->ObjectId;
     }
+    return unless scalar @custom_field_ids;
 
     $self->Limit(
         FIELD         => 'Id',

commit 5ff86480a675bc41b8ce6d37d5315257a8740288
Author: Craig Kaiser <craig at bestpractical.com>
Date:   Fri Apr 19 11:44:26 2019 -0400

    Do not check for custom fields if no IDs found

diff --git a/lib/RT/CustomFields_Vendor.pm b/lib/RT/CustomFields_Vendor.pm
index 8a75b14..cbc3339 100644
--- a/lib/RT/CustomFields_Vendor.pm
+++ b/lib/RT/CustomFields_Vendor.pm
@@ -14,6 +14,7 @@ sub LimitTodoToObject {
     while ( my $attribute = $attributes->Next ) {
         push @custom_field_ids, $attribute->ObjectId;
     }
+    return unless scalar @custom_field_ids;
 
     $self->Limit(
         ALIAS           => $self->_OCFAlias,

commit 6117d055be9feb8e6764fc184fef97c0e75ad008
Author: Craig Kaiser <craig at bestpractical.com>
Date:   Fri Apr 19 12:00:12 2019 -0400

    Add style sheet to extension

diff --git a/lib/RT/Extension/TodoList.pm b/lib/RT/Extension/TodoList.pm
index be7bef2..c1d0388 100644
--- a/lib/RT/Extension/TodoList.pm
+++ b/lib/RT/Extension/TodoList.pm
@@ -4,7 +4,8 @@ package RT::Extension::TodoList;
 
 our $VERSION = '0.01';
 
-RT->AddJavaScript('TodoList.js');
+RT->AddStyleSheets('rt-extension-todolist.css');
+RT->AddJavaScript('rt-extension-todolist.js');
 
 sub UpdateTodoList {
     my $self = shift;
diff --git a/static/css/rt-extension-todolist.css b/static/css/rt-extension-todolist.css
new file mode 100644
index 0000000..1efc8c1
--- /dev/null
+++ b/static/css/rt-extension-todolist.css
@@ -0,0 +1,3 @@
+.todo-list-container {
+    display: inline-flex;
+}
\ No newline at end of file

commit 0b40cfbfb3dcdd9668c866f4373ad933fa640bd1
Author: Craig Kaiser <craig at bestpractical.com>
Date:   Fri Apr 19 12:17:30 2019 -0400

    Release version 0.01

diff --git a/MANIFEST b/MANIFEST
new file mode 100644
index 0000000..57945ec
--- /dev/null
+++ b/MANIFEST
@@ -0,0 +1,30 @@
+Changes
+html/Callbacks/RT-Extension-TodoList/Admin/CustomFields/Modify.html/EndOfTable
+html/Callbacks/RT-Extension-TodoList/Admin/CustomFields/Modify.html/Initial
+html/Callbacks/RT-Extension-TodoList/Elements/EditCustomFields/MassageCustomFields
+html/Callbacks/RT-Extension-TodoList/Elements/ShowCustomFields/BeforeCustomFields
+html/Callbacks/RT-Extension-TodoList/Ticket/Elements/ShowSummary/AfterPeople
+html/Elements/TodoList
+html/Helpers/TodoList
+inc/Module/Install.pm
+inc/Module/Install/Base.pm
+inc/Module/Install/Can.pm
+inc/Module/Install/Fetch.pm
+inc/Module/Install/Include.pm
+inc/Module/Install/Makefile.pm
+inc/Module/Install/Metadata.pm
+inc/Module/Install/ReadmeFromPod.pm
+inc/Module/Install/RTx.pm
+inc/Module/Install/RTx/Runtime.pm
+inc/Module/Install/Win32.pm
+inc/Module/Install/WriteAll.pm
+inc/YAML/Tiny.pm
+lib/RT/CustomFields_Vendor.pm
+lib/RT/Extension/TodoList.pm
+Makefile.PL
+MANIFEST			This list of files
+META.yml
+README
+RT-Extension-TodoList-0.01/lib/RT/CustomFields_Vendor.pm
+static/css/rt-extension-todolist.css
+static/js/rt-extension-todolist.js
diff --git a/README b/README
index e5973fa..d29e119 100644
--- a/README
+++ b/README
@@ -3,24 +3,24 @@ NAME
 
 DESCRIPTION
     Add todo lists to tickets. Often a ticket will define a task that
-    requires several repeatable steps. For example: Deploy new server -
-    Order server - Find rack space - Confirm power - Run networking - Assign
-    IPs - Autoload base OS Those steps may need to be repeated each time a
-    new server is set up. One approach would be to create a linked
-    depends-on or child ticket for each one. However, they may be always
-    done by the same person (the ticket Owner) and may not other ticket
-    details tracked separately. This feature will also be useful in RTIR
-    where different incident types can display a different to do list, one
-    for Malware, one for DDos, one for Phising Email, etc.
-
-    To make a custom field a todo list custom field, create a new custom
-    field of type "select multiple values". Once created there will be a
-    checkbox option to make the custom field a todo list custom field, then
-    you can apply the custom field by queue per usual.
+    requires several repeatable steps. For example:
+
+        'Deploy new server' = (
+            Order server,
+            Find rack space,
+            Confirm power,
+            Run networking,
+            Assign IPs,
+            Autoload base OS
+        );
+
+    Where the steps listed above will generally always be the same for the
+    task of deploying a new server rack. This extension make tracking these
+    tasks from one ticket simple by adding a todo list that can be used
+    repeatedly on any ticket created for the queue.
 
 RT VERSION
     Works with RT 4.4
-
 INSTALLATION
     perl Makefile.PL
     make
@@ -37,6 +37,16 @@ INSTALLATION
 
     Restart your webserver
 
+CONFIGURATION
+    To make a custom field a todo list custom field, create a new custom
+    field of type "select multiple values". Once created there will be a
+    checkbox option to make the custom field a todo list custom field, then
+    you can apply the custom field by queue per usual.
+
+    Each item in the list will be a todo list checkbox item and each custom
+    field applied to the queue as a todo list custom field will be available
+    to load as the tickets todo's.
+
 AUTHOR
     Best Practical Solutions, LLC <modules at bestpractical.com>
 
diff --git a/html/Callbacks/TodoList/Admin/CustomFields/Modify.html/EndOfTable b/html/Callbacks/RT-Extension-TodoList/Admin/CustomFields/Modify.html/EndOfTable
similarity index 100%
rename from html/Callbacks/TodoList/Admin/CustomFields/Modify.html/EndOfTable
rename to html/Callbacks/RT-Extension-TodoList/Admin/CustomFields/Modify.html/EndOfTable
diff --git a/html/Callbacks/TodoList/Admin/CustomFields/Modify.html/Initial b/html/Callbacks/RT-Extension-TodoList/Admin/CustomFields/Modify.html/Initial
similarity index 96%
rename from html/Callbacks/TodoList/Admin/CustomFields/Modify.html/Initial
rename to html/Callbacks/RT-Extension-TodoList/Admin/CustomFields/Modify.html/Initial
index ad7aa74..50b656e 100644
--- a/html/Callbacks/TodoList/Admin/CustomFields/Modify.html/Initial
+++ b/html/Callbacks/RT-Extension-TodoList/Admin/CustomFields/Modify.html/Initial
@@ -22,7 +22,6 @@ if ( $ARGSRef->{'TodoListCustomField'} ) {
     ($ret, $msg) = $CustomFieldObj->DeleteAttribute( 'TodoListCustomField' );
     push @{$Results}, $CustomFieldObj->Name . " is no longer a todo list custom field" if $ret;
 }
-RT::Logger->error($msg) unless $ret;
 </%init>
 <%args>
 $ARGSRef
diff --git a/html/Callbacks/TodoList/Elements/EditCustomFields/MassageCustomFields b/html/Callbacks/RT-Extension-TodoList/Elements/EditCustomFields/MassageCustomFields
similarity index 100%
rename from html/Callbacks/TodoList/Elements/EditCustomFields/MassageCustomFields
rename to html/Callbacks/RT-Extension-TodoList/Elements/EditCustomFields/MassageCustomFields
diff --git a/html/Callbacks/TodoList/Elements/ShowCustomFields/BeforeCustomFields b/html/Callbacks/RT-Extension-TodoList/Elements/ShowCustomFields/BeforeCustomFields
similarity index 100%
rename from html/Callbacks/TodoList/Elements/ShowCustomFields/BeforeCustomFields
rename to html/Callbacks/RT-Extension-TodoList/Elements/ShowCustomFields/BeforeCustomFields
diff --git a/html/Callbacks/TodoList/Ticket/Elements/ShowSummary/AfterPeople b/html/Callbacks/RT-Extension-TodoList/Ticket/Elements/ShowSummary/AfterPeople
similarity index 100%
rename from html/Callbacks/TodoList/Ticket/Elements/ShowSummary/AfterPeople
rename to html/Callbacks/RT-Extension-TodoList/Ticket/Elements/ShowSummary/AfterPeople
diff --git a/html/Elements/TodoList b/html/Elements/TodoList
index 57267fa..f9f8ae8 100644
--- a/html/Elements/TodoList
+++ b/html/Elements/TodoList
@@ -1,22 +1,27 @@
 <&|/Widgets/TitleBox, title => loc("Todo List"), class => 'ticket-info-basics', &>
-    <select id="RT-TodoList-Select" onchange="UpdateTodoList(<%$Object->Id%>)">
-        <option value="" <% !$default && qq[ selected="selected"] |n %>><&|/l&>(no value)</&></option>
+    <div id="todo-list-container">
+      <div class="todo-list-container">
+        <select id="RT-TodoList-Select" onchange="UpdateTodoList(<%$Object->Id%>)">
+          <option value="" <% !$default && qq[ selected="selected"] |n %>><&|/l&>(no value)</&></option>
 % while ( my $cf = $custom_fields->Next ) {
 %       $default_cf = $cf if defined $default && $cf->Id eq $default;
-        <option name="<%$cf->Name%>" value=<% $cf->Id %> <% defined $default && $default eq $cf->Id ? 'selected="selected"': '' %>>
+          <option name="<%$cf->Name%>" value=<% $cf->Id %> <% defined $default && $default eq $cf->Id ? 'selected="selected"': '' %>>
             <% $cf->Name %>
-        </option>
+          </option>
 % }
-    </select>
-<div>
-    <form id="RT-TodoList" onchange="UpdateTodos()">
+      </select>
+    </div>
+    <div class="todo-list-container">
+      <form id="RT-TodoList" onchange="UpdateTodos()">
 %    if ( $default_cf ) {
         <& /Elements/EditCustomField,
-            CustomField => $default_cf,
-            Object      => $Object
+          CustomField => $default_cf,
+          Object      => $Object
         &>
 %    }
-    </form>
+      </form>
+    </div>
+  <div>
 </div>
 </&>
 
diff --git a/lib/RT/Extension/TodoList.pm b/lib/RT/Extension/TodoList.pm
index c1d0388..bd4ca06 100644
--- a/lib/RT/Extension/TodoList.pm
+++ b/lib/RT/Extension/TodoList.pm
@@ -80,10 +80,10 @@ sub UpdateTodoListCustomField {
 
             if ( $args{$key} =~ /RT-TodoList-Remove-(.+)/) {
                 ($ret, $msg) = $object->DeleteCustomFieldValue(Field => $cf_id, Value => $1);
-                RT::Logger->error("could remove value for custom field:  $cf_id :  $msg") unless $ret;
+                RT::Logger->error("could not remove value for custom field:  $cf_id :  $msg") unless $ret;
             } else {
                 ($ret, $msg) = $object->AddCustomFieldValue(Field => $cf_id, Value => $args{$key});
-                RT::Logger->error("could add value for custom field:  $cf_id :  $msg") unless $ret;
+                RT::Logger->error("could not add value for custom field:  $cf_id :  $msg") unless $ret;
             }
         }
     }
@@ -97,26 +97,22 @@ RT-Extension-TodoList
 
 Add todo lists to tickets. Often a ticket will define a task that requires several repeatable steps.
 For example:
-    Deploy new server
-        - Order server
-        - Find rack space
-        - Confirm power
-        - Run networking
-        - Assign IPs
-        - Autoload base OS
-Those steps may need to be repeated each time a new server is set up. One approach would be to create
-a linked depends-on or child ticket for each one. However, they may be always done by the same
-person (the ticket Owner) and may not other ticket details tracked separately. This feature will also
-be useful in RTIR where different incident types can display a different to do list, one for Malware,
-one for DDos, one for Phising Email, etc.
 
-To make a custom field a todo list custom field, create a new custom field of type "select multiple values".
-Once created there will be a checkbox option to make the custom field a todo list custom field, then you
-can apply the custom field by queue per usual.
+    'Deploy new server' = (
+        Order server,
+        Find rack space,
+        Confirm power,
+        Run networking,
+        Assign IPs,
+        Autoload base OS
+    );
 
-=head1 RT VERSION
+Where the steps listed above will generally always be the same for the task of deploying a new server
+rack. This extension make tracking these tasks from one ticket simple by adding a todo list that can be
+used repeatedly on any ticket created for the queue.
 
-Works with RT 4.4
+=head1 RT VERSION
+    Works with RT 4.4
 
 =head1 INSTALLATION
 
@@ -144,6 +140,17 @@ Add this line:
 
 =back
 
+=head1 CONFIGURATION
+
+To make a custom field a todo list custom field, create a new custom field of type "select multiple values".
+Once created there will be a checkbox option to make the custom field a todo list custom field, then you
+can apply the custom field by queue per usual.
+
+Each item in the list will be a todo list checkbox item and each custom field applied to the queue as a todo
+list custom field will be available to load as the tickets todo's.
+
+=cut
+
 =head1 AUTHOR
 
 Best Practical Solutions, LLC E<lt>modules at bestpractical.comE<gt>
diff --git a/static/js/TodoList.js b/static/js/rt-extension-todolist.js
similarity index 100%
rename from static/js/TodoList.js
rename to static/js/rt-extension-todolist.js

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


More information about the Bps-public-commit mailing list