port skinning, customer display/edit from RT 3.6 integration to RT 3.8 integration
authorivan <ivan>
Sun, 3 Jan 2010 08:07:15 +0000 (08:07 +0000)
committerivan <ivan>
Sun, 3 Jan 2010 08:07:15 +0000 (08:07 +0000)
19 files changed:
rt/FREESIDE_MODIFIED
rt/html/Elements/AddCustomers [deleted file]
rt/html/Elements/EditCustomers [deleted file]
rt/html/Elements/FreesideInvoiceSearch [deleted file]
rt/html/Elements/FreesideNewCust [deleted file]
rt/html/Elements/FreesideSearch [deleted file]
rt/html/Elements/FreesideSvcSearch [deleted file]
rt/html/Ticket/ModifyCustomers.html [deleted file]
rt/share/html/Admin/Users/Modify.html
rt/share/html/Elements/AddCustomers [new file with mode: 0644]
rt/share/html/Elements/EditCustomers [new file with mode: 0644]
rt/share/html/Ticket/Display.html
rt/share/html/Ticket/Elements/AddCustomers [new file with mode: 0644]
rt/share/html/Ticket/Elements/EditCustomers [new file with mode: 0644]
rt/share/html/Ticket/Elements/ShowCustomers [new file with mode: 0644]
rt/share/html/Ticket/Elements/ShowSummary
rt/share/html/Ticket/Elements/ShowTransactionAttachments
rt/share/html/Ticket/Elements/Tabs
rt/share/html/Ticket/ModifyCustomers.html [new file with mode: 0644]

index a4d552c..e1665ab 100644 (file)
@@ -12,7 +12,7 @@ lib/RT/Transaction_Overlay.pm
 lib/RT/URI/freeside.pm
 lib/RT/URI/freeside/Internal.pm
 lib/RT/URI/freeside/XMLRPC.pm
- html/Admin/Users/Modify.html
share/html/Admin/Users/Modify.html
  html/Elements/Header
  html/Elements/Menu
  html/Elements/PageLayout
@@ -23,13 +23,14 @@ lib/RT/URI/freeside/XMLRPC.pm
  html/Elements/Footer
  html/Elements/CollectionAsTable/Row #backport from 3.3-TESTING
  html/Ticket/Create.html
- html/Ticket/Display.html
-html/Ticket/Elements/AddCustomers
-html/Ticket/Elements/EditCustomers
-html/Ticket/Elements/ShowCustomers
- html/Ticket/Elements/ShowSummary
- html/Ticket/Elements/Tabs
-html/Ticket/ModifyCustomers.html
+ share/html/Ticket/Display.html
+share/html/Ticket/Elements/AddCustomers
+share/html/Ticket/Elements/EditCustomers
+share/html/Ticket/Elements/ShowCustomers
+ share/html/Ticket/Elements/ShowSummary
+ share/html/Ticket/Elements/ShowTransactionAttachments
+ share/html/Ticket/Elements/Tabs
+share/html/Ticket/ModifyCustomers.html
 html/NoAuth/images/small-logo.png
  html/NoAuth/css/3.5-default/main.css
  html/NoAuth/css/3.5-default/misc.css
@@ -38,11 +39,8 @@ html/NoAuth/css/3.5-default/freeside.css
 
 html/Widgets/TitleBoxStart
 
-html/Elements/FreesideNewCust
-html/Elements/FreesideSearch
-html/Elements/FreesideSvcSearch
-html/Elements/AddCustomers
-html/Elements/EditCustomers
+share/html/Elements/AddCustomers
+share/html/Elements/EditCustomers
 
  html/User/Prefs.html
  html/Prefs/SearchOptions.html
diff --git a/rt/html/Elements/AddCustomers b/rt/html/Elements/AddCustomers
deleted file mode 100644 (file)
index aaf8ca8..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-%# Copyright (c) 2004 Ivan Kohler <ivan-rt@420.am>
-%# Copyright (c) 2008 Freeside Internet Services, Inc.
-%# 
-%# 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.
-<BR>
-<%$msg%><br>
-
-% if (@Customers) {
-
-<br><i>(Check box to link)<i>
-<table>
-% foreach my $customer (@Customers) {
-<tr>
-  <td>
-    <input type="checkbox" name="Object-AddCustomer-<% $customer->{'custnum'} %>" VALUE="1" <% scalar(@Customers) == 1 ? 'CHECKED' : '' %>>
-    <A HREF="<%$freeside_url%>/view/cust_main.cgi?<% $customer->{'custnum'} %>"><% &RT::URI::freeside::small_custview($customer->{'custnum'}, &RT::URI::freeside::FreesideGetConfig('countrydefault'), 1) |n %>
-  </td>
-</tr>
-% }
-</table>
-
-% }
-
-<%INIT>
-my ($msg);
-
-my $freeside_url = &RT::URI::freeside::FreesideURL();
-
-warn "/Elements/AddCustomers called with CustomerString $CustomerString\n"
-  if $Debug;
-
-my @Customers = ();
-if ( $CustomerString ) {
-    @Customers = &RT::URI::freeside::smart_search( 'search' => $CustomerString );
-}
-
-my @Services = ();
-if ($ServiceString) {
-    @Services = (); #service_search();
-}
-
-warn "/Elements/AddCustomers displaying ". scalar(@Customers). " customers\n"
-  if $Debug;
-
-</%INIT>
-
-<%ARGS>
-$CustomerString => undef
-$ServiceString => undef
-$Debug => 0
-</%ARGS>
diff --git a/rt/html/Elements/EditCustomers b/rt/html/Elements/EditCustomers
deleted file mode 100644 (file)
index 68efb5f..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-%# Copyright (c) 2004 Ivan Kohler <ivan-rt@420.am>
-%# Copyright (c) 2008 Freeside Internet Services, Inc.
-%# 
-%# 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.
-<TABLE width=100%>
-  <TR>
-    <TD VALIGN=TOP WIDTH=50%>
-      <h3><&|/l&>Current Customers</&></h3>
-
-<table>
-  <tr>
-    <td><i><&|/l&>(Check box to disassociate)</&></i></td>
-  </tr>
-  <tr>
-    <td class="value">
-% foreach my $link ( @{ $Object->Customers->ItemsArrayRef } ) {
-
-      <INPUT TYPE=CHECKBOX NAME="DeleteLink--<%$link->Type%>-<%$link->Target%>">
-%#        <& ShowLink, URI => $link->TargetURI &><br>
-        <A HREF="<% $link->TargetURI->Resolver->HREF %>"><% $link->TargetURI->Resolver->AsStringLong |n %></A>
-      <BR>
-% }
-    </td>
-  </tr>
-</table>
-                           
-</TD>
-
-<TD VALIGN=TOP>
-<h3><&|/l&>New Customer Links</&></h3>
-<&|/l&>Find customer</&><BR>
-<input name="CustomerString">
-<input type=submit name="OnlySearchForCustomers" value="<&|/l&>Go!</&>">
-<br><i>cust #, name, company or phone</i>
-<BR>
-%#<BR>
-%#<&|/l&>Find service</&><BR>
-%#<input name="ServiceString">
-%#<input type=submit name="OnlySearchForServices" value="<&|/l&>Go!</&>">
-%#<br><i>username, username@domain, domain, or IP address</i>
-%#<BR>
-
-<& AddCustomers, Object         => $Object,
-                 CustomerString => $CustomerString,
-                 ServiceString  => $ServiceString,  &>
-
-</TD>
-</TR>
-</TABLE>
-      
-<%ARGS>
-$CustomerString => undef
-$ServiceString => undef
-$Object => undef
-</%ARGS>
diff --git a/rt/html/Elements/FreesideInvoiceSearch b/rt/html/Elements/FreesideInvoiceSearch
deleted file mode 100644 (file)
index 3842b2f..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-% if ( $FS::CurrentUser::CurrentUser->access_right('View invoices') ) {
-
-  <form action="<% $RT::URI::freeside::URL %>/search/cust_bill.html" STYLE="margin:0">
-      <SCRIPT TYPE="text/javascript">
-        function clearhint_search_invoice (what) {
-          if ( what.value == '(inv #)' )
-            what.value = '';
-        }
-      </SCRIPT>
-  <input name="invnum" accesskey="0" VALUE="(inv #)" SIZE="4" onFocus="clearhint_search_invoice(this);" onClick="clearhint_search_invoice(this);" STYLE="text-align:right; margin-bottom:1px; font-family: Arial, Verdana, Helvetica, sans-serif;">
-  
-% if ( $FS::CurrentUser::CurrentUser->access_right('List invoices') ) {
-  <A HREF="<% $RT::URI::freeside::URL %>search/report_cust_bill.html" STYLE="color: #ffffff; font-size: 70%; font-weight:normal">Advanced</A>
-% } 
-  <BR>
-  
-  <input type="submit" value="<&|/l&>Search invoices</&>" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:70%">
-  </form>
-
-% }
diff --git a/rt/html/Elements/FreesideNewCust b/rt/html/Elements/FreesideNewCust
deleted file mode 100644 (file)
index f60e995..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-<form action="<% $RT::URI::freeside::URL %>/edit/cust_main.cgi" STYLE="margin:0">
-<INPUT TYPE="submit" VALUE="<&|/l&>New customer</&>" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="vertical-align:bottom; font-size:100%">&nbsp;
-</FORM>
diff --git a/rt/html/Elements/FreesideSearch b/rt/html/Elements/FreesideSearch
deleted file mode 100644 (file)
index 8e609bb..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-% if ( $FS::CurrentUser::CurrentUser->access_right('List customers') ) {
-<form action="<% $RT::URI::freeside::URL %>/search/cust_main.cgi" STYLE="margin:0">
-    <SCRIPT TYPE="text/javascript">
-      function clearhint_search_cust (what) {
-        if ( what.value == '(cust #, name, company or phone)' )
-          what.value = '';
-      }
-    </SCRIPT>
-<input name="search_cust" accesskey="0" VALUE="(cust #, name, company or phone)" SIZE="28" onFocus="clearhint_search_cust(this);" onClick="clearhint_search_cust(this);" STYLE="text-align:right; font-family: Arial, Verdana, Helvetica, sans-serif;"><BR>
-<A HREF="<% $RT::URI::freeside::URL %>/search/report_cust_main.html" STYLE="color: #ffffff; font-size: 70%; font-weight:normal">Advanced</A>
-<input type="submit" value="<&|/l&>Search customers</&>" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:70%">
-</form>
-% }
diff --git a/rt/html/Elements/FreesideSvcSearch b/rt/html/Elements/FreesideSvcSearch
deleted file mode 100644 (file)
index d68122d..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-% if ( $FS::CurrentUser::CurrentUser->access_right('View customer services') ) {
-<form action="<% $RT::URI::freeside::URL %>/search/cust_svc.html" STYLE="margin:0">
-    <SCRIPT TYPE="text/javascript">
-      function clearhint_search_svc (what) {
-        if ( what.value == '(user, user@domain or domain)' )
-          what.value = '';
-      }
-    </SCRIPT>
-<input name="search_svc" accesskey="0" VALUE="(user, user@domain or domain)" SIZE="26" onFocus="clearhint_search_svc(this);" onClick="clearhint_search_svc(this);" STYLE="text-align:right; font-family: Arial, Verdana, Helvetica, sans-serif;"><BR>
-            <A NOTYET="<% $RT::URI::freeside::URL %>search/svc_Smarter.html" STYLE="color: #000000; font-size: 70%; font-weight:normal">Advanced</A>
-<input type="submit" value="<&|/l&>Search services</&>" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:70%">
-</form>
-% }
diff --git a/rt/html/Ticket/ModifyCustomers.html b/rt/html/Ticket/ModifyCustomers.html
deleted file mode 100644 (file)
index 72d103b..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-%# Copyright (c) 2004 Ivan Kohler <ivan-rt@420.am>
-%#
-%# 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.
-<& /Elements/Header, Title => loc("Customers for ticket #[_1]", $Ticket->Id) &>
-<& /Ticket/Elements/Tabs, 
-    Ticket => $Ticket, 
-    current_tab => "Ticket/ModifyCustomers.html?id=".$Ticket->Id, 
-    Title => loc("Customers for ticket #[_1]", $Ticket->Id) &>
-
-<& /Elements/ListActions, actions => \@results &>
-
-<form action="ModifyCustomers.html" method="post">
-<input type="hidden" name="id" value="<%$Ticket->id%>">
-
-<& /Elements/TitleBoxStart, title => loc('Edit Customer Links'), color => "#7f007b"&>
-<& Elements/EditCustomers, Ticket => $Ticket, CustomerString => $CustomerString, ServiceString => $ServiceString &>
-<& /Elements/TitleBoxEnd &>
-<& /Elements/Submit, color => "#7f007b", Label => loc('Save Changes') &>
-</form>
-
-
-<%INIT>
-
-my @results = ();
-my $Ticket = LoadTicket($id);
-
-# if we're trying to search for customers/services and nothing else
-unless ( $OnlySearchForCustomers || $OnlySearchForServices) {
-   @results = ProcessTicketCustomers( TicketObj => $Ticket, ARGSRef => \%ARGS);
-}
-    
-</%INIT>
-
-
-<%ARGS>
-$OnlySearchForCustomers => undef
-$OnlySearchForServices => undef
-$CustomerString => undef
-$ServiceString => undef
-$id => undef
-</%ARGS>
index aae38b1..be67f35 100755 (executable)
 </table>
 </&>
 <br />
+
+<&| /Widgets/TitleBox, title => loc('Customers') &>
+<& /Elements/EditCustomers, Object => $UserObj, CustomerString=> $CustomerString, ServiceString => $ServiceString &>
+</&>
+<br />
+
 <&| /Widgets/TitleBox, title => loc('Access control') &>
 <input type="hidden" class="hidden" name="SetEnabled" value="1" />
 <input type="checkbox" class="checkbox" name="Enabled" value="1" <%$EnabledChecked%> />
@@ -345,6 +351,8 @@ if ($UserObj->Id && $id ne 'new') {
     push (@results,@fieldresults);
     push @results, ProcessObjectCustomFieldUpdates( ARGSRef => \%ARGS, Object => $UserObj );
 
+    #deal with freeside customer links
+    push @results, ProcessObjectCustomers( ARGSRef => \%ARGS, Object => $UserObj );
 
     # {{{ Deal with special fields: Privileged, Enabled
     if  ( $SetPrivileged and $Privileged != $UserObj->Privileged ) {
@@ -434,4 +442,8 @@ $Country => undef
 $Pass1 => undef
 $Pass2=> undef
 $Create=> undef
+$OnlySearchForCustomers => undef
+$OnlySearchForServices => undef
+$CustomerString => undef
+$ServiceString => undef
 </%ARGS>
diff --git a/rt/share/html/Elements/AddCustomers b/rt/share/html/Elements/AddCustomers
new file mode 100644 (file)
index 0000000..aaf8ca8
--- /dev/null
@@ -0,0 +1,59 @@
+%# Copyright (c) 2004 Ivan Kohler <ivan-rt@420.am>
+%# Copyright (c) 2008 Freeside Internet Services, Inc.
+%# 
+%# 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.
+<BR>
+<%$msg%><br>
+
+% if (@Customers) {
+
+<br><i>(Check box to link)<i>
+<table>
+% foreach my $customer (@Customers) {
+<tr>
+  <td>
+    <input type="checkbox" name="Object-AddCustomer-<% $customer->{'custnum'} %>" VALUE="1" <% scalar(@Customers) == 1 ? 'CHECKED' : '' %>>
+    <A HREF="<%$freeside_url%>/view/cust_main.cgi?<% $customer->{'custnum'} %>"><% &RT::URI::freeside::small_custview($customer->{'custnum'}, &RT::URI::freeside::FreesideGetConfig('countrydefault'), 1) |n %>
+  </td>
+</tr>
+% }
+</table>
+
+% }
+
+<%INIT>
+my ($msg);
+
+my $freeside_url = &RT::URI::freeside::FreesideURL();
+
+warn "/Elements/AddCustomers called with CustomerString $CustomerString\n"
+  if $Debug;
+
+my @Customers = ();
+if ( $CustomerString ) {
+    @Customers = &RT::URI::freeside::smart_search( 'search' => $CustomerString );
+}
+
+my @Services = ();
+if ($ServiceString) {
+    @Services = (); #service_search();
+}
+
+warn "/Elements/AddCustomers displaying ". scalar(@Customers). " customers\n"
+  if $Debug;
+
+</%INIT>
+
+<%ARGS>
+$CustomerString => undef
+$ServiceString => undef
+$Debug => 0
+</%ARGS>
diff --git a/rt/share/html/Elements/EditCustomers b/rt/share/html/Elements/EditCustomers
new file mode 100644 (file)
index 0000000..68efb5f
--- /dev/null
@@ -0,0 +1,63 @@
+%# Copyright (c) 2004 Ivan Kohler <ivan-rt@420.am>
+%# Copyright (c) 2008 Freeside Internet Services, Inc.
+%# 
+%# 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.
+<TABLE width=100%>
+  <TR>
+    <TD VALIGN=TOP WIDTH=50%>
+      <h3><&|/l&>Current Customers</&></h3>
+
+<table>
+  <tr>
+    <td><i><&|/l&>(Check box to disassociate)</&></i></td>
+  </tr>
+  <tr>
+    <td class="value">
+% foreach my $link ( @{ $Object->Customers->ItemsArrayRef } ) {
+
+      <INPUT TYPE=CHECKBOX NAME="DeleteLink--<%$link->Type%>-<%$link->Target%>">
+%#        <& ShowLink, URI => $link->TargetURI &><br>
+        <A HREF="<% $link->TargetURI->Resolver->HREF %>"><% $link->TargetURI->Resolver->AsStringLong |n %></A>
+      <BR>
+% }
+    </td>
+  </tr>
+</table>
+                           
+</TD>
+
+<TD VALIGN=TOP>
+<h3><&|/l&>New Customer Links</&></h3>
+<&|/l&>Find customer</&><BR>
+<input name="CustomerString">
+<input type=submit name="OnlySearchForCustomers" value="<&|/l&>Go!</&>">
+<br><i>cust #, name, company or phone</i>
+<BR>
+%#<BR>
+%#<&|/l&>Find service</&><BR>
+%#<input name="ServiceString">
+%#<input type=submit name="OnlySearchForServices" value="<&|/l&>Go!</&>">
+%#<br><i>username, username@domain, domain, or IP address</i>
+%#<BR>
+
+<& AddCustomers, Object         => $Object,
+                 CustomerString => $CustomerString,
+                 ServiceString  => $ServiceString,  &>
+
+</TD>
+</TR>
+</TABLE>
+      
+<%ARGS>
+$CustomerString => undef
+$ServiceString => undef
+$Object => undef
+</%ARGS>
index f8eaf39..c1984bd 100755 (executable)
 %# 
 %# END BPS TAGGED BLOCK }}}
 <& /Elements/Header, 
-    Title => loc("#[_1]: [_2]", $TicketObj->Id, $TicketObj->Subject),
+    Title => loc("Ticket #[_1]: [_2]", $TicketObj->Id, $TicketObj->Subject),
     LinkRel => \%link_rel &>
 <& /Ticket/Elements/Tabs, 
     Ticket => $TicketObj, 
     current_tab => 'Ticket/Display.html?id='.$TicketObj->id,
-    Title => loc("#[_1]: [_2]", $TicketObj->Id, $TicketObj->Subject) &>
+    Title => loc("Ticket #[_1]: [_2]", $TicketObj->Id, $TicketObj->Subject) &>
 
 % $m->callback(CallbackName => 'BeforeActionList', %ARGS, Actions => \@Actions, ARGSRef => \%ARGS, Ticket => $TicketObj);
 
diff --git a/rt/share/html/Ticket/Elements/AddCustomers b/rt/share/html/Ticket/Elements/AddCustomers
new file mode 100644 (file)
index 0000000..e04c077
--- /dev/null
@@ -0,0 +1,52 @@
+%# Copyright (c) 2004 Ivan Kohler <ivan-rt@420.am>
+%# Copyright (c) 2008 Freeside Internet Services, Inc.
+%# 
+%# 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.
+<BR>
+<%$msg%><br>
+
+% if (@Customers) {
+
+<br><i>(Check box to link)<i>
+<table>
+% foreach my $customer (@Customers) {
+<tr>
+  <td>
+    <input type="checkbox" name="Ticket-AddCustomer-<% $customer->{'custnum'} %>" VALUE="1" <% scalar(@Customers) == 1 ? 'CHECKED' : '' %>>
+    <A HREF="<%$freeside_url%>/view/cust_main.cgi?<% $customer->{'custnum'} %>"><% &RT::URI::freeside::small_custview($customer->{'custnum'}, &RT::URI::freeside::FreesideGetConfig('countrydefault'), 1) |n %>
+  </td>
+</tr>
+% }
+</table>
+
+% }
+
+<%INIT>
+my ($msg);
+
+my $freeside_url = &RT::URI::freeside::FreesideURL();
+
+my @Customers = ();
+if ( $CustomerString ) {
+    @Customers = &RT::URI::freeside::smart_search( 'search' => $CustomerString );
+}
+
+my @Services = ();
+if ($ServiceString) {
+    @Services = (); #service_search();
+}
+
+</%INIT>
+
+<%ARGS>
+$CustomerString => undef
+$ServiceString => undef
+</%ARGS>
diff --git a/rt/share/html/Ticket/Elements/EditCustomers b/rt/share/html/Ticket/Elements/EditCustomers
new file mode 100644 (file)
index 0000000..0ba6e44
--- /dev/null
@@ -0,0 +1,63 @@
+%# Copyright (c) 2004 Ivan Kohler <ivan-rt@420.am>
+%# Copyright (c) 2008 Freeside Internet Services, Inc.
+%# 
+%# 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.
+<TABLE width=100%>
+  <TR>
+    <TD VALIGN=TOP WIDTH=50%>
+      <h3><&|/l&>Current Customers</&></h3>
+
+<table>
+  <tr>
+    <td><i><&|/l&>(Check box to disassociate)</&></i></td>
+  </tr>
+  <tr>
+    <td class="value">
+% foreach my $link ( @{ $Ticket->Customers->ItemsArrayRef } ) {
+
+      <INPUT TYPE=CHECKBOX NAME="DeleteLink--<%$link->Type%>-<%$link->Target%>">
+%#        <& ShowLink, URI => $link->TargetURI &><br>
+        <A HREF="<% $link->TargetURI->Resolver->HREF %>"><% $link->TargetURI->Resolver->AsStringLong |n %></A>
+      <BR>
+% }
+    </td>
+  </tr>
+</table>
+                           
+</TD>
+
+<TD VALIGN=TOP>
+<h3><&|/l&>New Customer Links</&></h3>
+<&|/l&>Find customer</&><BR>
+<input name="CustomerString">
+<input type=submit name="OnlySearchForCustomers" value="<&|/l&>Go!</&>">
+<br><i>cust #, name, company or phone</i>
+<BR>
+%#<BR>
+%#<&|/l&>Find service</&><BR>
+%#<input name="ServiceString">
+%#<input type=submit name="OnlySearchForServices" value="<&|/l&>Go!</&>">
+%#<br><i>username, username@domain, domain, or IP address</i>
+%#<BR>
+
+<& AddCustomers, Ticket         => $Ticket,
+                 CustomerString => $CustomerString,
+                 ServiceString  => $ServiceString,  &>
+
+</TD>
+</TR>
+</TABLE>
+      
+<%ARGS>
+$CustomerString => undef
+$ServiceString => undef
+$Ticket => undef
+</%ARGS>
diff --git a/rt/share/html/Ticket/Elements/ShowCustomers b/rt/share/html/Ticket/Elements/ShowCustomers
new file mode 100644 (file)
index 0000000..3acf92d
--- /dev/null
@@ -0,0 +1,38 @@
+%# Copyright (c) 2004 Ivan Kohler <ivan-rt@420.am>
+%#
+%# 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.
+<table>
+% my $cust = 0;
+% foreach my $custResolver ( map { $_->TargetURI->Resolver }
+%                                @{ $Ticket->Customers->ItemsArrayRef }
+%                          )
+% {
+%   $cust++;
+%   my $cust_main = '';
+  <tr>
+    <td class="value">
+      <A HREF="<% $custResolver->HREF %>"><% $custResolver->AsStringLong |n %></A>
+    </td>
+  </tr>
+% }
+% unless ( $cust ) {
+  <tr>
+    <td class="labeltop">
+      <i>(none)<i>
+    </td>
+  </tr>
+
+% }
+</table>
+<%ARGS>
+$Ticket => undef
+</%ARGS>
+
index 4c2d54e..28a2965 100755 (executable)
             <& /Ticket/Elements/ShowPeople, Ticket => $Ticket &>
          </&>
 
+         <&| /Widgets/TitleBox, title => loc('Customers'), 
+               title_href => RT->Config->Get('WebPath')."/Ticket/ModifyCustomers.html?id=".$Ticket->Id, 
+               class => 'ticket-info-customers' &>
+            <& /Ticket/Elements/ShowCustomers, Ticket => $Ticket &>
+         </&>
+
       <& /Ticket/Elements/ShowAttachments, Ticket => $Ticket, Attachments => $Attachments &>
 
          <& /Ticket/Elements/ShowRequestor, Ticket => $Ticket &>
index 9c40b28..51c4aa4 100644 (file)
@@ -207,8 +207,14 @@ my $render_attachment = sub {
             # if it's a text/plain show the body
             elsif ( $message->ContentType =~ m{^(text|message)}i ) {
 
-                eval { require Text::Quoted;  $content = Text::Quoted::extract($content); };
-                if ($@) { $RT::Logger->warning( "Text::Quoted failed: $@" ) }
+                #don't want to use this even if it is installed, its
+                #segfaulting on weird characters and silently truncating the
+                #ticket history output
+                #see:
+                # r44838@pinglin: jesse | 2006-11-14 15:53:18 -0500
+                # * Move Text::Quoted back to being a run-time require. So that it's possible to turn off the feature if it causes your perl to segfault. (Text::Tabs is...not robust in the face of perl bugs)
+                #eval { require Text::Quoted;  $content = Text::Quoted::extract($content); };
+                #if ($@) { $RT::Logger->warning( "Text::Quoted failed: $@" ) }
 
                 $m->comp(
                     'ShowMessageStanza',
index 7deb8c1..a99f219 100755 (executable)
@@ -138,6 +138,10 @@ if ($Ticket) {
             title => loc('Links'),
             path  => "Ticket/ModifyLinks.html?id=" . $id,
         },
+        _Eb=> {
+            title => loc('Customers'),
+            path  => "Ticket/ModifyCustomers.html?id=" . $id,
+        },
         _X => {
             title => loc('Jumbo'),
             path  => "Ticket/ModifyAll.html?id=" . $id,
diff --git a/rt/share/html/Ticket/ModifyCustomers.html b/rt/share/html/Ticket/ModifyCustomers.html
new file mode 100644 (file)
index 0000000..72d103b
--- /dev/null
@@ -0,0 +1,49 @@
+%# Copyright (c) 2004 Ivan Kohler <ivan-rt@420.am>
+%#
+%# 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.
+<& /Elements/Header, Title => loc("Customers for ticket #[_1]", $Ticket->Id) &>
+<& /Ticket/Elements/Tabs, 
+    Ticket => $Ticket, 
+    current_tab => "Ticket/ModifyCustomers.html?id=".$Ticket->Id, 
+    Title => loc("Customers for ticket #[_1]", $Ticket->Id) &>
+
+<& /Elements/ListActions, actions => \@results &>
+
+<form action="ModifyCustomers.html" method="post">
+<input type="hidden" name="id" value="<%$Ticket->id%>">
+
+<& /Elements/TitleBoxStart, title => loc('Edit Customer Links'), color => "#7f007b"&>
+<& Elements/EditCustomers, Ticket => $Ticket, CustomerString => $CustomerString, ServiceString => $ServiceString &>
+<& /Elements/TitleBoxEnd &>
+<& /Elements/Submit, color => "#7f007b", Label => loc('Save Changes') &>
+</form>
+
+
+<%INIT>
+
+my @results = ();
+my $Ticket = LoadTicket($id);
+
+# if we're trying to search for customers/services and nothing else
+unless ( $OnlySearchForCustomers || $OnlySearchForServices) {
+   @results = ProcessTicketCustomers( TicketObj => $Ticket, ARGSRef => \%ARGS);
+}
+    
+</%INIT>
+
+
+<%ARGS>
+$OnlySearchForCustomers => undef
+$OnlySearchForServices => undef
+$CustomerString => undef
+$ServiceString => undef
+$id => undef
+</%ARGS>