freeside/rt/html/Ticket/Elements ShowCustomers,NONE,1.1 EditCustomers,NONE,1.1 AddCustomers,NONE,1.1 ShowSummary,1.1.1.2,1.2 Tabs,1.1.1.2,1.2
ivan
ivan at pouncequick.420.am
Thu Dec 2 01:59:51 PST 2004
Update of /home/cvs/cvsroot/freeside/rt/html/Ticket/Elements
In directory pouncequick:/tmp/cvs-serv24319/rt/html/Ticket/Elements
Modified Files:
ShowSummary Tabs
Added Files:
ShowCustomers EditCustomers AddCustomers
Log Message:
second big RT integration checkin, customer linking/delinking interface
Index: ShowSummary
===================================================================
RCS file: /home/cvs/cvsroot/freeside/rt/html/Ticket/Elements/ShowSummary,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -d -r1.1.1.2 -r1.2
--- ShowSummary 11 Nov 2004 12:11:02 -0000 1.1.1.2
+++ ShowSummary 2 Dec 2004 09:59:47 -0000 1.2
@@ -47,6 +47,15 @@
color => "#333399" &>
<& /Ticket/Elements/ShowPeople, Ticket => $Ticket &>
<& /Elements/TitleBoxEnd &>
+ <br>
+
+ <& /Elements/TitleBoxStart, title => loc('Customers'),
+ title_href =>"$RT::WebPath/Ticket/ModifyCustomers.html?id=".$Ticket->Id,
+ title_class=> 'inverse',
+ color => "#7f007b" &>
+ <& /Ticket/Elements/ShowCustomers, Ticket => $Ticket &>
+ <& /Elements/TitleBoxEnd &>
+
<BR>
</TD>
<TD VALIGN=TOP WIDTH="50%">
--- NEW FILE: ShowCustomers ---
%# Copyright (c) 2004 Ivan Kohler <ivan-rt at 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 $customerURI (
% grep { $_->Resolver->{'fstable'} eq 'cust_main' }
% grep { $_->Scheme eq 'freeside' }
% map { $_->TargetURI }
% @{ $Ticket->_Links('Base')->ItemsArrayRef }
% ) {
% $cust++;
% my $cust_main = '';
<tr>
<td class="value">
<A HREF="<% $customerURI->Resolver->HREF %>"><% $customerURI->Resolver->AsStringLong |n %>
</td>
</tr>
% }
% unless ( $cust ) {
<tr>
<td class="labeltop">
<i>(none)<i>
</td>
</tr>
% }
</table>
<%ARGS>
$Ticket => undef
</%ARGS>
--- NEW FILE: AddCustomers ---
%# BEGIN LICENSE BLOCK
%#
%# Copyright (c) 1996-2003 Jesse Vincent <jesse at bestpractical.com>
%#
%# (Except where explictly superceded by other copyright notices)
%#
%# 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.
%#
%# Unless otherwise specified, all modifications, corrections or
%# extensions to this work which alter its source code become the
%# property of Best Practical Solutions, LLC when submitted for
%# inclusion in the work.
%#
%#
%# END LICENSE BLOCK
<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' : '' %>>
%# <% $customer->name %>
<A HREF="<% $p %>view/cust_main.cgi?<% $customer->custnum %>"><% small_custview( $customer, scalar(FS::Conf->new->config('countrydefault')), 1 ) |n %>
</td>
</tr>
% }
% }
<%INIT>
my ($msg);
my @Customers = ();
if ( $CustomerString ) {
@Customers = smart_search( 'search' => $CustomerString );
warn scalar(@Customers);
}
my @Services = ();
if ($ServiceString) {
@Services = (); #service_search();
}
eval { use FS::CGI qw( popurl small_custview ); };
my $p = eval { popurl(3); };
</%INIT>
<%ARGS>
$CustomerString => undef
$ServiceString => undef
</%ARGS>
--- NEW FILE: EditCustomers ---
%# BEGIN LICENSE BLOCK
%#
%# Copyright (c) 1996-2003 Jesse Vincent <jesse at bestpractical.com>
%#
%# (Except where explictly superceded by other copyright notices)
%#
%# 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.
%#
%# Unless otherwise specified, all modifications, corrections or
%# extensions to this work which alter its source code become the
%# property of Best Practical Solutions, LLC when submitted for
%# inclusion in the work.
%#
%#
%# END LICENSE BLOCK
<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">
% #while (my $link = $Ticket->MemberOf->Next) {
% foreach my $link (
% grep { $_->TargetURI->Resolver->{'fstable'} eq 'cust_main' }
% grep { $_->TargetURI->Scheme eq 'freeside' }
% @{ $Ticket->_Links('Base')->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 %>
<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 #, last name, or company</i>
<BR>
%#<BR>
%#<&|/l&>Find service</&><BR>
%#<input name="ServiceString">
%#<input type=submit name="OnlySearchForServices" value="<&|/l&>Go!</&>">
%#<br><i>username, username at 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>
Index: Tabs
===================================================================
RCS file: /home/cvs/cvsroot/freeside/rt/html/Ticket/Elements/Tabs,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -d -r1.1.1.2 -r1.2
--- Tabs 11 Mar 2004 02:00:56 -0000 1.1.1.2
+++ Tabs 2 Dec 2004 09:59:47 -0000 1.2
@@ -101,6 +101,8 @@
{ title => loc('People'), path => "Ticket/ModifyPeople.html?id=" . $id, },
_E => { title => loc('Links'),
path => "Ticket/ModifyLinks.html?id=" . $id, },
+ _Eb=> { title => loc('Customers'),
+ path => "Ticket/ModifyCustomers.html?id=" . $id, },
_F => { title => loc('Jumbo'),
path => "Ticket/ModifyAll.html?id=" . $id,
seperator => 1
More information about the freeside-commits
mailing list