use strict;
no warnings qw(redefine);
-use vars qw($conf);
+#use vars qw($conf);
use FS;
use FS::UID qw(dbh);
use FS::CGI qw(popurl);
+use FS::UI::Web::small_custview;
use FS::Conf;
use FS::Record qw(qsearchs qsearch dbdef);
use FS::cust_main;
return;
}
- return { $fsrec->hash };
-
-}
-
-sub FreesideURL {
-
- return popurl(3);
+ return { $fsrec->hash, '_object' => $fsrec };
}
sub FreesideGetConfig {
- $conf = new FS::Conf unless ref($conf);
+ #$conf = new FS::Conf unless ref($conf);
+ my $conf = new FS::Conf;
- return $conf->config(@_);
+ return scalar($conf->config(@_));
}
sub smart_search { #Subroutine
- return map { { $_->hash } } &FS::cust_main::smart_search(@_);
+ return map { { $_->hash } } &FS::cust_main::Search::smart_search(@_);
+
+}
+
+sub email_search { #Subroutine
+
+ return map { { $_->hash } } &FS::cust_main::Search::email_search(@_);
}
sub small_custview {
- return &FS::CGI::small_custview(@_);
+ return &FS::UI::Web::small_custview::small_custview(@_);
+
+}
+
+sub _FreesideURILabelLong {
+
+ my $self = shift;
+
+ my $table = $self->{'fstable'};
+ if ( $table eq 'cust_main' ) {
+
+ my $rec = $self->_FreesideGetRecord();
+ return small_custview( $rec->{'_object'},
+ scalar(FS::Conf->new->config('countrydefault')),
+ 1 #nobalance
+ );
+
+ } else {
+
+ return $self->_FreesideURILabel();
+
+ }
+
+}
+
+sub AgentName {
+ my $self = shift;
+ my $rec = $self->_FreesideGetRecord() or return;
+ my $agent = $rec->{'_object'}->agent or return;
+ return $agent->agentnum . ': ' . $agent->agent;
+}
+
+sub CustomerClass {
+ my $self = shift;
+ my $rec = $self->_FreesideGetRecord() or return;
+ my $cust_class = $rec->{'_object'}->cust_class or return;
+ return $cust_class->classname;
+}
+
+sub CustomerTags {
+ my $self = shift;
+ my $rec = $self->_FreesideGetRecord() or return;
+ my @part_tag = $rec->{'_object'}->part_tag;
+ return map {
+ { 'name' => $_->tagname,
+ 'desc' => $_->tagdesc,
+ 'color' => $_->tagcolor }
+ } @part_tag;
}
1;