ticket system integration framework and skin RT
authorivan <ivan>
Sat, 27 Nov 2004 19:09:47 +0000 (19:09 +0000)
committerivan <ivan>
Sat, 27 Nov 2004 19:09:47 +0000 (19:09 +0000)
18 files changed:
ANNOUNCE.1.5.0
FS/FS.pm
FS/FS/Conf.pm
FS/FS/TicketSystem/RT_External.pm [new file with mode: 0644]
FS/FS/TicketSystem/RT_Internal.pm [new file with mode: 0644]
FS/FS/TicketSystem/RT_Libs.pm [new file with mode: 0644]
Makefile
htetc/global.asa
htetc/handler.pl
httemplate/index.html
rt/FREESIDE_MODIFIED
rt/html/Elements/Footer
rt/html/Elements/Header
rt/html/Elements/PageLayout
rt/html/Elements/SimpleSearch
rt/html/Elements/Tabs
rt/html/NoAuth/images/small-logo.png [new file with mode: 0644]
rt/html/NoAuth/webrt.css

index 692ffbc..b3c81a9 100644 (file)
@@ -23,4 +23,5 @@
 - update install documentation for 1.5 HTML::Mason or Apache::ASP install
 # - historical late notice viewing in web interface
 - VoIP billing for CDRs from RADIUS
-# - promotional codes for signup
+- promotional codes for signup
+- lots of RT integration
index 797323f..3bbd66f 100644 (file)
--- a/FS/FS.pm
+++ b/FS/FS.pm
@@ -3,7 +3,7 @@ package FS;
 use strict;
 use vars qw($VERSION);
 
-$VERSION = '0.01';
+$VERSION = '%%%VERSION%%%';
 
 #find missing entries in this file with:
 # for a in `ls *pm | cut -d. -f1`; do grep 'L<FS::'$a'>' ../FS.pm >/dev/null || echo "missing $a" ; done
index f15b485..ccad607 100644 (file)
@@ -1320,6 +1320,14 @@ httemplate/docs/config.html
     'select_enum' => [ 'generic', 'artera_turbo', ],
   },
 
+  {
+    'key'         => 'ticket_system',
+    'section'     => '',
+    'description' => 'Ticketing system integraiton.  <b>RT_Internal</b> uses the built-in RT ticketing system (use <code>make create-rt</code> to create the necessary tables).  <b>RT_Libs</b> uses the built-in RT libraries to access an RT installation in a separate database (local or remote).  <b>RT_External</b> uses RT\'s XML interface and RTx::Atom to access an RT installation in a separate database (local or remote).',
+    'type'        => 'select',
+    'select_enum' => [ '', qw(RT_Internal RT_Libs RT_External) ],
+  },
+
 );
 
 1;
diff --git a/FS/FS/TicketSystem/RT_External.pm b/FS/FS/TicketSystem/RT_External.pm
new file mode 100644 (file)
index 0000000..b74740c
--- /dev/null
@@ -0,0 +1,6 @@
+package FS::TicketSystem::RT_External;
+
+use strict;
+
+1;
+
diff --git a/FS/FS/TicketSystem/RT_Internal.pm b/FS/FS/TicketSystem/RT_Internal.pm
new file mode 100644 (file)
index 0000000..a4ecd6a
--- /dev/null
@@ -0,0 +1,8 @@
+package FS::TicketSystem::RT_Internal;
+
+use strict;
+
+@ISA = qw( FS::TicketSystem::RT_Libs );
+
+1;
+
diff --git a/FS/FS/TicketSystem/RT_Libs.pm b/FS/FS/TicketSystem/RT_Libs.pm
new file mode 100644 (file)
index 0000000..b717632
--- /dev/null
@@ -0,0 +1,8 @@
+package FS::TicketSystem::RT_Libs.pm
+
+use strict;
+
+@ISA = qw( FS::TicketSystem::RT_External );
+
+1;
+
index c339477..b23ee93 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -102,9 +102,6 @@ help:
 aspdocs: htmlman httemplate/* httemplate/*/* httemplate/*/*/* httemplate/*/*/*/* httemplate/*/*/*/*/*
        rm -rf aspdocs
        cp -pr httemplate aspdocs
-       perl -p -i -e "\
-         s/%%%VERSION%%%/${VERSION}/g;\
-       " aspdocs/index.html
        touch aspdocs
 
 
@@ -114,9 +111,6 @@ masondocs: htmlman httemplate/* httemplate/*/* httemplate/*/*/* httemplate/*/*/*
        ( cd masondocs; \
          ../bin/masonize; \
        )
-       perl -p -i -e "\
-         s/%%%VERSION%%%/${VERSION}/g;\
-       " masondocs/index.html
        touch masondocs
 
 alldocs: aspdocs masondocs
@@ -163,7 +157,10 @@ install-docs: docs
 perl-modules:
        cd FS; \
        [ -e Makefile ] || perl Makefile.PL; \
-       make
+       make; \
+       perl -p -i -e "\
+         s/%%%VERSION%%%/${VERSION}/g;\
+       " blib/lib/FS.pm
 
 install-perl-modules: perl-modules
        cd FS; \
index 146310d..5cfcca6 100644 (file)
@@ -23,6 +23,7 @@ use Business::CreditCard;
 use String::Approx qw(amatch);
 use Chart::LinesPoints;
 use HTML::Widgets::SelectLayers 0.03;
+use FS;
 use FS::UID qw(cgisuidsetup dbh getotaker datasrc driver_name);
 use FS::Record qw(qsearch qsearchs fields dbdef);
 use FS::Conf;
index 81c9836..a17aff1 100644 (file)
@@ -106,6 +106,7 @@ sub handler
       use String::Approx qw(amatch);
       use Chart::LinesPoints;
       use HTML::Widgets::SelectLayers 0.03;
+      use FS;
       use FS::UID qw(cgisuidsetup dbh getotaker datasrc driver_name);
       use FS::Record qw(qsearch qsearchs fields dbdef);
       use FS::Conf;
index 5189df9..6283c22 100644 (file)
@@ -1,3 +1,5 @@
+<!-- mason kludge -->
+<% my $conf = new FS::Conf; %>
 <HTML>
   <HEAD>
     <TITLE>
@@ -6,22 +8,57 @@
   </HEAD>
   <BODY BGCOLOR="#FFFFFF">
   <table width="100%">
-    <tr><td>
+    <tr>
+      <td rowspan=2>
         <IMG BORDER=0 ALT="freeside" SRC="images/small-logo.png">
-    </td><td valign="top">
-      <font color="#7f007b" size=7></font>
-    </td><td align=right valign=bottom>
-       version %%%VERSION%%%
-      <BR><A HREF="http://www.sisd.com/freeside">Freeside&nbsp;home&nbsp;page</A>
-      <BR><A HREF="docs/">Documentation</A>
-    </td></tr>
+      </td>
+      <td align=left rowspan=2> <!-- valign="top" -->
+        <font size=7>Billing</font>
+      </td>
+      <td align=right valign=top>Logged in as <b><%= getotaker %></b>
+      </td>
+    </tr>
+    <tr>
+      <td align=right valign=bottom>
+
+        <table>
+          <tr>
+            <td align=right>
+              <FONT SIZE="-2">
+               Freeside <%= $FS::VERSION %><BR>
+               <A HREF="http://www.sisd.com/freeside">Freeside&nbsp;home&nbsp;page</A><BR>
+               <A HREF="docs/">Documentation</A><BR>
+              </FONT>
+            </td>
+            <% if ( $conf->config('ticket_system') eq 'RT_Internal' ) { %>
+            <% eval "use RT;"; %>
+              <td bgcolor=#000000></td>
+              <td align=left>
+                <FONT SIZE="-2">
+                 RT <%= $RT::VERSION %><BR>
+                 <A HREF="http://www.bestpractical.com/rt">RT&nbsp;home&nbsp;page</A><BR>
+                 <A HREF="http://wiki.bestpractical.com/">Documentation</A><BR>
+                </FONT>
+              </td>
+            <% } %>
+
+          </tr>
+        </table>
+
+      </td>
+    </tr>
   </table>
 
-<BR>
-[<A NAME="customer_service" style="background-color: #cccccc"> Sales / Customer service </A>]
-[ <A HREF="#bookkeeping">Bookkeeping / Collections</A> ]
-[ <A HREF="#reports">Reports</A> ]
-[ <A HREF="#sysadmin">Sysadmin</A> ]
+  <BR>
+
+
+[<A NAME="customer_service" style="background-color: #cccccc">&nbsp;Sales&nbsp;/&nbsp;Customer&nbsp;service&nbsp;</A>]
+<% if ( $conf->config('ticket_system') ) { %>
+  [&nbsp;<A HREF="#ticketing">Support&nbsp;/&nbsp;Ticketing</A>&nbsp;]
+<% } %>
+[&nbsp;<A HREF="#bookkeeping">Bookkeeping&nbsp;/&nbsp;Collections</A>&nbsp;]
+[&nbsp;<A HREF="#reports">Reports</A>&nbsp;]
+[&nbsp;<A HREF="#sysadmin">Sysadmin</A>&nbsp;]
     <TABLE CELLSPACING=2 CELLPADDING=0 BORDER=0" WIDTH="100%" BGCOLOR="#eeeeee">
     <TR><TH BGCOLOR="#cccccc">Sales / Customer service</TH></TR>
     <TR><TD>
     </TD></TR>
     </TABLE>
 
+    <BR><BR><BR>
 
+<% if ( $conf->config('ticket_system') ) { %>
+
+[&nbsp;<A HREF="#customer_service">Sales&nbsp;/&nbsp;Customer&nbsp;service</A>&nbsp;]
+[<A NAME="ticketing" style="background-color: #cccccc">&nbsp;Support&nbsp;/&nbsp;Ticketing&nbsp;</A>]
+[&nbsp;<A HREF="#bookkeeping">Bookkeeping&nbsp;/&nbsp;Collections</A>&nbsp;]
+[&nbsp;<A HREF="#reports">Reports</A>&nbsp;]
+[&nbsp;<A HREF="#sysadmin">Sysadmin</A>&nbsp;]
+    <TABLE CELLSPACING=2 CELLPADDING=0 BORDER=0" WIDTH="100%" BGCOLOR="#eeeeee">
+    <TR><TH BGCOLOR="#cccccc">Support/Ticketing</TH></TR>
+    <TR><TD>
+        <BR><FONT SIZE="+1"><A HREF="rt/">Ticketing Main</A></FONT>
+        <BR>
+    </TD></TR>
+    </TABLE>
 
     <BR><BR><BR>
 
+<% } %>
+
 
-[ <A HREF="#customer_service">Sales / Customer service</A> ]
-[<A NAME="bookkeeping" style="background-color: #cccccc"> Bookkeeping / Collections </A>]
-[ <A HREF="#reports">Reports</A> ]
-[ <A HREF="#sysadmin">Sysadmin</A> ]
+[&nbsp;<A HREF="#customer_service">Sales&nbsp;/&nbsp;Customer&nbsp;service</A>&nbsp;]
+<% if ( $conf->config('ticket_system') ) { %>
+  [&nbsp;<A HREF="#ticketing">Support&nbsp;/&nbsp;Ticketing</A>&nbsp;]
+<% } %>
+[<A NAME="bookkeeping" style="background-color: #cccccc">&nbsp;Bookkeeping&nbsp;/&nbsp;Collections&nbsp;</A>]
+[&nbsp;<A HREF="#reports">Reports</A>&nbsp;]
+[&nbsp;<A HREF="#sysadmin">Sysadmin</A>&nbsp;]
     <TABLE CELLSPACING=2 CELLPADDING=0 BORDER=0 WIDTH="100%" BGCOLOR="#eeeeee">
     <TR><TH BGCOLOR="#cccccc">Bookkeeping / Collections</TH></TR>
     <TR><TD>
 
 
 
-[ <A HREF="#customer_service">Sales / Customer service</A> ]
-[ <A HREF="#bookkeeping">Bookkeeping / Collections</A> ]
-[<A NAME="reports" style="background-color: #cccccc"> Reports </A>]
-[ <A HREF="#sysadmin">Sysadmin</A> ]
+[&nbsp;<A HREF="#customer_service">Sales&nbsp;/&nbsp;Customer&nbsp;service</A>&nbsp;]
+<% if ( $conf->config('ticket_system') ) { %>
+  [&nbsp;<A HREF="#ticketing">Support&nbsp;/&nbsp;Ticketing</A>&nbsp;]
+<% } %>
+[&nbsp;<A HREF="#bookkeeping">Bookkeeping&nbsp;/&nbsp;Collections</A>&nbsp;]
+[<A NAME="reports" style="background-color: #cccccc">&nbsp;Reports&nbsp;</A>]
+[&nbsp;<A HREF="#sysadmin">Sysadmin</A>&nbsp;]
     <TABLE CELLSPACING=2 CELLPADDING=0 BORDER=0 WIDTH="100%" BGCOLOR="#eeeeee">
     <TR><TH BGCOLOR="#cccccc">Reports</TH></TR>
     <TR><TD>
     <BR><BR><BR>
 
 
-[ <A HREF="#customer_service">Sales / Customer service</A> ]
-[ <A HREF="#bookkeeping">Bookkeeping / Collections</A> ]
-[ <A HREF="#reports">Reports</A> ]
-[<A NAME="sysadmin" style="background-color: #cccccc"> Sysadmin </A>]
+[&nbsp;<A HREF="#customer_service">Sales&nbsp;/&nbsp;Customer&nbsp;service</A>&nbsp;]
+<% if ( $conf->config('ticket_system') ) { %>
+  [&nbsp;<A HREF="#ticketing">Support&nbsp;/&nbsp;Ticketing</A>&nbsp;]
+<% } %>
+[&nbsp;<A HREF="#bookkeeping">Bookkeeping&nbsp;/&nbsp;Collections</A>&nbsp;]
+[&nbsp;<A HREF="#reports">Reports</A>&nbsp;]
+[<A NAME="sysadmin" style="background-color: #cccccc">&nbsp;Sysadmin&nbsp;</A>]
     <TABLE CELLSPACING=2 CELLPADDING=0 BORDER=0 WIDTH="100%" BGCOLOR="#eeeeee">
     <TR><TH BGCOLOR="#cccccc">Sysadmin</TH></TR>
     <TR><TD>
index 3937c30..1f3f55c 100644 (file)
@@ -4,3 +4,10 @@ config.layout
 config.layout.in
 etc/RT_SiteConfig.pm
 lib/RT/URI/freeside.pm
+html/Elements/Header
+html/Elements/PageLayout
+html/Elements/SimpleSearch
+html/Elements/Tabs
+html/Elements/Footer
+html/NoAuth/images/small-logo.png
+html/NoAuth/webrt.css
index 5c833f8..052bf87 100644 (file)
 <td>
 % }
 <& /Elements/Callback, %ARGS &>
+<!--
 <div class="bpscredits">
 &#187;&#124;&#171; <&|/l, $RT::VERSION &>RT [_1] from <a href="http://bestpractical.com">Best Practical Solutions, LLC</a>.</&>
 </div>
+-->
 % if ($Debug) {
 <HR>
 <b><&|/l&>Time to display</&>: <%Time::HiRes::tv_interval( $m->{'rt_base_time'} )%></b>
index 23ab5f7..92c186b 100644 (file)
@@ -42,10 +42,9 @@ ONLOAD="
 >
 <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
   <tr> 
-    <td colspan=2><a href="http://bestpractical.com"><img src="<%$RT::WebImagesURL%>/bplogo.gif" alt="" width="230" height="50"></a></td>
-    <td>&nbsp;</td>
-    <td>&nbsp;</td>
-    <td width="50%" align="right">
+    <td rowspan=2><img border=0 alt="freeside" src="<%$RT::WebImagesURL%>/small-logo.png" width="92" height="62"></td>
+    <td align="left" rowspan=2><font size=7>Ticketing</font></td>
+    <td align="right" valign="top">
 % if ($session{'CurrentUser'} && $session{'CurrentUser'}->Id && $LoggedIn) {
 <SPAN STYLE="display: none"><A HREF="#skipnav"><&|/l&>Skip Menu</&></A> |</SPAN>
 <A  HREF="<%$RT::WebPath%><% $Prefs %>" ><&|/l&>Preferences</&></A>
@@ -59,6 +58,33 @@ ONLOAD="
 <&|/l&>Not logged in.</&>
 % }
     </td>
+
+  </tr>
+  <tr>
+
+    <td align=right valign=bottom>
+      <table>
+        <tr>
+          <td align=right>
+            <FONT SIZE="-3">
+             Freeside <% $FS::VERSION %><BR>
+             <A HREF="http://www.sisd.com/freeside">Freeside&nbsp;home&nbsp;page</A><BR>
+             <A HREF="docs/">Documentation</A><BR>
+            </FONT>
+          </td>
+          <td bgcolor=#000000></td>
+          <td align=left>
+            <FONT SIZE="-3">
+             RT <% $RT::VERSION %><BR>
+             <A HREF="http://www.bestpractical.com/rt">RT&nbsp;home&nbsp;page</A><BR>
+             <A HREF="http://wiki.bestpractical.com/">Documentation</A><BR>
+            </FONT>
+          </td>
+
+        </tr>
+      </table>
+    </td>
+
   </tr>
 </table>
 <%INIT>
index 6853175..86b6b56 100644 (file)
 %# 
 %# 
 %# END LICENSE BLOCK
-<table class="darkblue" border=0 cellspacing=0 cellpadding=0 width="100%">
-  <th class="titlebox" align="left"><span class="rtname"><%$AppName%></span>
+<table class="lightgray" border=0 cellspacing=0 cellpadding=0 width="100%">
+  <th class="lightgray" align="left" width=50%><span class="rtname"><%$AppName%></span>
   </th>
       <span class="topactions">
 % foreach my $action (sort keys %{$topactions}) {
-        <td class="darkblueright">
+        <td class="lightgrayright">
         <%$topactions->{"$action"}->{'html'} |n %>
         </td>
 % }
 <table border=0 cellspacing=0 cellpadding=0 width="100%" height="100%">
 %# Vertical menu
 <TR height="100%">
-<TD valign="top" width="140" class="blue">
+<TD valign="top" width="140" class="lightgray">
           <& /Elements/Menu, toptabs => $toptabs, current_toptab => $current_toptab &>
 </TD>
 <td valign="top">
 <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
 <tr>
-  <td class="blue" valign="top">
+  <td class="mediumgray" valign="top">
     <span class="title"><%$title%></span>
 </td>
 </tr>
 <tr>
-<td class="blueright" valign="top">
+<td class="whiteright" valign="top">
     <span class="nav"> 
 % if ($actions) {
 % my @actions;
@@ -57,7 +57,8 @@
 % push @actions,  "<A class='nav' HREF=\"".$RT::WebPath."/".$actions->{$action}->{'path'}."\">".$actions->{$action}->{'title'}."</A>";
 % }
 %  }
-<% join(" | ", @actions) | n %>
+%#<% join(" | ", @actions) | n %>
+<% '['. join("] [", @actions). ']' | n %>
 % if ($subactions) {
 % my @actions;
 % foreach my $action (sort keys %{$subactions}) {
@@ -95,5 +96,5 @@ $tabs => undef
 $actions => undef
 $subactions => undef
 $title => $m->callers(-1)->path
-$AppName => undef
+$AppName => ''
 </%ARGS>
index 4a0d106..85f3740 100644 (file)
@@ -23,5 +23,5 @@
 %# END LICENSE BLOCK
 <form action="<% $RT::WebPath %>/index.html">
 <input size="12" name="q" autocomplete="off" accesskey="0">
-<input type="submit" value="<&|/l&>Search</&>">&nbsp;
+<input type="submit" value="<&|/l&>Search tickets</&>">&nbsp;
 </form>
index 4db3849..6791e50 100644 (file)
@@ -40,7 +40,12 @@ my $basetopactions = {
        B => { html => $m->scomp('/Elements/SimpleSearch') 
                }
        };
-my $basetabs = {     A => { title => loc('Homepage'),
+my $basetabs = {
+                  ' A'=> { title => 'Billing Main',
+                           path  => '..',
+                         },
+                    A => { #title => loc('Homepage'),
+                           title => 'Ticketing Main',
                            path => '',
                          },
                     B => { title => loc('Tickets'),
diff --git a/rt/html/NoAuth/images/small-logo.png b/rt/html/NoAuth/images/small-logo.png
new file mode 100644 (file)
index 0000000..1e415e6
Binary files /dev/null and b/rt/html/NoAuth/images/small-logo.png differ
index 159e79c..3e8e3f9 100644 (file)
 %# END LICENSE BLOCK
 SPAN.nav {  font-family: Verdana, Arial, Helvetica, sans-serif;
         font-size: 12px;
-        color: #FFFFFF;
+%#      color: #FFFFFF;
+        color: #000000;
         text-decoration: none;
         white-space: nowrap}
 .nav2 {         font-size: 10px;
         white-space: nowrap}
 .nav {  font-family: Verdana, Arial, Helvetica, sans-serif;
         font-size: 13px;
-        font-weight: normal;
-        color: #FFFFFF;
+%#      font-weight: normal;
+        font-weight: bold;
+%#      color: #FFFFFF;
+        color: #000000;
         text-decoration: none;
         white-space: nowrap}
 .currentnav {  font-family: Verdana, Arial, Helvetica, sans-serif;
@@ -43,13 +46,15 @@ SPAN.nav {  font-family: Verdana, Arial, Helvetica, sans-serif;
 .topnav {  font-family: Verdana, Arial, Helvetica, sans-serif;
         font-size: 16px;
         font-weight: normal;
-        color: #FFFFFF;
+%#      color: #FFFFFF;
+        color: #000000;
         text-decoration: none;
         white-space: nowrap}
 .currenttopnav {  font-family: Verdana, Arial, Helvetica, sans-serif;
         font-size: 16px;
          font-weight: bold;
-        color: #FFFF66;
+%#      color: #FFFF66;
+        color: #000000; background-color: #cccccc;
         text-decoration: none;
         white-space: nowrap}
 .topactions {  font-family: Verdana, Arial, Helvetica, sans-serif;
@@ -79,12 +84,16 @@ SPAN.nav {  font-family: Verdana, Arial, Helvetica, sans-serif;
         vertical-align: top;
         text-align: left;
          }
-.blue {  background-color: #4682B4;
+.blue {
+        background-color: #4682B4;
+%#      background-color: #eeeeee;
         background-position: left top;
         vertical-align: top;
         text-align: left;
          }
-.blueright {  background-color: #4682B4;
+.blueright {
+        background-color: #4682B4;
+%#      background-color: #eeeeee;
         background-position: left top;
         vertical-align: top;
         text-align: right;
@@ -94,12 +103,50 @@ SPAN.nav {  font-family: Verdana, Arial, Helvetica, sans-serif;
         vertical-align: top;
         text-align: left;
          }
-.darkblue {  background-color: #000080;
+.darkblue {
+        background-color: #000080;
+        background-position: left top;
+        vertical-align: top;
+        text-align: left;
+         }
+.darkblueright { 
+        background-color: #000080;
+        background-position: left top;
+        vertical-align: top;
+        text-align: right;
+         }
+.lightgray {
+        background-color: #eeeeee;
+        background-position: left top;
+        vertical-align: top;
+        text-align: left;
+         }
+.lightgrayright { 
+        background-color: #eeeeee;
+        background-position: left top;
+        vertical-align: top;
+        text-align: right;
+         }
+.mediumgray {
+        background-color: #cccccc;
+        background-position: left top;
+        vertical-align: top;
+        text-align: left;
+         }
+.mediumgrayright { 
+        background-color: #cccccc;
+        background-position: left top;
+        vertical-align: top;
+        text-align: right;
+         }
+.white {
+        background-color: #ffffff;
         background-position: left top;
         vertical-align: top;
         text-align: left;
          }
-.darkblueright {  background-color: #000080;
+.whiteright { 
+        background-color: #ffffff;
         background-position: left top;
         vertical-align: top;
         text-align: right;
@@ -266,7 +313,9 @@ SPAN.date { font-size: 0.8em }
 
 span.title { font-size: 1.6em;
             vertical-align: middle;
-             color: #ffffff;}
+%#          color: #ffffff;
+             color: #000000;
+           }
 span.productname { font-size: 2em;
              color: #0066cc;}
 SPAN.titleboxtitle {